Commit 61ebbd58 authored by f3nix's avatar f3nix

Small CMake cleanup.

parent f38bb9d8
# Our project is called 'kicad' this is how it will be called in # Our project is called 'kicad'.This is how it will be called in
# visual studio, and in our makefiles. # Visual Studio and 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)
...@@ -7,11 +7,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR) ...@@ -7,11 +7,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
# Uncomment this line if you want verbose build messages. # Uncomment this line if you want verbose build messages.
#SET(CMAKE_VERBOSE_MAKEFILE ON) #SET(CMAKE_VERBOSE_MAKEFILE ON)
# 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")
# 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")
...@@ -24,71 +24,70 @@ SET(wxWidgets_USE_LIBS base core adv gl html net) ...@@ -24,71 +24,70 @@ SET(wxWidgets_USE_LIBS base core adv gl html net)
# We need the Find package for wxWidgets to work. # We need the Find package for wxWidgets to work.
FIND_PACKAGE(wxWidgets REQUIRED) FIND_PACKAGE(wxWidgets REQUIRED)
# Locations for install targets # Locations for install targets.
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) SET(CMAKE_INSTALL_PREFIX /usr/local)
# 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_BIN bin CACHE PATH "Location of KiCad binaries.") SET(KICAD_BIN bin CACHE PATH "Location of KiCad binaries.")
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_DOCS share/doc/kicad CACHE PATH "Location of KiCad documentation files.") 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_DATA share/kicad CACHE PATH "Location of KiCad data files.")
SET(KICAD_MODULES ${KICAD_DATA}/modules) SET(KICAD_MODULES ${KICAD_DATA}/modules)
SET(KICAD_LIBRARY ${KICAD_DATA}/library) SET(KICAD_LIBRARY ${KICAD_DATA}/library)
SET(KICAD_INTERNAT ${KICAD_DATA}/internat) SET(KICAD_INTERNAT ${KICAD_DATA}/internat)
SET(KICAD_TEMPLATE ${KICAD_DATA}/template) SET(KICAD_TEMPLATE ${KICAD_DATA}/template)
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) SET(CMAKE_INSTALL_PREFIX C:/kicad)
# 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_BIN winexe CACHE PATH "Location of KiCad binaries.") SET(KICAD_BIN winexe CACHE PATH "Location of KiCad binaries.")
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_DOCS share/doc/kicad CACHE PATH "Location of KiCad documentation files.") 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_DATA share/kicad CACHE PATH "Location of KiCad data files.")
SET(KICAD_MODULES ${KICAD_DATA}/modules) SET(KICAD_MODULES ${KICAD_DATA}/modules)
SET(KICAD_LIBRARY ${KICAD_DATA}/library) SET(KICAD_LIBRARY ${KICAD_DATA}/library)
SET(KICAD_INTERNAT ${KICAD_DATA}/internat) SET(KICAD_INTERNAT ${KICAD_DATA}/internat)
SET(KICAD_TEMPLATE ${KICAD_DATA}/template) SET(KICAD_TEMPLATE ${KICAD_DATA}/template)
ENDIF(WIN32) ENDIF(WIN32)
# Did we find wxWidgets ? This condition will fail # Did we find wxWidgets ? This condition will fail
# for as long as the internal vars do not point to # for as long as the internal vars do not point to
# the proper wxWidgets configuration. # the proper wxWidgets configuration.
IF(wxWidgets_FOUND) IF(wxWidgets_FOUND)
MESSAGE(STATUS "Check for installed wxWidgets -- found") MESSAGE(STATUS "Check for installed wxWidgets -- found")
# Include wxWidgets macros. # Include wxWidgets macros.
INCLUDE(${wxWidgets_USE_FILE}) INCLUDE(${wxWidgets_USE_FILE})
# We define the include paths here. # We define the include paths here.
# Include dirs for wxWidgets was defined before. # Include dirs for wxWidgets was defined before.
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.
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)
ELSE(wxWidgets_FOUND) ELSE(wxWidgets_FOUND)
# For convenience. When we cannot continue, inform the user. # For convenience. When we cannot continue, inform the user.
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)
# CMake will look at this dirs for nested 'CMakeLists.txt' files # CMake will look at this dirs for nested 'CMakeLists.txt' files.
ADD_SUBDIRECTORY(internat) ADD_SUBDIRECTORY(internat)
ADD_SUBDIRECTORY(help) ADD_SUBDIRECTORY(help)
ADD_SUBDIRECTORY(library) ADD_SUBDIRECTORY(library)
ADD_SUBDIRECTORY(modules) ADD_SUBDIRECTORY(modules)
ADD_SUBDIRECTORY(template) ADD_SUBDIRECTORY(template)
...@@ -46,7 +46,6 @@ SET(EESCHEMA_SRCS ...@@ -46,7 +46,6 @@ SET(EESCHEMA_SRCS
eeload.cpp eeload.cpp
eeredraw.cpp eeredraw.cpp
eeschema.cpp eeschema.cpp
# eestatus.cpp
eestring.cpp eestring.cpp
erc.cpp erc.cpp
files-io.cpp files-io.cpp
...@@ -103,10 +102,6 @@ SET(EESCHEMA_EXTRA_SRCS ...@@ -103,10 +102,6 @@ SET(EESCHEMA_EXTRA_SRCS
../share/svg_print.cpp ../share/svg_print.cpp
../share/wxprint.cpp ../share/wxprint.cpp
../share/zoom.cpp ../share/zoom.cpp
# ../share/buildmnu.cpp
# ../share/mdiframe.cpp
# ../share/treeprj.cpp
) )
IF(WIN32) IF(WIN32)
......
...@@ -4,12 +4,12 @@ FIND_PACKAGE(Boost) ...@@ -4,12 +4,12 @@ FIND_PACKAGE(Boost)
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
bitmaps bitmaps
../3d-viewer ../3d-viewer
../polygon ../polygon)
)
# 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
...@@ -36,7 +36,6 @@ SET(PCBNEW_SRCS ...@@ -36,7 +36,6 @@ SET(PCBNEW_SRCS
class_track.cpp class_track.cpp
class_zone.cpp class_zone.cpp
clean.cpp clean.cpp
# many of the commented out ones are nested in *.cpp files for dialogs
# cleaningoptions_dialog.cpp # cleaningoptions_dialog.cpp
collectors.cpp collectors.cpp
connect.cpp connect.cpp
...@@ -56,10 +55,12 @@ SET(PCBNEW_SRCS ...@@ -56,10 +55,12 @@ SET(PCBNEW_SRCS
# dialog_pad_edit.cpp # dialog_pad_edit.cpp
dialog_setup_libs.cpp dialog_setup_libs.cpp
# dialog_track_options.cpp # dialog_track_options.cpp
# dialog_zones_by_polygon.cpp
dist.cpp dist.cpp
# docedit.cpp # docedit.cpp <-- not used
dragsegm.cpp dragsegm.cpp
drc.cpp drc.cpp
# dsn.cpp
edgemod.cpp edgemod.cpp
edit.cpp edit.cpp
editedge.cpp editedge.cpp
...@@ -67,12 +68,12 @@ SET(PCBNEW_SRCS ...@@ -67,12 +68,12 @@ SET(PCBNEW_SRCS
editpads.cpp editpads.cpp
editrack.cpp editrack.cpp
editrack-part2.cpp editrack-part2.cpp
# editrout.cpp # editrout.cpp <-- not used
edit_track_width.cpp edit_track_width.cpp
edtxtmod.cpp edtxtmod.cpp
export_gencad.cpp export_gencad.cpp
files.cpp files.cpp
filling_zone_algorithm.cpp filling_zone_algorithm.cpp
find.cpp find.cpp
gendrill.cpp gendrill.cpp
gen_modules_placefile.cpp gen_modules_placefile.cpp
...@@ -94,7 +95,7 @@ SET(PCBNEW_SRCS ...@@ -94,7 +95,7 @@ SET(PCBNEW_SRCS
modedit_undo_redo.cpp modedit_undo_redo.cpp
moduleframe.cpp moduleframe.cpp
modules.cpp modules.cpp
# move_copy_track.cpp # move_copy_track.cpp <-- not used
move-drag_pads.cpp move-drag_pads.cpp
move_or_drag_track.cpp move_or_drag_track.cpp
muonde.cpp muonde.cpp
...@@ -119,7 +120,7 @@ SET(PCBNEW_SRCS ...@@ -119,7 +120,7 @@ SET(PCBNEW_SRCS
set_color.cpp set_color.cpp
set_grid.cpp set_grid.cpp
solve.cpp solve.cpp
# specctra.cpp # specctra.cpp
surbrill.cpp surbrill.cpp
swap_layers.cpp swap_layers.cpp
tool_modedit.cpp tool_modedit.cpp
...@@ -135,18 +136,17 @@ SET(PCBNEW_SRCS ...@@ -135,18 +136,17 @@ SET(PCBNEW_SRCS
work.cpp work.cpp
xchgmod.cpp xchgmod.cpp
# zones.cpp # zones.cpp
zones_by_polygon.cpp zones_by_polygon.cpp)
)
SET(PCBNEW_EXTRA_SRCS SET(PCBNEW_EXTRA_SRCS
# ../polygon/PolyLine.cpp
../share/drawframe.cpp ../share/drawframe.cpp
../share/drawpanel.cpp ../share/drawpanel.cpp
../share/infospgm.cpp ../share/infospgm.cpp
../share/setpage.cpp ../share/setpage.cpp
../share/wxprint.cpp ../share/wxprint.cpp
../share/zoom.cpp ../share/zoom.cpp)
# ../polygon/PolyLine.cpp
)
IF(WIN32) IF(WIN32)
SET(PCBNEW_RESOURCES pcbnew.rc) SET(PCBNEW_RESOURCES pcbnew.rc)
...@@ -157,14 +157,14 @@ ENDIF(APPLE) ...@@ -157,14 +157,14 @@ 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.
SET_SOURCE_FILES_PROPERTIES( dsn.cpp PROPERTIES COMPILE_FLAGS -DSTANDALONE ) SET_SOURCE_FILES_PROPERTIES(dsn.cpp PROPERTIES COMPILE_FLAGS -DSTANDALONE)
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})
SET_SOURCE_FILES_PROPERTIES( specctra.cpp PROPERTIES COMPILE_FLAGS -DSTANDALONE ) SET_SOURCE_FILES_PROPERTIES(specctra.cpp PROPERTIES COMPILE_FLAGS -DSTANDALONE)
ADD_EXECUTABLE( specctra_test EXCLUDE_FROM_ALL specctra.cpp ) ADD_EXECUTABLE(specctra_test EXCLUDE_FROM_ALL specctra.cpp)
TARGET_LINK_LIBRARIES( specctra_test common ${wxWidgets_LIBRARIES} ) TARGET_LINK_LIBRARIES(specctra_test common ${wxWidgets_LIBRARIES})
TARGET_LINK_LIBRARIES(pcbnew common 3d-viewer ${wxWidgets_LIBRARIES}) TARGET_LINK_LIBRARIES(pcbnew common 3d-viewer ${wxWidgets_LIBRARIES})
......
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