diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f8d9b4290..43c6573c0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,11 +78,9 @@ include(${wxWidgets_USE_FILE}) # Include MinGW resource compiler. include(MinGWResourceCompiler) -if(UNIX) - # Automagically create version header file. - include(CreateSVNVersionHeader) - create_svn_version_header() -endif(UNIX) +# Automagically create version header file. +include(CreateSVNVersionHeader) +create_svn_version_header() # Include paths. include_directories( diff --git a/bitmaps/CMakeLists.txt b/bitmaps/CMakeLists.txt index 0a576c9c1e..72973bab82 100644 --- a/bitmaps/CMakeLists.txt +++ b/bitmaps/CMakeLists.txt @@ -1,13 +1,10 @@ - # Generate a static library target named "bitmaps" # (with filename libbitmaps.a on Linux) - -# Copy the *.xmp files to bitmaps/${XMP_CPP_DIR}/${basename}.cpp, on change only. +# Copy the *.xmp files to bitmaps/${XMP_CPP_DIR}/${BASENAME}.cpp, on change only. # Compile those *.cpp files and put them into the library, then done. - -set( BITMAP_SRCS +set(BITMAP_SRCS 3d.xpm Add_Arc.xpm Add_Bus2Bus.xpm @@ -386,25 +383,23 @@ set( BITMAP_SRCS viewlibs_icon.xpm ) - -# the name of the directory to put the copied and renamed *.xpm files into +# The name of the directory to put the copied and renamed *.xpm files into # just below the bitmaps directory. As files are copied they are renamed to *.cpp. -set( XMP_CPP_DIR auto_renamed_to_cpp ) +set(XMP_CPP_DIR auto_renamed_to_cpp) -# get the path of the *.xpm files into "path" -set( path ${CMAKE_CURRENT_SOURCE_DIR} ) -# message( path\ =\ ${path} ) +# Get the path of the *.xpm files into "PATH" +set(PATH ${CMAKE_CURRENT_SOURCE_DIR}) +#message("PATH = ${PATH}") -foreach( loop_var ${BITMAP_SRCS} ) - get_filename_component( basename ${loop_var} NAME_WE ) - set( cpp_bitmap ${path}/${XMP_CPP_DIR}/${basename}.cpp ) +foreach(LOOP_VAR ${BITMAP_SRCS}) + get_filename_component(BASENAME ${LOOP_VAR} NAME_WE) + set(CPP_BITMAP "${PATH}/${XMP_CPP_DIR}/${BASENAME}.cpp") add_custom_command( - OUTPUT ${cpp_bitmap} - COMMAND cmake -E copy '${path}/${basename}.xpm' '${cpp_bitmap}' - DEPENDS ${basename}.xpm ) - list( APPEND cpp_bitmaps ${cpp_bitmap} ) - SET_SOURCE_FILES_PROPERTIES( ${cpp_bitmap} PROPERTIES COMPILE_FLAGS -DXPMMAIN ) -endforeach( loop_var ) - -add_library( bitmaps ${cpp_bitmaps} ) + OUTPUT ${CPP_BITMAP} + COMMAND cmake -E copy '${PATH}/${BASENAME}.xpm' '${CPP_BITMAP}' + DEPENDS ${BASENAME}.xpm) + list(APPEND CPP_BITMAPS ${CPP_BITMAP}) + set_source_files_properties(${CPP_BITMAP} PROPERTIES COMPILE_FLAGS -DXPMMAIN) +endforeach(LOOP_VAR) +add_library(bitmaps ${CPP_BITMAPS}) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 800e817529..469d04ab4b 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories(bitmaps) - set(COMMON_SRCS base_screen.cpp base_struct.cpp @@ -18,7 +16,6 @@ set(COMMON_SRCS edaappl.cpp eda_dde.cpp eda_doc.cpp -# edamenu.cpp gestfich.cpp get_component_dialog.cpp gr_basic.cpp diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index 28eee4e679..bbea27d979 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -2,7 +2,6 @@ add_definitions(-DCVPCB) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} - bitmaps ../3d-viewer ../pcbnew ../polygon) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 683cc19f69..83e89c998c 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -1,8 +1,6 @@ add_definitions(-DEESCHEMA) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - bitmaps) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(EESCHEMA_SRCS affiche.cpp @@ -27,6 +25,7 @@ set(EESCHEMA_SRCS database.cpp delete.cpp delsheet.cpp +# dialog_backanno.cpp dialog_build_BOM.cpp # dialog_cmp_graphic_properties.cpp dialog_create_component.cpp diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index c1f49b7009..9a2560fcfc 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -2,7 +2,6 @@ add_definitions(-DGERBVIEW -DPCBNEW) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} - bitmaps ../3d-viewer ../cvpcb ../pcbnew @@ -35,6 +34,7 @@ set(GERBVIEW_SRCS rs274x.cpp select_layers_to_pcb.cpp set_color.cpp +# struct.cpp <-- not used tool_gerber.cpp tracepcb.cpp trpiste.cpp diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index eab9b95703..3301720e5e 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -1,7 +1,5 @@ add_definitions(-DKICAD) -include_directories(bitmaps) - set(KICAD_SRCS buildmnu.cpp commandframe.cpp diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 54d940be74..59b4f1c5c6 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -3,7 +3,6 @@ add_definitions(-DPCBNEW) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIR} - bitmaps ../3d-viewer ../polygon) @@ -163,7 +162,7 @@ endif(APPLE) add_executable(pcbnew WIN32 MACOSX_BUNDLE ${PCBNEW_SRCS} ${PCBNEW_EXTRA_SRCS} ${PCBNEW_RESOURCES}) -target_link_libraries(pcbnew 3d-viewer common polygon kbool bitmaps ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ) +target_link_libraries(pcbnew 3d-viewer common polygon kbool bitmaps ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES}) install(TARGETS pcbnew RUNTIME DESTINATION ${KICAD_BIN} COMPONENT binary) diff --git a/polygon/kbool/CMakeLists.txt b/polygon/kbool/CMakeLists.txt index cd7ff1882f..975d31fc25 100644 --- a/polygon/kbool/CMakeLists.txt +++ b/polygon/kbool/CMakeLists.txt @@ -1,4 +1,3 @@ -PROJECT( kbool ) - -SUBDIRS( src samples ) +project(kbool) +subdirs(src samples) diff --git a/polygon/kbool/samples/boolonly/CMakeLists.txt b/polygon/kbool/samples/boolonly/CMakeLists.txt index 99287fa95e..c9f5f5e1c0 100644 --- a/polygon/kbool/samples/boolonly/CMakeLists.txt +++ b/polygon/kbool/samples/boolonly/CMakeLists.txt @@ -1,11 +1,11 @@ -ADD_EXECUTABLE(boolonly boolonly.cpp) +add_executable(boolonly boolonly.cpp) -IF(WIN32) - ADD_DEFINITIONS( -D_MSWVC_ ) -ELSE(WIN32) - ADD_DEFINITIONS( -D__UNIX__ ) -ENDIF(WIN32) +if(WIN32) + add_definitions(-D_MSWVC_) +else(WIN32) + add_definitions(-D__UNIX__) +endif(WIN32) -INCLUDE_DIRECTORIES( ${kbool_SOURCE_DIR}/.. ) +include_directories(${kbool_SOURCE_DIR}/..) -TARGET_LINK_LIBRARIES( boolonly kbool ) +target_link_libraries(boolonly kbool) diff --git a/polygon/kbool/src/CMakeLists.txt b/polygon/kbool/src/CMakeLists.txt index e910fa7949..29853b81fb 100644 --- a/polygon/kbool/src/CMakeLists.txt +++ b/polygon/kbool/src/CMakeLists.txt @@ -1,8 +1,8 @@ -IF(WIN32) - ADD_DEFINITIONS( -D_MSWVC_ ) -ELSE(WIN32) - ADD_DEFINITIONS( -D__UNIX__ ) -ENDIF(WIN32) +if(WIN32) + add_definitions(-D_MSWVC_) +else(WIN32) + add_definitions(-D__UNIX__) +endif(WIN32) include_directories(${kbool_SOURCE_DIR}/include) @@ -17,5 +17,4 @@ set(KBOOL_SRCS record.cpp scanbeam.cpp) -ADD_LIBRARY( kbool ${KBOOL_SRCS}) - +add_library(kbool ${KBOOL_SRCS})