Bump minimum required CMake version to 3.10
This allows us to remove even more workarounds
This commit is contained in:
parent
34d7c3e31f
commit
a475f45753
|
@ -104,15 +104,13 @@ add_library(3d-viewer STATIC ${3D-VIEWER_SRCS})
|
|||
add_dependencies( 3d-viewer pcbcommon )
|
||||
|
||||
target_link_libraries( 3d-viewer
|
||||
gal
|
||||
kimath
|
||||
${Boost_LIBRARIES}
|
||||
${wxWidgets_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
kicad_3dsg )
|
||||
|
||||
target_include_directories( 3d-viewer PRIVATE
|
||||
$<TARGET_PROPERTY:nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
PRIVATE
|
||||
gal
|
||||
kimath
|
||||
nlohmann_json
|
||||
${Boost_LIBRARIES}
|
||||
${wxWidgets_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
kicad_3dsg )
|
||||
|
||||
add_subdirectory( 3d_cache )
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
#
|
||||
|
||||
cmake_minimum_required( VERSION 3.2 FATAL_ERROR )
|
||||
cmake_minimum_required( VERSION 3.10 FATAL_ERROR )
|
||||
|
||||
# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
|
||||
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html
|
||||
|
@ -190,25 +190,6 @@ endif()
|
|||
# change to add_compile_definitions() after minimum required CMake version is 3.12
|
||||
set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG> )
|
||||
|
||||
# CMP0063: CMake < 3.3 does not handle hidden visibility for static libraries,
|
||||
# and 3.3 is backwards compatible when the minimum version is smaller than 3.3.
|
||||
if( POLICY CMP0063 )
|
||||
cmake_policy( GET CMP0063 VISIBILITY_POLICY )
|
||||
if( VISIBILITY_POLICY STREQUAL NEW )
|
||||
message( WARNING "Compatibility code for CMake < 3.3 can be removed, search for CMP0063" )
|
||||
else()
|
||||
cmake_policy( SET CMP0063 NEW )
|
||||
endif()
|
||||
else()
|
||||
if( CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY AND NOT APPLE )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY}hidden" )
|
||||
endif()
|
||||
if( CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN AND NOT APPLE )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Add option to add user directories for linker, if any
|
||||
LINK_DIRECTORIES( ${LINK_DIRECTORIES_PATH} )
|
||||
|
||||
|
@ -237,6 +218,7 @@ perform_feature_checks()
|
|||
# Setup the compiler warnings
|
||||
include( ${CMAKE_MODULE_PATH}/Warnings.cmake )
|
||||
|
||||
|
||||
if( WIN32 )
|
||||
# define UNICODE and_UNICODE definition on Windows. KiCad uses unicode.
|
||||
# Both definitions are required
|
||||
|
|
|
@ -72,6 +72,7 @@ add_library( gal STATIC ${GAL_SRCS} )
|
|||
target_link_libraries( gal
|
||||
common # This is needed until the circular dependency is removed
|
||||
kimath
|
||||
nlohmann_json
|
||||
bitmaps
|
||||
${GLEW_LIBRARIES}
|
||||
${CAIRO_LIBRARIES}
|
||||
|
@ -80,10 +81,6 @@ target_link_libraries( gal
|
|||
${GDI_PLUS_LIBRARIES}
|
||||
)
|
||||
|
||||
target_include_directories( gal PRIVATE
|
||||
$<TARGET_PROPERTY:nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
|
||||
# Only for win32 cross compilation using MXE
|
||||
if( WIN32 AND MSYS )
|
||||
|
@ -464,22 +461,18 @@ set( COMMON_SRCS
|
|||
|
||||
add_library( common STATIC
|
||||
${COMMON_SRCS}
|
||||
$<TARGET_OBJECTS:libcontext>
|
||||
)
|
||||
|
||||
target_include_directories( common PRIVATE
|
||||
$<TARGET_PROPERTY:libcontext,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
add_dependencies( common libcontext )
|
||||
add_dependencies( common version_header )
|
||||
add_dependencies( common compoundfilereader ) # used by altium_parser.cpp
|
||||
|
||||
target_link_libraries( common
|
||||
libcontext
|
||||
kimath
|
||||
kiplatform
|
||||
bitmaps
|
||||
gal
|
||||
compoundfilereader
|
||||
${Boost_LIBRARIES}
|
||||
${CURL_LIBRARIES}
|
||||
${OPENSSL_LIBRARIES} # empty on Apple
|
||||
|
@ -487,14 +480,12 @@ target_link_libraries( common
|
|||
${EXTRA_LIBS}
|
||||
)
|
||||
|
||||
target_include_directories( common PUBLIC
|
||||
$<TARGET_PROPERTY:nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
target_include_directories( common
|
||||
PUBLIC
|
||||
.
|
||||
${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_include_directories( common PUBLIC
|
||||
$<TARGET_PROPERTY:compoundfilereader,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
) # used by altium_parser.cpp
|
||||
|
||||
set( PCB_COMMON_SRCS
|
||||
base_screen.cpp
|
||||
eda_text.cpp
|
||||
|
@ -578,10 +569,6 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
|
|||
|
||||
add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
|
||||
|
||||
target_include_directories( pcbcommon PUBLIC
|
||||
$<TARGET_PROPERTY:delaunator,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
target_link_libraries( pcbcommon PUBLIC
|
||||
common
|
||||
delaunator
|
||||
|
|
|
@ -22,7 +22,6 @@ endif()
|
|||
include_directories( BEFORE ${INC_BEFORE} )
|
||||
include_directories(
|
||||
./dialogs
|
||||
./netlist_exporters
|
||||
./widgets
|
||||
symbol_editor
|
||||
./libview
|
||||
|
@ -380,12 +379,14 @@ add_library( eeschema_kiface_objects OBJECT
|
|||
${EESCHEMA_COMMON_SRCS}
|
||||
)
|
||||
|
||||
# CMake <3.9 can't link anything to object libraries,
|
||||
# but we only need include directories, as we will link the kiface MODULE
|
||||
target_include_directories( eeschema_kiface_objects PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
$<TARGET_PROPERTY:common,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
target_include_directories( eeschema_kiface_objects
|
||||
PUBLIC
|
||||
.
|
||||
netlist_exporters )
|
||||
|
||||
target_link_libraries( eeschema_kiface_objects
|
||||
PUBLIC
|
||||
common )
|
||||
|
||||
# Since we're not using target_link_libraries, we need to explicitly
|
||||
# declare the dependency
|
||||
|
@ -393,24 +394,22 @@ add_dependencies( eeschema_kiface_objects common )
|
|||
|
||||
add_library( eeschema_kiface MODULE
|
||||
eeschema.cpp
|
||||
$<TARGET_OBJECTS:eeschema_kiface_objects>
|
||||
)
|
||||
|
||||
target_include_directories( eeschema_kiface PUBLIC
|
||||
$<TARGET_PROPERTY:eeschema_kiface_objects,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
target_link_libraries( eeschema_kiface
|
||||
common
|
||||
sexpr
|
||||
markdown_lib
|
||||
${wxWidgets_LIBRARIES}
|
||||
${GDI_PLUS_LIBRARIES}
|
||||
PRIVATE
|
||||
eeschema_kiface_objects
|
||||
common
|
||||
sexpr
|
||||
markdown_lib
|
||||
${wxWidgets_LIBRARIES}
|
||||
${GDI_PLUS_LIBRARIES}
|
||||
)
|
||||
|
||||
if( KICAD_SPICE )
|
||||
target_link_libraries( eeschema_kiface
|
||||
${NGSPICE_LIBRARY}
|
||||
PRIVATE
|
||||
${NGSPICE_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -131,16 +131,10 @@ add_library( gerbview_kiface_objects OBJECT
|
|||
${WIDGET_SRCS}
|
||||
${GERBVIEW_EXTRA_SRCS}
|
||||
)
|
||||
|
||||
# Since we're not using target_link_libraries, we need to explicitly
|
||||
# declare the dependency
|
||||
add_dependencies( gerbview_kiface_objects common )
|
||||
add_dependencies( gerbview_kiface_objects gal )
|
||||
|
||||
# CMake <3.9 can't link anything to object libraries,
|
||||
# but we only need include directories, as we will link the kiface MODULE
|
||||
target_include_directories( gerbview_kiface_objects PRIVATE
|
||||
$<TARGET_PROPERTY:common,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
target_link_libraries( gerbview_kiface_objects
|
||||
PUBLIC
|
||||
common
|
||||
gal
|
||||
)
|
||||
|
||||
# the main gerbview program, in DSO form.
|
||||
|
@ -151,6 +145,7 @@ set_target_properties( gerbview_kiface PROPERTIES
|
|||
SUFFIX ${KIFACE_SUFFIX}
|
||||
)
|
||||
target_link_libraries( gerbview_kiface
|
||||
nlohmann_json
|
||||
gal
|
||||
common
|
||||
${wxWidgets_LIBRARIES}
|
||||
|
@ -166,10 +161,6 @@ if( MAKE_LINK_MAPS )
|
|||
LINK_FLAGS "-Wl,-cref,-Map=_gerbview.kiface.map" )
|
||||
endif()
|
||||
|
||||
target_include_directories( gerbview_kiface PRIVATE
|
||||
$<TARGET_PROPERTY:nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
# if building gerbview, then also build gerbview_kiface if out of date.
|
||||
add_dependencies( gerbview gerbview_kiface )
|
||||
|
||||
|
|
|
@ -57,10 +57,6 @@ add_executable( kicad WIN32 MACOSX_BUNDLE
|
|||
${KICAD_RESOURCES}
|
||||
)
|
||||
|
||||
target_include_directories( kicad PRIVATE
|
||||
$<TARGET_PROPERTY:nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
if( UNIX )
|
||||
# for build directory: create kiface symlinks so kicad (exe) can be run in-situ
|
||||
add_custom_target( kiface_sym_links
|
||||
|
@ -76,11 +72,13 @@ if( APPLE )
|
|||
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/kicad/Info.plist
|
||||
)
|
||||
target_link_libraries( kicad
|
||||
nlohmann_json
|
||||
common
|
||||
${wxWidgets_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
target_link_libraries( kicad
|
||||
nlohmann_json
|
||||
common
|
||||
gal
|
||||
common #repeated due to a circular dependancy bewteen gal and common
|
||||
|
|
|
@ -26,15 +26,12 @@ set( KIMATH_SRCS
|
|||
# Include the other smaller math libraries in this one for convenience
|
||||
add_library( kimath STATIC
|
||||
${KIMATH_SRCS}
|
||||
$<TARGET_OBJECTS:clipper>
|
||||
$<TARGET_OBJECTS:othermath>
|
||||
)
|
||||
|
||||
add_dependencies( kimath clipper )
|
||||
add_dependencies( kimath rtree )
|
||||
add_dependencies( kimath othermath )
|
||||
|
||||
target_link_libraries( kimath
|
||||
clipper
|
||||
othermath
|
||||
rtree
|
||||
${wxWidgets_LIBRARIES} # wxLogDebug, wxASSERT
|
||||
${Boost_LIBRARIES} # Because of the OPT types
|
||||
)
|
||||
|
@ -42,9 +39,6 @@ target_link_libraries( kimath
|
|||
target_include_directories( kimath PUBLIC
|
||||
${PROJECT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
$<TARGET_PROPERTY:clipper,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
$<TARGET_PROPERTY:othermath,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
$<TARGET_PROPERTY:rtree,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
# core/optional.h is needed for OPT types
|
||||
|
|
|
@ -624,13 +624,10 @@ target_link_libraries( pcbnew
|
|||
# There's way too much crap coming in from common yet.
|
||||
common
|
||||
gal
|
||||
nlohmann_json
|
||||
${wxWidgets_LIBRARIES}
|
||||
)
|
||||
|
||||
target_include_directories( pcbnew INTERFACE
|
||||
$<TARGET_PROPERTY:nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
if( PCBNEW_LINK_MAPS )
|
||||
set_target_properties( pcbnew PROPERTIES
|
||||
LINK_FLAGS "-Wl,-cref,-Map=pcbnew.map" )
|
||||
|
@ -655,22 +652,16 @@ make_lexer(
|
|||
|
||||
# CMake <3.9 can't link anything to object libraries,
|
||||
# but we only need include directories, as we will link the kiface MODULE
|
||||
target_include_directories( pcbnew_kiface_objects PRIVATE
|
||||
$<TARGET_PROPERTY:common,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
$<TARGET_PROPERTY:dxflib_qcad,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
$<TARGET_PROPERTY:nanosvg,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
$<TARGET_PROPERTY:tinyspline_lib,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
$<TARGET_PROPERTY:nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
target_link_libraries( pcbnew_kiface_objects
|
||||
PRIVATE
|
||||
common
|
||||
dxflib_qcad
|
||||
nanosvg
|
||||
tinyspline_lib
|
||||
nlohmann_json
|
||||
)
|
||||
|
||||
# Since we're not using target_link_libraries, we need to explicitly
|
||||
# declare the dependency
|
||||
add_dependencies( pcbnew_kiface_objects common )
|
||||
add_dependencies( pcbnew_kiface_objects dxflib_qcad )
|
||||
add_dependencies( pcbnew_kiface_objects tinyspline_lib )
|
||||
add_dependencies( pcbnew_kiface_objects nanosvg )
|
||||
|
||||
add_library( pcbnew_kiface MODULE $<TARGET_OBJECTS:pcbnew_kiface_objects> )
|
||||
add_library( pcbnew_kiface MODULE )
|
||||
|
||||
set_target_properties( pcbnew_kiface PROPERTIES
|
||||
# Decorate OUTPUT_NAME with PREFIX and SUFFIX, creating something like
|
||||
|
@ -693,6 +684,7 @@ if ( KICAD_BUILD_TESTS )
|
|||
endif ()
|
||||
|
||||
set( PCBNEW_KIFACE_LIBRARIES
|
||||
pcbnew_kiface_objects
|
||||
3d-viewer
|
||||
connectivity
|
||||
pcbcommon
|
||||
|
@ -714,7 +706,10 @@ set( PCBNEW_KIFACE_LIBRARIES
|
|||
)
|
||||
|
||||
|
||||
target_link_libraries( pcbnew_kiface ${PCBNEW_KIFACE_LIBRARIES} )
|
||||
target_link_libraries( pcbnew_kiface
|
||||
PRIVATE
|
||||
${PCBNEW_KIFACE_LIBRARIES}
|
||||
)
|
||||
|
||||
set_source_files_properties( pcbnew.cpp PROPERTIES
|
||||
# The KIFACE is in pcbnew.cpp, export it:
|
||||
|
|
|
@ -11,11 +11,10 @@ set( ALTIUM2PCBNEW_SRCS
|
|||
|
||||
add_library( altium2pcbnew STATIC ${ALTIUM2PCBNEW_SRCS} )
|
||||
|
||||
add_dependencies( altium2pcbnew compoundfilereader )
|
||||
target_link_libraries( altium2pcbnew
|
||||
pcbcommon
|
||||
compoundfilereader )
|
||||
|
||||
target_link_libraries( altium2pcbnew pcbcommon )
|
||||
|
||||
target_include_directories( altium2pcbnew PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
$<TARGET_PROPERTY:compoundfilereader,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
target_include_directories( altium2pcbnew
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
|
|
|
@ -52,6 +52,7 @@ set( common_srcs
|
|||
|
||||
set( common_libs
|
||||
common
|
||||
libcontext
|
||||
gal
|
||||
qa_utils
|
||||
unit_test_utils
|
||||
|
@ -62,10 +63,6 @@ set( common_libs
|
|||
# Test executable for non-program-specific code
|
||||
add_executable( qa_common ${common_srcs} )
|
||||
target_link_libraries( qa_common ${common_libs} )
|
||||
target_include_directories( qa_common PRIVATE
|
||||
$<TARGET_PROPERTY:libcontext,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}
|
||||
|
|
|
@ -50,6 +50,7 @@ include_directories(
|
|||
|
||||
target_link_libraries( qa_common_tools
|
||||
common
|
||||
libcontext
|
||||
gal
|
||||
qa_utils
|
||||
sexpr
|
||||
|
@ -61,8 +62,4 @@ target_compile_definitions( qa_common_tools
|
|||
PRIVATE PCBNEW
|
||||
)
|
||||
|
||||
target_include_directories( qa_common_tools PRIVATE
|
||||
$<TARGET_PROPERTY:libcontext,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
kicad_add_utils_executable( qa_common_tools )
|
||||
|
|
|
@ -74,18 +74,10 @@ endif()
|
|||
|
||||
add_executable( qa_eeschema
|
||||
${QA_EESCHEMA_SRCS}
|
||||
|
||||
# Older CMakes cannot link OBJECT libraries
|
||||
# https://cmake.org/pipermail/cmake/2013-November/056263.html
|
||||
$<TARGET_OBJECTS:eeschema_kiface_objects>
|
||||
)
|
||||
|
||||
# Anytime we link to the kiface_objects, we have to add a dependency on the last object
|
||||
# to ensure that the generated lexer files are finished being used before the qa runs in a
|
||||
# multi-threaded build
|
||||
add_dependencies( qa_eeschema eeschema )
|
||||
|
||||
target_link_libraries( qa_eeschema
|
||||
eeschema_kiface_objects
|
||||
common
|
||||
pcbcommon
|
||||
kimath
|
||||
|
@ -96,12 +88,6 @@ target_link_libraries( qa_eeschema
|
|||
${Boost_LIBRARIES}
|
||||
)
|
||||
|
||||
target_include_directories( qa_eeschema PUBLIC
|
||||
# Paths for eeschema lib usage (should really be in eeschema/common
|
||||
# target_include_directories and made PUBLIC)
|
||||
$<TARGET_PROPERTY:eeschema_kiface_objects,INCLUDE_DIRECTORIES>
|
||||
)
|
||||
|
||||
# Eeschema tests, so pretend to be eeschema (for units, etc)
|
||||
target_compile_definitions( qa_eeschema
|
||||
PUBLIC EESCHEMA
|
||||
|
|
|
@ -46,10 +46,6 @@ set( QA_PCBNEW_SRCS
|
|||
|
||||
add_executable( qa_pcbnew
|
||||
${QA_PCBNEW_SRCS}
|
||||
|
||||
# Older CMakes cannot link OBJECT libraries
|
||||
# https://cmake.org/pipermail/cmake/2013-November/056263.html
|
||||
$<TARGET_OBJECTS:pcbnew_kiface_objects>
|
||||
)
|
||||
|
||||
# Pcbnew tests, so pretend to be pcbnew (for units, etc)
|
||||
|
@ -64,6 +60,7 @@ add_dependencies( qa_pcbnew pcbnew )
|
|||
|
||||
target_link_libraries( qa_pcbnew
|
||||
qa_pcbnew_utils
|
||||
pcbnew_kiface_objects
|
||||
3d-viewer
|
||||
connectivity
|
||||
pcbcommon
|
||||
|
|
Loading…
Reference in New Issue