Commit 07a0e142 authored by f3nix's avatar f3nix

Lowercase CMake commands.

parent 7356d483
ADD_DEFINITIONS(-DPCBNEW) add_definitions(-DPCBNEW)
INCLUDE_DIRECTORIES( include_directories(
../pcbnew ../pcbnew
../polygon) ../polygon)
SET(3D-VIEWER_SRCS set(3D-VIEWER_SRCS
3d_aux.cpp 3d_aux.cpp
3d_canvas.cpp 3d_canvas.cpp
3d_class.cpp 3d_class.cpp
...@@ -14,4 +14,4 @@ SET(3D-VIEWER_SRCS ...@@ -14,4 +14,4 @@ SET(3D-VIEWER_SRCS
3d_toolbar.cpp 3d_toolbar.cpp
trackball.cpp) trackball.cpp)
ADD_LIBRARY(3d-viewer ${3D-VIEWER_SRCS}) add_library(3d-viewer ${3D-VIEWER_SRCS})
# List of variables that may be set from command line: # List of variables that may be set from command line:
# #
# Choose a build type: Release/Debug # CMAKE_BUILD_TYPE Release/Debug (REQUIRED)
#SET(CMAKE_BUILD_TYPE Release) # Choose build type: Release/Debug
#SET(CMAKE_BUILD_TYPE Debug)
# #
# # wxWidgets_USE_DEBUG ON/OFF (REQUIRED)
#SET(wxWidgets_USE_DEBUG ON)
# Should be set to ON only when CMAKE_BUILD_TYPE=Debug. # 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) # CMAKE_VERBOSE_MAKEFILE ON/OFF (OPTIONAL)
# Turns ON/OFF verbose build messages. # Turns ON/OFF verbose build messages.
# You can also pass VERBOSE=1 to make for the same effect. # You can also pass VERBOSE=1 to make for the same effect.
# #
# CMAKE_INSTALL_PREFIX (OPTIONAL) # CMAKE_INSTALL_PREFIX (OPTIONAL)
# #
# #
# KICAD_MINIZIP ON/OFF # KICAD_MINIZIP ON/OFF
# #
# #
# KICAD_PYTHON ON/OFF # KICAD_PYTHON ON/OFF
# #
# #
# Our project is called 'kicad'. This is what it will be called in # Our project is called 'kicad'. This is what it will be called in
# our makefiles. # 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 # 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 # Command line option to enable or disable building minizip. Minizip
# building is enabled by default. Use -DKICAD_MINZIP=OFF to disable # building is enabled by default. Use -DKICAD_MINZIP=OFF to disable
# building minizip. # 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. # Comment this out if you don't want to build with Python support.
# OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)") # OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)")
# Set flags for GNU compilers. # Set flags for GNU compilers.
IF(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
# Set default flags for Release build. # Set default flags for Release build.
SET(CMAKE_C_FLAGS_RELEASE "-Wall -O2 -DNDEBUG") set(CMAKE_C_FLAGS_RELEASE "-Wall -O2 -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELEASE "-Wall -O2 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-Wall -O2 -DNDEBUG")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s")
# Set default flags for Debug build. # Set default flags for Debug build.
SET(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG") set(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG") set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
ENDIF(CMAKE_COMPILER_IS_GNUCXX) endif(CMAKE_COMPILER_IS_GNUCXX)
# Locations for install targets. # 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(UNIX)
IF(APPLE) if(APPLE)
ELSE(APPLE) else(APPLE)
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line. # 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. # 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_PLUGINS lib/kicad/plugins CACHE PATH "Location of KiCad plugins.")
SET(KICAD_DATA share/kicad CACHE PATH "Location of KiCad data files.") set(KICAD_DATA share/kicad CACHE PATH "Location of KiCad data files.")
ENDIF(APPLE) endif(APPLE)
ENDIF(UNIX) endif(UNIX)
IF(WIN32) if(WIN32)
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line. # 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. # When used later, "winexe" and others with no leading / is relative to CMAKE_INSTALL_PREFIX.
SET(KICAD_PLUGINS ${KICAD_BIN}/plugins) set(KICAD_PLUGINS ${KICAD_BIN}/plugins)
SET(KICAD_DATA share CACHE PATH "Location of KiCad data files.") set(KICAD_DATA share CACHE PATH "Location of KiCad data files.")
ENDIF(WIN32) endif(WIN32)
SET(KICAD_DEMOS ${KICAD_DATA}/demos) set(KICAD_DEMOS ${KICAD_DATA}/demos)
SET(KICAD_INTERNAT ${KICAD_DATA}/internat) set(KICAD_INTERNAT ${KICAD_DATA}/internat)
SET(KICAD_TEMPLATE ${KICAD_DATA}/template) set(KICAD_TEMPLATE ${KICAD_DATA}/template)
FIND_PACKAGE(OpenGL) find_package(OpenGL)
IF(OPENGL_FOUND) if(OPENGL_FOUND)
MESSAGE(STATUS "Check for installed OpenGL -- found") message(STATUS "Check for installed OpenGL -- found")
ELSE(OPENGL_FOUND) else(OPENGL_FOUND)
MESSAGE(STATUS "Check for installed OpenGL -- not found") message(STATUS "Check for installed OpenGL -- not found")
MESSAGE(FATAL_ERROR "OpenGL was not found - it is required to build KiCad") message(FATAL_ERROR "OpenGL was not found - it is required to build KiCad")
ENDIF(OPENGL_FOUND) endif(OPENGL_FOUND)
FIND_PACKAGE(Boost) find_package(Boost)
IF(Boost_FOUND) if(Boost_FOUND)
MESSAGE(STATUS "Check for installed Boost -- found") message(STATUS "Check for installed Boost -- found")
ELSE(Boost_FOUND) else(Boost_FOUND)
MESSAGE(STATUS "Check for installed Boost -- not found") message(STATUS "Check for installed Boost -- not found")
MESSAGE(FATAL_ERROR "Boost was not found - it is required to build KiCad") message(FATAL_ERROR "Boost was not found - it is required to build KiCad")
ENDIF(Boost_FOUND) endif(Boost_FOUND)
# Here you can define what libraries of wxWidgets you need for your # Here you can define what libraries of wxWidgets you need for your
# application. You can figure out what libraries you need here; # application. You can figure out what libraries you need here;
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html # http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
SET(wxWidgets_USE_LIBS base core adv gl html net) set(wxWidgets_USE_LIBS base core adv gl html net)
FIND_PACKAGE(wxWidgetsCVS) find_package(wxWidgetsCVS)
IF(wxWidgets_FOUND) if(wxWidgets_FOUND)
MESSAGE(STATUS "Check for installed wxWidgets -- found") message(STATUS "Check for installed wxWidgets -- found")
ELSE(wxWidgets_FOUND) else(wxWidgets_FOUND)
MESSAGE(STATUS "Check for installed wxWidgets -- not found") message(STATUS "Check for installed wxWidgets -- not found")
MESSAGE(FATAL_ERROR "wxWidgets was not found - it is required to build KiCad") message(FATAL_ERROR "wxWidgets was not found - it is required to build KiCad")
ENDIF(wxWidgets_FOUND) endif(wxWidgets_FOUND)
# Include wxWidgets macros. # Include wxWidgets macros.
INCLUDE(${wxWidgets_USE_FILE}) include(${wxWidgets_USE_FILE})
# Include paths. # Include paths.
INCLUDE_DIRECTORIES( include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/share) ${CMAKE_CURRENT_SOURCE_DIR}/share)
# CMake will look in these dirs for nested 'CMakeLists.txt' files. # CMake will look in these dirs for nested 'CMakeLists.txt' files.
# Binaries. # Binaries.
ADD_SUBDIRECTORY(common) add_subdirectory(common)
ADD_SUBDIRECTORY(3d-viewer) add_subdirectory(3d-viewer)
ADD_SUBDIRECTORY(cvpcb) add_subdirectory(cvpcb)
ADD_SUBDIRECTORY(eeschema) add_subdirectory(eeschema)
ADD_SUBDIRECTORY(gerbview) add_subdirectory(gerbview)
ADD_SUBDIRECTORY(kicad) add_subdirectory(kicad)
ADD_SUBDIRECTORY(pcbnew) add_subdirectory(pcbnew)
ADD_SUBDIRECTORY(polygon) add_subdirectory(polygon)
# Resources. # Resources.
ADD_SUBDIRECTORY(demos) add_subdirectory(demos)
ADD_SUBDIRECTORY(internat) add_subdirectory(internat)
ADD_SUBDIRECTORY(template) add_subdirectory(template)
INCLUDE_DIRECTORIES(bitmaps) include_directories(bitmaps)
SET(COMMON_SRCS set(COMMON_SRCS
base_screen.cpp base_screen.cpp
base_struct.cpp base_struct.cpp
basicframe.cpp basicframe.cpp
...@@ -34,4 +34,4 @@ SET(COMMON_SRCS ...@@ -34,4 +34,4 @@ SET(COMMON_SRCS
worksheet.cpp worksheet.cpp
wxwineda.cpp) wxwineda.cpp)
ADD_LIBRARY(common ${COMMON_SRCS}) add_library(common ${COMMON_SRCS})
ADD_DEFINITIONS(-DCVPCB) add_definitions(-DCVPCB)
INCLUDE_DIRECTORIES( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
bitmaps bitmaps
../3d-viewer ../3d-viewer
../pcbnew ../pcbnew
../polygon) ../polygon)
SET(CVPCB_SRCS set(CVPCB_SRCS
autosel.cpp autosel.cpp
cfg.cpp cfg.cpp
class_cvpcb.cpp class_cvpcb.cpp
...@@ -33,7 +33,7 @@ SET(CVPCB_SRCS ...@@ -33,7 +33,7 @@ SET(CVPCB_SRCS
viewlogi.cpp viewlogi.cpp
writenetlistpcbnew.cpp) writenetlistpcbnew.cpp)
SET(CVPCB_EXTRA_SRCS set(CVPCB_EXTRA_SRCS
../pcbnew/basepcbframe.cpp ../pcbnew/basepcbframe.cpp
../pcbnew/class_board.cpp ../pcbnew/class_board.cpp
../pcbnew/class_cotation.cpp ../pcbnew/class_cotation.cpp
...@@ -56,24 +56,24 @@ SET(CVPCB_EXTRA_SRCS ...@@ -56,24 +56,24 @@ SET(CVPCB_EXTRA_SRCS
../share/drawpanel.cpp ../share/drawpanel.cpp
../share/zoom.cpp) ../share/zoom.cpp)
IF(WIN32) if(WIN32)
IF(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) # 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 COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/cvpcb.rc -i ${CMAKE_CURRENT_SOURCE_DIR}/cvpcb.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o) -o ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o)
SET(CVPCB_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o) set(CVPCB_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/cvpcb_rc.o)
ELSE(MINGW) else(MINGW)
SET(CVPCB_RESOURCES cvpcb.rc) set(CVPCB_RESOURCES cvpcb.rc)
ENDIF(MINGW) endif(MINGW)
ENDIF(WIN32) endif(WIN32)
IF(APPLE) if(APPLE)
SET(CVPCB_RESOURCES cvpcb.r) set(CVPCB_RESOURCES cvpcb.r)
ENDIF(APPLE) 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)
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 DESTINATION ${KICAD_DEMOS} COMPONENT resources
PATTERN ".svn" EXCLUDE) PATTERN ".svn" EXCLUDE)
ADD_DEFINITIONS(-DEESCHEMA) add_definitions(-DEESCHEMA)
INCLUDE_DIRECTORIES( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
bitmaps) bitmaps)
SET(EESCHEMA_SRCS set(EESCHEMA_SRCS
affiche.cpp affiche.cpp
annotate.cpp annotate.cpp
annotate_dialog.cpp annotate_dialog.cpp
...@@ -94,7 +94,7 @@ SET(EESCHEMA_SRCS ...@@ -94,7 +94,7 @@ SET(EESCHEMA_SRCS
viewlib_frame.cpp viewlib_frame.cpp
viewlibs.cpp) viewlibs.cpp)
SET(EESCHEMA_EXTRA_SRCS set(EESCHEMA_EXTRA_SRCS
../share/drawframe.cpp ../share/drawframe.cpp
../share/drawpanel.cpp ../share/drawpanel.cpp
../share/setpage.cpp ../share/setpage.cpp
...@@ -102,26 +102,26 @@ SET(EESCHEMA_EXTRA_SRCS ...@@ -102,26 +102,26 @@ SET(EESCHEMA_EXTRA_SRCS
../share/wxprint.cpp ../share/wxprint.cpp
../share/zoom.cpp) ../share/zoom.cpp)
IF(WIN32) if(WIN32)
IF(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) # 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 COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/eeschema.rc -i ${CMAKE_CURRENT_SOURCE_DIR}/eeschema.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o) -o ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o)
SET(EESCHEMA_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o) set(EESCHEMA_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/eeschema_rc.o)
ELSE(MINGW) else(MINGW)
SET(EESCHEMA_RESOURCES eeschema.rc) set(EESCHEMA_RESOURCES eeschema.rc)
ENDIF(MINGW) endif(MINGW)
ENDIF(WIN32) endif(WIN32)
IF(APPLE) if(APPLE)
SET(EESCHEMA_RESOURCES eeschema.r) set(EESCHEMA_RESOURCES eeschema.r)
ENDIF(APPLE) 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)
IF(UNIX) if(UNIX)
ADD_DEFINITIONS(-D__UNIX__) add_definitions(-D__UNIX__)
ENDIF(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)
ADD_DEFINITIONS(-DGERBVIEW -DPCBNEW) add_definitions(-DGERBVIEW -DPCBNEW)
INCLUDE_DIRECTORIES( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
../3d-viewer ../3d-viewer
../cvpcb ../cvpcb
../pcbnew ../pcbnew
../polygon) ../polygon)
SET(GERBVIEW_SRCS set(GERBVIEW_SRCS
affiche.cpp affiche.cpp
block.cpp block.cpp
controle.cpp controle.cpp
...@@ -39,7 +39,7 @@ SET(GERBVIEW_SRCS ...@@ -39,7 +39,7 @@ SET(GERBVIEW_SRCS
trpiste.cpp trpiste.cpp
undelete.cpp) undelete.cpp)
SET(GERBVIEW_EXTRA_SRCS set(GERBVIEW_EXTRA_SRCS
../pcbnew/basepcbframe.cpp ../pcbnew/basepcbframe.cpp
../pcbnew/class_board.cpp ../pcbnew/class_board.cpp
../pcbnew/class_drawsegment.cpp ../pcbnew/class_drawsegment.cpp
...@@ -58,24 +58,24 @@ SET(GERBVIEW_EXTRA_SRCS ...@@ -58,24 +58,24 @@ SET(GERBVIEW_EXTRA_SRCS
../share/wxprint.cpp ../share/wxprint.cpp
../share/zoom.cpp) ../share/zoom.cpp)
IF(WIN32) if(WIN32)
IF(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) # 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 COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/gerbview.rc -i ${CMAKE_CURRENT_SOURCE_DIR}/gerbview.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o) -o ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o)
SET(GERBVIEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o) set(GERBVIEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/gerbview_rc.o)
ELSE(MINGW) else(MINGW)
SET(GERBVIEW_RESOURCES gerbview.rc) set(GERBVIEW_RESOURCES gerbview.rc)
ENDIF(MINGW) endif(MINGW)
ENDIF(WIN32) endif(WIN32)
IF(APPLE) if(APPLE)
SET(GERBVIEW_RESOURCES gerbview.r) set(GERBVIEW_RESOURCES gerbview.r)
ENDIF(APPLE) 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)
--== How to build kicad using CMAKE ==-- --== How to build kicad using CMAKE ==--
First Written: 19-Dec-2007 First Written: 19-Dec-2007
Last Revised: 06-Jan-2008 Last Revised: 11-Mar-2008
Kicad needs wxWidgets, the multi platform G.U.I. 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. ...@@ -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 If windows, go into your msys shell. Linux and windows users both then make
two "out of source" build directories: two "out of source" build directories:
cd <kicadSource> cd <kicadSource>
mkdir -p Build/Release mkdir -p build/release
mkdir Build/Debug mkdir build/debug
cd Build/Release cd build/release
On either cmake command line shown below, you can optionally include On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir> -DCMAKE_INSTALL_PREFIX=<finallInstallDir>
...@@ -191,7 +191,7 @@ So point your Boost_INCLUDE_DIR:PATH= variable to a directory above the ...@@ -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 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. CMakeLists.txt files change. If windows, you must be in your msys shell.
On either platform then: On either platform then:
cd <kicadSource>/Build/Release cd <kicadSource>/build/release
make make
[sudo] make install [sudo] make install
...@@ -201,7 +201,7 @@ You are now done unless you want to make a Debug build. ...@@ -201,7 +201,7 @@ You are now done unless you want to make a Debug build.
11) Making a "Debug" build. 11) Making a "Debug" build.
cd <kicadSource>/Build/Debug cd <kicadSource>/build/debug
On either cmake command line shown below, you can optionally include On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir> before the final ../../ argument. Although -DCMAKE_INSTALL_PREFIX=<finallInstallDir> before the final ../../ argument. Although
......
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 DESTINATION ${KICAD_INTERNAT} COMPONENT resources
PATTERN ".svn" EXCLUDE PATTERN "*.po" EXCLUDE) PATTERN ".svn" EXCLUDE PATTERN "*.po" EXCLUDE)
ADD_DEFINITIONS(-DKICAD) add_definitions(-DKICAD)
INCLUDE_DIRECTORIES(bitmaps) include_directories(bitmaps)
SET(KICAD_SRCS set(KICAD_SRCS
buildmnu.cpp buildmnu.cpp
commandframe.cpp commandframe.cpp
files-io.cpp files-io.cpp
...@@ -13,28 +13,28 @@ SET(KICAD_SRCS ...@@ -13,28 +13,28 @@ SET(KICAD_SRCS
treeprj_datas.cpp treeprj_datas.cpp
treeprj_frame.cpp) treeprj_frame.cpp)
IF(WIN32) if(WIN32)
IF(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) # 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 COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/kicad.rc -i ${CMAKE_CURRENT_SOURCE_DIR}/kicad.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o) -o ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o)
SET(KICAD_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o) set(KICAD_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/kicad_rc.o)
ELSE(MINGW) else(MINGW)
SET(KICAD_RESOURCES kicad.rc) set(KICAD_RESOURCES kicad.rc)
ENDIF(MINGW) endif(MINGW)
ENDIF(WIN32) endif(WIN32)
IF(APPLE) if(APPLE)
SET(KICAD_RESOURCES kicad.r) set(KICAD_RESOURCES kicad.r)
ENDIF(APPLE) 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) if(KICAD_MINIZIP)
ADD_SUBDIRECTORY(minizip) add_subdirectory(minizip)
ENDIF(KICAD_MINIZIP) endif(KICAD_MINIZIP)
FIND_PACKAGE(ZLIB) find_package(ZLIB)
IF(ZLIB_FOUND) if(ZLIB_FOUND)
MESSAGE(STATUS "Check for installed zlib -- found") message(STATUS "Check for installed zlib -- found")
ELSE(ZLIB_FOUND) else(ZLIB_FOUND)
MESSAGE(STATUS "Check for installed zlib -- not found") message(STATUS "Check for installed zlib -- not found")
IF(NOT MINGW) if(NOT MINGW)
MESSAGE(FATAL_ERROR message(FATAL_ERROR
"zlib was not found - it is required to build KiCad") "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 # zlib is not installed, and in this case wxWidgets creates its own zlib library
# include files are in ${wxWidgets_ROOT_DIR}/src/zlib # include files are in ${wxWidgets_ROOT_DIR}/src/zlib
# and the corresponding library is libwxzlib-<version>.a (like libwxzlib-2.8.a) # and the corresponding library is libwxzlib-<version>.a (like libwxzlib-2.8.a)
# and we try to use it # and we try to use it
INCLUDE_DIRECTORIES(${wxWidgets_ROOT_DIR}/src/zlib) include_directories(${wxWidgets_ROOT_DIR}/src/zlib)
ENDIF(NOT MINGW) endif(NOT MINGW)
ENDIF(ZLIB_FOUND) endif(ZLIB_FOUND)
SET(MINIZIP_SRCS set(MINIZIP_SRCS
ioapi.c ioapi.c
minizip.c minizip.c
zip.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)
ADD_DEFINITIONS(-DPCBNEW) add_definitions(-DPCBNEW)
INCLUDE_DIRECTORIES( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${Boost_INCLUDE_DIR} ${Boost_INCLUDE_DIR}
bitmaps bitmaps
...@@ -8,7 +8,7 @@ INCLUDE_DIRECTORIES( ...@@ -8,7 +8,7 @@ INCLUDE_DIRECTORIES(
../polygon) ../polygon)
# Many of the commented out ones are nested in *.cpp files for dialogs # Many of the commented out ones are nested in *.cpp files for dialogs
SET(PCBNEW_SRCS set(PCBNEW_SRCS
affiche.cpp affiche.cpp
attribut.cpp attribut.cpp
automove.cpp automove.cpp
...@@ -78,7 +78,7 @@ SET(PCBNEW_SRCS ...@@ -78,7 +78,7 @@ SET(PCBNEW_SRCS
gen_modules_placefile.cpp gen_modules_placefile.cpp
gendrill.cpp gendrill.cpp
globaleditpad.cpp globaleditpad.cpp
gpcb_exchange.cpp gpcb_exchange.cpp
graphpcb.cpp graphpcb.cpp
hotkeys.cpp hotkeys.cpp
initpcb.cpp initpcb.cpp
...@@ -141,40 +141,40 @@ SET(PCBNEW_SRCS ...@@ -141,40 +141,40 @@ SET(PCBNEW_SRCS
zones_by_polygon.cpp zones_by_polygon.cpp
zones_test_and_combine_areas.cpp) zones_test_and_combine_areas.cpp)
SET(PCBNEW_EXTRA_SRCS set(PCBNEW_EXTRA_SRCS
../share/drawframe.cpp ../share/drawframe.cpp
../share/drawpanel.cpp ../share/drawpanel.cpp
../share/setpage.cpp ../share/setpage.cpp
../share/wxprint.cpp ../share/wxprint.cpp
../share/zoom.cpp) ../share/zoom.cpp)
IF(WIN32) if(WIN32)
IF(MINGW) if(MINGW)
# resource compilation for mingw (http://www.cmake.org/Bug/view.php?id=4068) # 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 COMMAND windres.exe -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${wxWidgets_ROOT_DIR}/include
-i ${CMAKE_CURRENT_SOURCE_DIR}/pcbnew.rc -i ${CMAKE_CURRENT_SOURCE_DIR}/pcbnew.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o) -o ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o)
SET(PCBNEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o) set(PCBNEW_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/pcbnew_rc.o)
ELSE(MINGW) else(MINGW)
SET(PCBNEW_RESOURCES pcbnew.rc) set(PCBNEW_RESOURCES pcbnew.rc)
ENDIF(MINGW) endif(MINGW)
ENDIF(WIN32) endif(WIN32)
IF(APPLE) if(APPLE)
SET(PCBNEW_RESOURCES pcbnew.r) set(PCBNEW_RESOURCES pcbnew.r)
ENDIF(APPLE) 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. # This one gets made only when testing.
ADD_EXECUTABLE(dsntest EXCLUDE_FROM_ALL dsn.cpp) add_executable(dsntest EXCLUDE_FROM_ALL dsn.cpp)
TARGET_LINK_LIBRARIES(dsntest common ${wxWidgets_LIBRARIES}) target_link_libraries(dsntest common ${wxWidgets_LIBRARIES})
# This one gets made only when testing. # This one gets made only when testing.
ADD_EXECUTABLE(specctra_test EXCLUDE_FROM_ALL specctra.cpp dsn.cpp) add_executable(specctra_test EXCLUDE_FROM_ALL specctra.cpp dsn.cpp)
TARGET_LINK_LIBRARIES(specctra_test common ${wxWidgets_LIBRARIES}) 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)
SET(POLYGON_SRCS set(POLYGON_SRCS
GenericPolygonClipperLibrary.cpp GenericPolygonClipperLibrary.cpp
math_for_graphics.cpp math_for_graphics.cpp
php_polygon.cpp php_polygon.cpp
php_polygon_vertex.cpp php_polygon_vertex.cpp
PolyLine.cpp) PolyLine.cpp)
ADD_LIBRARY(polygon ${POLYGON_SRCS}) add_library(polygon ${POLYGON_SRCS})
INSTALL(FILES kicad.pro install(FILES kicad.pro
DESTINATION ${KICAD_TEMPLATE} COMPONENT resources) DESTINATION ${KICAD_TEMPLATE} COMPONENT resources)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment