diff --git a/CMakeLists.txt b/CMakeLists.txt index f655f37d06..071dae6ea9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,12 @@ option( KICAD_SCRIPTING_WXPYTHON # when not defined by user, the default is python.exe under Windows and python2 for others # python binary file should be is exec path. +# KICAD_SCRIPTING_MODULES requires KICAD_SCRIPTING enable it here if KICAD_SCRIPTING_MODULES is ON +if ( KICAD_SCRIPTING_MODULES AND NOT KICAD_SCRIPTING ) + message(STATUS "Changing KICAD_SCRIPTING to ON as needed by KICAD_SCRIPTING_MODULES") + set ( KICAD_SCRIPTING ON ) +endif() + option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." ON ) @@ -209,27 +215,7 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" ) if( APPLE ) - - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__ASSERTMACROS__" ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ASSERTMACROS__" ) - - # Allows .dylib relocation in the future - needed by fixbundle - set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names") - - if( NOT CMAKE_CXX_COMPILER ) - EXEC_PROGRAM( wx-config ARGS --cc OUTPUT_VARIABLE CMAKE_C_COMPILER ) - endif() - - if( NOT CMAKE_CXX_COMPILER ) - EXEC_PROGRAM( wx-config ARGS --cxx OUTPUT_VARIABLE CMAKE_CXX_COMPILER ) - endif() - - # There seems to be no consistent behavior when -mmacosx-min-version is - # not specified, so force user to set minimum OSX version to build for - if( NOT CMAKE_OSX_DEPLOYMENT_TARGET ) - message( FATAL_ERROR "Please specify target OS X version using -DCMAKE_OSX_DEPLOYMENT_TARGET=10.x" ) - endif() - + set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names") # needed by fixbundle endif() endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) @@ -360,6 +346,11 @@ else() set( \${default_embedded_path_var} \"\${path}\" PARENT_SCOPE ) endfunction(gp_item_default_embedded_path_override) + + # If `BU_CHMOD_BUNDLE_ITEMS` is not set, `install_name_tool` will fail to re-write some + # loader paths due to lack of writable permissions if the build dependencies were installed + # by brew (or didn't have writable permissions) + set ( BU_CHMOD_BUNDLE_ITEMS ON ) " ) endif() @@ -487,7 +478,6 @@ set( INC_BEFORE set( INC_AFTER ${Boost_INCLUDE_DIR} - #include ${CMAKE_BINARY_DIR} ) @@ -590,12 +580,6 @@ if( EXISTS ${CMAKE_SOURCE_DIR}/include/config.h ) add_definitions( -DHAVE_SVN_REVISION ) endif() - -#================================================ -# Let CMake look in these directories for nested -# 'CMakeLists.txt' files to process -#================================================ - if( APPLE ) # Remove app bundles in ${KICAD_BIN} before installing anything new. # Must be defined before all includes so that it is executed first. @@ -614,39 +598,10 @@ if( APPLE ) ) endif() -############################ -# Binaries ( CMake targets ) # -############################ - -add_subdirectory( bitmaps_png ) -add_subdirectory( common ) -add_subdirectory( 3d-viewer ) -add_subdirectory( cvpcb ) -add_subdirectory( eeschema ) -add_subdirectory( gerbview ) -add_subdirectory( lib_dxf ) -add_subdirectory( pcbnew ) -add_subdirectory( polygon ) -add_subdirectory( pagelayout_editor ) -add_subdirectory( potrace ) -add_subdirectory( bitmap2component ) -add_subdirectory( pcb_calculator ) -add_subdirectory( kicad ) # should follow pcbnew, eeschema -add_subdirectory( tools ) -add_subdirectory( utils ) -add_subdirectory( qa ) - -#add_subdirectory( new ) - -############# -# Resources # -############# -add_subdirectory( demos ) -add_subdirectory( template ) - #================================================ # Doxygen Output #================================================ + find_package( Doxygen ) if( DOXYGEN_FOUND ) add_custom_target( doxygen-docs @@ -671,6 +626,18 @@ endif() configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake ${CMAKE_BINARY_DIR}/config.h ) +### +# Generate Map file +### +if( KICAD_MAKE_LINK_MAPS ) + # Currently only works on linux/gcc + if( UNIX AND NOT APPLE ) + set( MAKE_LINK_MAPS true ) + else() + set( MAKE_LINK_MAPS false ) + endif() +endif() + #================================================ # "make uninstall" rules #================================================ @@ -740,7 +707,6 @@ endif() #include( CTest ) - if( UNIX AND NOT APPLE ) # Create a *.deb file: @@ -756,3 +722,31 @@ if( UNIX AND NOT APPLE ) include( CPack ) endif() + +#================================================ +# Let CMake look in these directories for nested +# 'CMakeLists.txt' files to process +#================================================ + +# Binaries ( CMake targets ) +add_subdirectory( bitmaps_png ) +add_subdirectory( common ) +add_subdirectory( 3d-viewer ) +add_subdirectory( cvpcb ) +add_subdirectory( eeschema ) +add_subdirectory( gerbview ) +add_subdirectory( lib_dxf ) +add_subdirectory( pcbnew ) +add_subdirectory( polygon ) +add_subdirectory( pagelayout_editor ) +add_subdirectory( potrace ) +add_subdirectory( bitmap2component ) +add_subdirectory( pcb_calculator ) +add_subdirectory( kicad ) # should follow pcbnew, eeschema +add_subdirectory( tools ) +add_subdirectory( utils ) +add_subdirectory( qa ) + +# Resources +add_subdirectory( demos ) +add_subdirectory( template ) diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index e2a9878c54..451cf46c46 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -1,11 +1,3 @@ -# the map generation creates on Windows/gcc a lot of useless warnings -# so disable it on windows -if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) - set( MAKE_LINK_MAPS false ) -else() - set( MAKE_LINK_MAPS true ) -endif() - add_definitions( -DCVPCB ) include_directories( BEFORE ${INC_BEFORE} ) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index e68a5e800f..9d175b30a1 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -1,14 +1,5 @@ -# the map generation creates on Windows/gcc a lot of useless warnings -# so disable it on windows -if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) - set( MAKE_LINK_MAPS false ) -else() - set( MAKE_LINK_MAPS true ) -endif() - add_definitions( -DEESCHEMA ) - include_directories( BEFORE ${INC_BEFORE} ) include_directories( ./dialogs @@ -308,6 +299,7 @@ if( APPLE ) DESTINATION ${KICAD_BIN} COMPONENT binary ) + install( CODE " # override default embedded path settings ${OSX_BUNDLE_OVERRIDE_PATHS} diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index ff4f25250d..c097c8a973 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -1,11 +1,3 @@ -# the map generation creates on Windows/gcc a lot of useless warnings -# so disable it on windows -if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) - set( MAKE_LINK_MAPS false ) -else() - set( MAKE_LINK_MAPS true ) -endif() - add_definitions(-DGERBVIEW) include_directories( BEFORE ${INC_BEFORE} ) diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index f0e2438c04..0639feb9d5 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -109,9 +109,6 @@ if( APPLE ) # do all the work include( BundleUtilities ) - # If `BU_CHMOD_BUNDLE_ITEMS` is not set, `install_name_tool` will fail to re-write some loader paths due to lack of writable permissions if the build dependencies were installed by brew (or didn't have writable permissions) - set(BU_CHMOD_BUNDLE_ITEMS ON) - fixup_bundle( ${OSX_BUNDLE_INSTALL_BIN_DIR}/kicad \"\${BUNDLE_FIX_LIBS}\" \"\" diff --git a/pagelayout_editor/CMakeLists.txt b/pagelayout_editor/CMakeLists.txt index 06492bf9bd..4c6cd8c649 100644 --- a/pagelayout_editor/CMakeLists.txt +++ b/pagelayout_editor/CMakeLists.txt @@ -1,11 +1,3 @@ -# the map generation creates on Windows/gcc a lot of useless warnings -# so disable it on windows -if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) - set( MAKE_LINK_MAPS false ) -else() - set( MAKE_LINK_MAPS true ) -endif() - add_definitions(-DPL_EDITOR) include_directories(BEFORE ${INC_BEFORE}) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 64d80929f1..bbbc881767 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -1,12 +1,5 @@ -# the map generation creates on Windows/gcc a lot of useless warnings -# so disable it on windows -if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) - set( MAKE_LINK_MAPS false ) -else() - set( MAKE_LINK_MAPS true ) -endif() - add_definitions( -DPCBNEW ) + add_subdirectory(router) # psnrouter depends on make_lexer outputs in common (bug # 1285878 ) @@ -458,7 +451,6 @@ endif() # Doxygen python documentation ### -find_package( Doxygen ) if( DOXYGEN_FOUND ) if( KICAD_SCRIPTING ) @@ -494,8 +486,6 @@ if( DOXYGEN_FOUND ) COMMENT "building doxygen docs into directory doxygen-python/html" ) endif() -else() - message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" ) endif() @@ -699,18 +689,6 @@ if( KICAD_SCRIPTING_MODULES ) COMMENT "Fixing swig_import_helper in Kicad scripting modules" ) - if( NOT APPLE ) - install( FILES ${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py DESTINATION ${PYTHON_DEST} ) - else() - # put everything into bundle at build time, it is relocated at install - add_custom_target( ScriptingModulesPcbnewPyCopy ALL - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py" "${PYTHON_DEST}/" - DEPENDS FixSwigImportsModuleScripting - COMMENT "Copying pcbnew.py into ${PYTHON_DEST}" - ) - add_dependencies( ScriptingModulesPcbnewPyCopy ScriptingWxpythonCopy ) - endif() - if( MINGW ) install( FILES ${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.pyd DESTINATION ${PYTHON_DEST} ) elseif( APPLE ) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index ade13d4726..2e76cea489 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,47 +1,4 @@ -set( MAKE_LINK_MAPS true ) - -if( 0 ) - - project(kicad-tools) - - cmake_minimum_required( VERSION 2.8 FATAL_ERROR ) - - set( PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ ) - - # message( "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" ) - - # Path to local CMake modules. - set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules ) - - include( CheckFindPackageResult ) - - ########################## - # Find wxWidgets library # - ########################## - # 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 - - # On Apple only wxwidgets 2.9 or higher doesn't need to find aui part of base - if(APPLE) - find_package(wxWidgets COMPONENTS gl adv html core net base xml QUIET) - else(APPLE) - find_package(wxWidgets COMPONENTS gl aui adv html core net base xml QUIET) - endif(APPLE) - check_find_package_result(wxWidgets_FOUND "wxWidgets") - - - # Include wxWidgets macros. - include(${wxWidgets_USE_FILE}) - - # make config.h - include( PerformFeatureChecks ) - perform_feature_checks() - - -endif() - include_directories( ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/pcbnew @@ -77,4 +34,3 @@ add_executable( property_tree target_link_libraries( property_tree ${wxWidgets_LIBRARIES} ) -