diff --git a/3d-viewer/CMakeLists.txt b/3d-viewer/CMakeLists.txt index ed940751ea..732a745fac 100644 --- a/3d-viewer/CMakeLists.txt +++ b/3d-viewer/CMakeLists.txt @@ -1,10 +1,10 @@ -ADD_DEFINITIONS(-DPCBNEW) +add_definitions(-DPCBNEW) -INCLUDE_DIRECTORIES( +include_directories( ../pcbnew ../polygon) -SET(3D-VIEWER_SRCS +set(3D-VIEWER_SRCS 3d_aux.cpp 3d_canvas.cpp 3d_class.cpp @@ -14,4 +14,4 @@ SET(3D-VIEWER_SRCS 3d_toolbar.cpp trackball.cpp) -ADD_LIBRARY(3d-viewer ${3D-VIEWER_SRCS}) +add_library(3d-viewer ${3D-VIEWER_SRCS}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 595b8fd386..d045ba5e72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,133 +1,130 @@ # List of variables that may be set from command line: # -# Choose a build type: Release/Debug -#SET(CMAKE_BUILD_TYPE Release) -#SET(CMAKE_BUILD_TYPE Debug) +# CMAKE_BUILD_TYPE Release/Debug (REQUIRED) +# Choose build type: Release/Debug # -# -#SET(wxWidgets_USE_DEBUG ON) +# wxWidgets_USE_DEBUG ON/OFF (REQUIRED) # Should be set to ON only when CMAKE_BUILD_TYPE=Debug. # -#SET(wxWidgets_USE_STATIC ON) -# +# wxWidgets_USE_STATIC ON/OFF (OPTIONAL) +# # # CMAKE_VERBOSE_MAKEFILE ON/OFF (OPTIONAL) # Turns ON/OFF verbose build messages. # You can also pass VERBOSE=1 to make for the same effect. # # CMAKE_INSTALL_PREFIX (OPTIONAL) -# +# # # KICAD_MINIZIP ON/OFF -# +# # # KICAD_PYTHON ON/OFF -# +# # # Our project is called 'kicad'. This is what it will be called in # our makefiles. -PROJECT(kicad) +project(kicad) -CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR) +cmake_minimum_required(VERSION 2.4.6 FATAL_ERROR) # Path to local CMake modules -SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules) +set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules) # Command line option to enable or disable building minizip. Minizip # building is enabled by default. Use -DKICAD_MINZIP=OFF to disable # building minizip. -OPTION(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON) +option(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON) # Comment this out if you don't want to build with Python support. # OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)") # Set flags for GNU compilers. -IF(CMAKE_COMPILER_IS_GNUCXX) +if(CMAKE_COMPILER_IS_GNUCXX) # Set default flags for Release build. - SET(CMAKE_C_FLAGS_RELEASE "-Wall -O2 -DNDEBUG") - SET(CMAKE_CXX_FLAGS_RELEASE "-Wall -O2 -DNDEBUG") - SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s") + set(CMAKE_C_FLAGS_RELEASE "-Wall -O2 -DNDEBUG") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -O2 -DNDEBUG") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s") # Set default flags for Debug build. - SET(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG") - SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG") -ENDIF(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG") +endif(CMAKE_COMPILER_IS_GNUCXX) # Locations for install targets. -SET(KICAD_BIN bin CACHE PATH "Location of KiCad binaries.") +set(KICAD_BIN bin CACHE PATH "Location of KiCad binaries.") -IF(UNIX) - IF(APPLE) - ELSE(APPLE) +if(UNIX) + if(APPLE) + else(APPLE) # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line. - SET(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "") + set(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "") # When used later, "bin" and others with no leading / is relative to CMAKE_INSTALL_PREFIX. - SET(KICAD_PLUGINS lib/kicad/plugins CACHE PATH "Location of KiCad plugins.") - SET(KICAD_DATA share/kicad CACHE PATH "Location of KiCad data files.") - ENDIF(APPLE) -ENDIF(UNIX) + set(KICAD_PLUGINS lib/kicad/plugins CACHE PATH "Location of KiCad plugins.") + set(KICAD_DATA share/kicad CACHE PATH "Location of KiCad data files.") + endif(APPLE) +endif(UNIX) -IF(WIN32) +if(WIN32) # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line. - SET(CMAKE_INSTALL_PREFIX c:/kicad CACHE PATH "") + set(CMAKE_INSTALL_PREFIX c:/kicad CACHE PATH "") # When used later, "winexe" and others with no leading / is relative to CMAKE_INSTALL_PREFIX. - SET(KICAD_PLUGINS ${KICAD_BIN}/plugins) - SET(KICAD_DATA share CACHE PATH "Location of KiCad data files.") -ENDIF(WIN32) - -SET(KICAD_DEMOS ${KICAD_DATA}/demos) -SET(KICAD_INTERNAT ${KICAD_DATA}/internat) -SET(KICAD_TEMPLATE ${KICAD_DATA}/template) - -FIND_PACKAGE(OpenGL) -IF(OPENGL_FOUND) - MESSAGE(STATUS "Check for installed OpenGL -- found") -ELSE(OPENGL_FOUND) - MESSAGE(STATUS "Check for installed OpenGL -- not found") - MESSAGE(FATAL_ERROR "OpenGL was not found - it is required to build KiCad") -ENDIF(OPENGL_FOUND) - -FIND_PACKAGE(Boost) -IF(Boost_FOUND) - MESSAGE(STATUS "Check for installed Boost -- found") -ELSE(Boost_FOUND) - MESSAGE(STATUS "Check for installed Boost -- not found") - MESSAGE(FATAL_ERROR "Boost was not found - it is required to build KiCad") -ENDIF(Boost_FOUND) + set(KICAD_PLUGINS ${KICAD_BIN}/plugins) + set(KICAD_DATA share CACHE PATH "Location of KiCad data files.") +endif(WIN32) + +set(KICAD_DEMOS ${KICAD_DATA}/demos) +set(KICAD_INTERNAT ${KICAD_DATA}/internat) +set(KICAD_TEMPLATE ${KICAD_DATA}/template) + +find_package(OpenGL) +if(OPENGL_FOUND) + message(STATUS "Check for installed OpenGL -- found") +else(OPENGL_FOUND) + message(STATUS "Check for installed OpenGL -- not found") + message(FATAL_ERROR "OpenGL was not found - it is required to build KiCad") +endif(OPENGL_FOUND) + +find_package(Boost) +if(Boost_FOUND) + message(STATUS "Check for installed Boost -- found") +else(Boost_FOUND) + message(STATUS "Check for installed Boost -- not found") + message(FATAL_ERROR "Boost was not found - it is required to build KiCad") +endif(Boost_FOUND) # Here you can define what libraries of wxWidgets you need for your # application. You can figure out what libraries you need here; # http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html -SET(wxWidgets_USE_LIBS base core adv gl html net) -FIND_PACKAGE(wxWidgetsCVS) -IF(wxWidgets_FOUND) - MESSAGE(STATUS "Check for installed wxWidgets -- found") -ELSE(wxWidgets_FOUND) - MESSAGE(STATUS "Check for installed wxWidgets -- not found") - MESSAGE(FATAL_ERROR "wxWidgets was not found - it is required to build KiCad") -ENDIF(wxWidgets_FOUND) +set(wxWidgets_USE_LIBS base core adv gl html net) +find_package(wxWidgetsCVS) +if(wxWidgets_FOUND) + message(STATUS "Check for installed wxWidgets -- found") +else(wxWidgets_FOUND) + message(STATUS "Check for installed wxWidgets -- not found") + message(FATAL_ERROR "wxWidgets was not found - it is required to build KiCad") +endif(wxWidgets_FOUND) # Include wxWidgets macros. -INCLUDE(${wxWidgets_USE_FILE}) +include(${wxWidgets_USE_FILE}) # Include paths. -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/share) # CMake will look in these dirs for nested 'CMakeLists.txt' files. # Binaries. -ADD_SUBDIRECTORY(common) -ADD_SUBDIRECTORY(3d-viewer) -ADD_SUBDIRECTORY(cvpcb) -ADD_SUBDIRECTORY(eeschema) -ADD_SUBDIRECTORY(gerbview) -ADD_SUBDIRECTORY(kicad) -ADD_SUBDIRECTORY(pcbnew) -ADD_SUBDIRECTORY(polygon) +add_subdirectory(common) +add_subdirectory(3d-viewer) +add_subdirectory(cvpcb) +add_subdirectory(eeschema) +add_subdirectory(gerbview) +add_subdirectory(kicad) +add_subdirectory(pcbnew) +add_subdirectory(polygon) # Resources. -ADD_SUBDIRECTORY(demos) -ADD_SUBDIRECTORY(internat) -ADD_SUBDIRECTORY(template) - +add_subdirectory(demos) +add_subdirectory(internat) +add_subdirectory(template) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 0c45c0b834..816f5e9721 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,6 +1,6 @@ -INCLUDE_DIRECTORIES(bitmaps) +include_directories(bitmaps) -SET(COMMON_SRCS +set(COMMON_SRCS base_screen.cpp base_struct.cpp basicframe.cpp @@ -34,4 +34,4 @@ SET(COMMON_SRCS worksheet.cpp wxwineda.cpp) -ADD_LIBRARY(common ${COMMON_SRCS}) +add_library(common ${COMMON_SRCS}) diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index 48557701d4..4d67c7b726 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -1,13 +1,13 @@ -ADD_DEFINITIONS(-DCVPCB) +add_definitions(-DCVPCB) -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_CURRENT_SOURCE_DIR} bitmaps ../3d-viewer ../pcbnew ../polygon) -SET(CVPCB_SRCS +set(CVPCB_SRCS autosel.cpp cfg.cpp class_cvpcb.cpp @@ -33,7 +33,7 @@ SET(CVPCB_SRCS viewlogi.cpp writenetlistpcbnew.cpp) -SET(CVPCB_EXTRA_SRCS +set(CVPCB_EXTRA_SRCS ../pcbnew/basepcbframe.cpp ../pcbnew/class_board.cpp ../pcbnew/class_cotation.cpp @@ -56,24 +56,24 @@ SET(CVPCB_EXTRA_SRCS ../share/drawpanel.cpp ../share/zoom.cpp) -IF(WIN32) - IF(MINGW) +if(WIN32) + 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 + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include -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) -ENDIF(APPLE) + 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) +endif(APPLE) -ADD_EXECUTABLE(cvpcb WIN32 MACOSX_BUNDLE ${CVPCB_SRCS} ${CVPCB_EXTRA_SRCS} ${CVPCB_RESOURCES}) +add_executable(cvpcb WIN32 MACOSX_BUNDLE ${CVPCB_SRCS} ${CVPCB_EXTRA_SRCS} ${CVPCB_RESOURCES}) -TARGET_LINK_LIBRARIES(cvpcb common 3d-viewer polygon ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES}) +target_link_libraries(cvpcb common 3d-viewer polygon ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES}) -INSTALL(TARGETS cvpcb RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) +install(TARGETS cvpcb RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 4eff990009..7431144a48 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -1,4 +1,3 @@ -INSTALL(DIRECTORY electric microwave pspice test_xil_95108 ecc83 interf_u +install(DIRECTORY electric microwave pspice test_xil_95108 ecc83 interf_u DESTINATION ${KICAD_DEMOS} COMPONENT resources PATTERN ".svn" EXCLUDE) - diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 9d3fb8cedc..540a2cd662 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -1,10 +1,10 @@ -ADD_DEFINITIONS(-DEESCHEMA) +add_definitions(-DEESCHEMA) -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_CURRENT_SOURCE_DIR} bitmaps) -SET(EESCHEMA_SRCS +set(EESCHEMA_SRCS affiche.cpp annotate.cpp annotate_dialog.cpp @@ -94,7 +94,7 @@ SET(EESCHEMA_SRCS viewlib_frame.cpp viewlibs.cpp) -SET(EESCHEMA_EXTRA_SRCS +set(EESCHEMA_EXTRA_SRCS ../share/drawframe.cpp ../share/drawpanel.cpp ../share/setpage.cpp @@ -102,26 +102,26 @@ SET(EESCHEMA_EXTRA_SRCS ../share/wxprint.cpp ../share/zoom.cpp) -IF(WIN32) - IF(MINGW) +if(WIN32) + 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 + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include -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) -ENDIF(APPLE) + 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) +endif(APPLE) -ADD_EXECUTABLE(eeschema WIN32 MACOSX_BUNDLE ${EESCHEMA_SRCS} ${EESCHEMA_EXTRA_SRCS} ${EESCHEMA_RESOURCES}) +add_executable(eeschema WIN32 MACOSX_BUNDLE ${EESCHEMA_SRCS} ${EESCHEMA_EXTRA_SRCS} ${EESCHEMA_RESOURCES}) -TARGET_LINK_LIBRARIES(eeschema common ${wxWidgets_LIBRARIES}) +target_link_libraries(eeschema common ${wxWidgets_LIBRARIES}) -INSTALL(TARGETS eeschema RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) +install(TARGETS eeschema RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) -ADD_SUBDIRECTORY(plugins) +add_subdirectory(plugins) diff --git a/eeschema/plugins/CMakeLists.txt b/eeschema/plugins/CMakeLists.txt index 0bd9cb5a39..18852f3204 100644 --- a/eeschema/plugins/CMakeLists.txt +++ b/eeschema/plugins/CMakeLists.txt @@ -1,7 +1,7 @@ -IF(UNIX) - ADD_DEFINITIONS(-D__UNIX__) -ENDIF(UNIX) +if(UNIX) + add_definitions(-D__UNIX__) +endif(UNIX) -ADD_EXECUTABLE(netlist_form_pads-pcb netlist_form_pads-pcb.cpp) +add_executable(netlist_form_pads-pcb netlist_form_pads-pcb.cpp) -INSTALL(TARGETS netlist_form_pads-pcb RUNTIME DESTINATION ${KICAD_PLUGINS} COMPONENT binary) +install(TARGETS netlist_form_pads-pcb RUNTIME DESTINATION ${KICAD_PLUGINS} COMPONENT binary) diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index e27811b932..eeb8780859 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -1,13 +1,13 @@ -ADD_DEFINITIONS(-DGERBVIEW -DPCBNEW) +add_definitions(-DGERBVIEW -DPCBNEW) -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ../3d-viewer ../cvpcb ../pcbnew ../polygon) -SET(GERBVIEW_SRCS +set(GERBVIEW_SRCS affiche.cpp block.cpp controle.cpp @@ -39,7 +39,7 @@ SET(GERBVIEW_SRCS trpiste.cpp undelete.cpp) -SET(GERBVIEW_EXTRA_SRCS +set(GERBVIEW_EXTRA_SRCS ../pcbnew/basepcbframe.cpp ../pcbnew/class_board.cpp ../pcbnew/class_drawsegment.cpp @@ -58,24 +58,24 @@ SET(GERBVIEW_EXTRA_SRCS ../share/wxprint.cpp ../share/zoom.cpp) -IF(WIN32) - IF(MINGW) +if(WIN32) + 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 + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include -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) -ENDIF(APPLE) + 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) +endif(APPLE) -ADD_EXECUTABLE(gerbview WIN32 MACOSX_BUNDLE ${GERBVIEW_SRCS} ${GERBVIEW_EXTRA_SRCS} ${GERBVIEW_RESOURCES}) +add_executable(gerbview WIN32 MACOSX_BUNDLE ${GERBVIEW_SRCS} ${GERBVIEW_EXTRA_SRCS} ${GERBVIEW_RESOURCES}) -TARGET_LINK_LIBRARIES(gerbview common 3d-viewer polygon ${wxWidgets_LIBRARIES}) +target_link_libraries(gerbview common 3d-viewer polygon ${wxWidgets_LIBRARIES}) -INSTALL(TARGETS gerbview RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) +install(TARGETS gerbview RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) diff --git a/how-to-build-kicad.txt b/how-to-build-kicad.txt index 67367b2342..ed3896952d 100644 --- a/how-to-build-kicad.txt +++ b/how-to-build-kicad.txt @@ -1,6 +1,6 @@ --== How to build kicad using CMAKE ==-- First Written: 19-Dec-2007 -Last Revised: 06-Jan-2008 +Last Revised: 11-Mar-2008 Kicad needs wxWidgets, the multi platform G.U.I. @@ -157,9 +157,9 @@ You can use the subversion repository or a tar file for this. See the wiki. If windows, go into your msys shell. Linux and windows users both then make two "out of source" build directories: cd - mkdir -p Build/Release - mkdir Build/Debug - cd Build/Release + mkdir -p build/release + mkdir build/debug + cd build/release On either cmake command line shown below, you can optionally include -DCMAKE_INSTALL_PREFIX= @@ -191,7 +191,7 @@ So point your Boost_INCLUDE_DIR:PATH= variable to a directory above the You compile Kicad here. You will only need to do step 8) again when one of the CMakeLists.txt files change. If windows, you must be in your msys shell. On either platform then: - cd /Build/Release + cd /build/release make [sudo] make install @@ -201,7 +201,7 @@ You are now done unless you want to make a Debug build. 11) Making a "Debug" build. - cd /Build/Debug + cd /build/debug On either cmake command line shown below, you can optionally include -DCMAKE_INSTALL_PREFIX= before the final ../../ argument. Although diff --git a/internat/CMakeLists.txt b/internat/CMakeLists.txt index fbc4b14971..d80b3dbb5f 100644 --- a/internat/CMakeLists.txt +++ b/internat/CMakeLists.txt @@ -1,4 +1,3 @@ -INSTALL(DIRECTORY ca cs de es fr hu it ko pl pt ru sl sv zh_CN +install(DIRECTORY ca cs de es fr hu it ko pl pt ru sl sv zh_CN DESTINATION ${KICAD_INTERNAT} COMPONENT resources PATTERN ".svn" EXCLUDE PATTERN "*.po" EXCLUDE) - diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index 0d41db3642..b5bdde06f7 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -1,8 +1,8 @@ -ADD_DEFINITIONS(-DKICAD) +add_definitions(-DKICAD) -INCLUDE_DIRECTORIES(bitmaps) +include_directories(bitmaps) -SET(KICAD_SRCS +set(KICAD_SRCS buildmnu.cpp commandframe.cpp files-io.cpp @@ -13,28 +13,28 @@ SET(KICAD_SRCS treeprj_datas.cpp treeprj_frame.cpp) -IF(WIN32) - IF(MINGW) +if(WIN32) + 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 + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include -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) -ENDIF(APPLE) + 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) +endif(APPLE) -ADD_EXECUTABLE(kicad WIN32 MACOSX_BUNDLE ${KICAD_SRCS} ${KICAD_EXTRA_SRCS} ${KICAD_RESOURCES}) +add_executable(kicad WIN32 MACOSX_BUNDLE ${KICAD_SRCS} ${KICAD_EXTRA_SRCS} ${KICAD_RESOURCES}) -TARGET_LINK_LIBRARIES(kicad common ${wxWidgets_LIBRARIES}) +target_link_libraries(kicad common ${wxWidgets_LIBRARIES}) -INSTALL(TARGETS kicad RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) +install(TARGETS kicad RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) -IF(KICAD_MINIZIP) - ADD_SUBDIRECTORY(minizip) -ENDIF(KICAD_MINIZIP) +if(KICAD_MINIZIP) + add_subdirectory(minizip) +endif(KICAD_MINIZIP) diff --git a/kicad/minizip/CMakeLists.txt b/kicad/minizip/CMakeLists.txt index 09c4eef35a..7d66f0d33f 100644 --- a/kicad/minizip/CMakeLists.txt +++ b/kicad/minizip/CMakeLists.txt @@ -1,27 +1,27 @@ -FIND_PACKAGE(ZLIB) -IF(ZLIB_FOUND) - MESSAGE(STATUS "Check for installed zlib -- found") -ELSE(ZLIB_FOUND) - MESSAGE(STATUS "Check for installed zlib -- not found") - IF(NOT MINGW) - MESSAGE(FATAL_ERROR +find_package(ZLIB) +if(ZLIB_FOUND) + message(STATUS "Check for installed zlib -- found") +else(ZLIB_FOUND) + message(STATUS "Check for installed zlib -- not found") + if(NOT MINGW) + message(FATAL_ERROR "zlib was not found - it is required to build KiCad") - ELSE(NOT MINGW) + else(NOT MINGW) # zlib is not installed, and in this case wxWidgets creates its own zlib library # include files are in ${wxWidgets_ROOT_DIR}/src/zlib # and the corresponding library is libwxzlib-.a (like libwxzlib-2.8.a) # and we try to use it - INCLUDE_DIRECTORIES(${wxWidgets_ROOT_DIR}/src/zlib) - ENDIF(NOT MINGW) -ENDIF(ZLIB_FOUND) + include_directories(${wxWidgets_ROOT_DIR}/src/zlib) + endif(NOT MINGW) +endif(ZLIB_FOUND) -SET(MINIZIP_SRCS +set(MINIZIP_SRCS ioapi.c minizip.c zip.c) -ADD_EXECUTABLE(minizip ${MINIZIP_SRCS}) +add_executable(minizip ${MINIZIP_SRCS}) -TARGET_LINK_LIBRARIES(minizip ${ZLIB_LIBRARIES} ${wxWidgets_LIBRARIES}) +target_link_libraries(minizip ${ZLIB_LIBRARIES}) -INSTALL(TARGETS minizip RUNTIME DESTINATION bin COMPONENT binary) +install(TARGETS minizip RUNTIME DESTINATION bin COMPONENT binary) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 22073a1b37..53efd82f36 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -1,6 +1,6 @@ -ADD_DEFINITIONS(-DPCBNEW) +add_definitions(-DPCBNEW) -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIR} bitmaps @@ -8,7 +8,7 @@ INCLUDE_DIRECTORIES( ../polygon) # Many of the commented out ones are nested in *.cpp files for dialogs -SET(PCBNEW_SRCS +set(PCBNEW_SRCS affiche.cpp attribut.cpp automove.cpp @@ -78,7 +78,7 @@ SET(PCBNEW_SRCS gen_modules_placefile.cpp gendrill.cpp globaleditpad.cpp - gpcb_exchange.cpp + gpcb_exchange.cpp graphpcb.cpp hotkeys.cpp initpcb.cpp @@ -141,40 +141,40 @@ SET(PCBNEW_SRCS zones_by_polygon.cpp zones_test_and_combine_areas.cpp) -SET(PCBNEW_EXTRA_SRCS +set(PCBNEW_EXTRA_SRCS ../share/drawframe.cpp ../share/drawpanel.cpp ../share/setpage.cpp ../share/wxprint.cpp ../share/zoom.cpp) -IF(WIN32) - IF(MINGW) +if(WIN32) + 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 + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include -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) -ENDIF(APPLE) + 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) +endif(APPLE) -ADD_EXECUTABLE(pcbnew WIN32 MACOSX_BUNDLE ${PCBNEW_SRCS} ${PCBNEW_EXTRA_SRCS} ${PCBNEW_RESOURCES}) +add_executable(pcbnew WIN32 MACOSX_BUNDLE ${PCBNEW_SRCS} ${PCBNEW_EXTRA_SRCS} ${PCBNEW_RESOURCES}) # This one gets made only when testing. -ADD_EXECUTABLE(dsntest EXCLUDE_FROM_ALL dsn.cpp) -TARGET_LINK_LIBRARIES(dsntest common ${wxWidgets_LIBRARIES}) +add_executable(dsntest EXCLUDE_FROM_ALL dsn.cpp) +target_link_libraries(dsntest common ${wxWidgets_LIBRARIES}) # This one gets made only when testing. -ADD_EXECUTABLE(specctra_test EXCLUDE_FROM_ALL specctra.cpp dsn.cpp) -TARGET_LINK_LIBRARIES(specctra_test common ${wxWidgets_LIBRARIES}) +add_executable(specctra_test EXCLUDE_FROM_ALL specctra.cpp dsn.cpp) +target_link_libraries(specctra_test common ${wxWidgets_LIBRARIES}) -TARGET_LINK_LIBRARIES(pcbnew common 3d-viewer polygon ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES}) +target_link_libraries(pcbnew common 3d-viewer polygon ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES}) -INSTALL(TARGETS pcbnew RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) +install(TARGETS pcbnew RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) diff --git a/polygon/CMakeLists.txt b/polygon/CMakeLists.txt index 1db2457d49..776c068a24 100644 --- a/polygon/CMakeLists.txt +++ b/polygon/CMakeLists.txt @@ -1,8 +1,8 @@ -SET(POLYGON_SRCS +set(POLYGON_SRCS GenericPolygonClipperLibrary.cpp math_for_graphics.cpp php_polygon.cpp php_polygon_vertex.cpp PolyLine.cpp) -ADD_LIBRARY(polygon ${POLYGON_SRCS}) +add_library(polygon ${POLYGON_SRCS}) diff --git a/template/CMakeLists.txt b/template/CMakeLists.txt index 374004c581..4ef7ed689b 100644 --- a/template/CMakeLists.txt +++ b/template/CMakeLists.txt @@ -1,2 +1,2 @@ -INSTALL(FILES kicad.pro +install(FILES kicad.pro DESTINATION ${KICAD_TEMPLATE} COMPONENT resources)