From cda4ed965944010bd5847c43c449fdca0251d58a Mon Sep 17 00:00:00 2001 From: f3nix Date: Wed, 26 Dec 2007 03:48:17 +0000 Subject: [PATCH] Some tweaks for Windows CMake. --- CMakeLists.txt | 15 +++++++-------- cvpcb/CMakeLists.txt | 11 ++++++++++- eeschema/CMakeLists.txt | 14 +++++++++++--- gerbview/CMakeLists.txt | 11 ++++++++++- kicad/CMakeLists.txt | 11 ++++++++++- pcbnew/CMakeLists.txt | 11 ++++++++++- 6 files changed, 58 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab56bb2443..7c411bf25a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,16 +44,15 @@ ENDIF(UNIX) IF(WIN32) # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line. - SET(CMAKE_INSTALL_PREFIX C:/kicad) + SET(CMAKE_INSTALL_PREFIX c:/kicad) # When used later, "winexe" and others with no leading / is relative to CMAKE_INSTALL_PREFIX. SET(KICAD_BIN winexe CACHE PATH "Location of KiCad binaries.") - SET(KICAD_PLUGINS lib/kicad/plugins CACHE PATH "Location of KiCad plugins.") - SET(KICAD_DOCS share/doc/kicad CACHE PATH "Location of KiCad documentation files.") - SET(KICAD_DATA share/kicad CACHE PATH "Location of KiCad data files.") - SET(KICAD_MODULES ${KICAD_DATA}/modules) - SET(KICAD_LIBRARY ${KICAD_DATA}/library) - SET(KICAD_INTERNAT ${KICAD_DATA}/internat) - SET(KICAD_TEMPLATE ${KICAD_DATA}/template) + SET(KICAD_PLUGINS ${KICAD_BIN}/plugins) + SET(KICAD_DOCS help) + SET(KICAD_MODULES modules) + SET(KICAD_LIBRARY library) + SET(KICAD_INTERNAT internat) + SET(KICAD_TEMPLATE template) ENDIF(WIN32) # Did we find wxWidgets ? This condition will fail diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index 302edc1c04..030021274e 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -55,7 +55,16 @@ SET(CVPCB_EXTRA_SRCS ../share/zoom.cpp) IF(WIN32) - SET(CVPCB_RESOURCES cvpcb.rc) + IF(MINGW) + # resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o + COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} + -i ${CMAKE_CURRENT_SOURCE_DIR}/cvpcb.rc + -o ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o) + SET(CVPCB_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o) + ELSE(MINGW) + SET(CVPCB_RESOURCES cvpcb.rc) + ENDIF(MINGW) ENDIF(WIN32) IF(APPLE) SET(CVPCB_RESOURCES cvpcb.r) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 772a14e86d..3ccf5664dc 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -101,11 +101,19 @@ SET(EESCHEMA_EXTRA_SRCS ../share/setpage.cpp ../share/svg_print.cpp ../share/wxprint.cpp - ../share/zoom.cpp -) + ../share/zoom.cpp) IF(WIN32) - SET(EESCHEMA_RESOURCES eeschema.rc) + IF(MINGW) + # resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o + COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} + -i ${CMAKE_CURRENT_SOURCE_DIR}/eeschema.rc + -o ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o) + SET(EESCHEMA_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o) + ELSE(MINGW) + SET(EESCHEMA_RESOURCES eeschema.rc) + ENDIF(MINGW) ENDIF(WIN32) IF(APPLE) SET(EESCHEMA_RESOURCES eeschema.r) diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index 1ee6ddb389..5864e62a20 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -57,7 +57,16 @@ SET(GERBVIEW_EXTRA_SRCS ../share/zoom.cpp) IF(WIN32) - SET(GERBVIEW_RESOURCES gerbview.rc) + IF(MINGW) + # resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o + COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} + -i ${CMAKE_CURRENT_SOURCE_DIR}/gerbview.rc + -o ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o) + SET(GERBVIEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o) + ELSE(MINGW) + SET(GERBVIEW_RESOURCES gerbview.rc) + ENDIF(MINGW) ENDIF(WIN32) IF(APPLE) SET(GERBVIEW_RESOURCES gerbview.r) diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index beb66f8336..042f10963f 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -17,7 +17,16 @@ SET(KICAD_EXTRA_SRCS ../share/infospgm.cpp) IF(WIN32) - SET(KICAD_RESOURCES kicad.rc) + IF(MINGW) + # resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o + COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} + -i ${CMAKE_CURRENT_SOURCE_DIR}/kicad.rc + -o ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o) + SET(KICAD_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o) + ELSE(MINGW) + SET(KICAD_RESOURCES kicad.rc) + ENDIF(MINGW) ENDIF(WIN32) IF(APPLE) SET(KICAD_RESOURCES kicad.r) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 1f47db95cd..9a1835d638 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -149,7 +149,16 @@ SET(PCBNEW_EXTRA_SRCS ../share/zoom.cpp) IF(WIN32) - SET(PCBNEW_RESOURCES pcbnew.rc) + IF(MINGW) + # resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o + COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} + -i ${CMAKE_CURRENT_SOURCE_DIR}/pcbnew.rc + -o ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o) + SET(PCBNEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o) + ELSE(MINGW) + SET(PCBNEW_RESOURCES pcbnew.rc) + ENDIF(MINGW) ENDIF(WIN32) IF(APPLE) SET(PCBNEW_RESOURCES pcbnew.r)