From 8663a399acaf55958cd216f9aebe74c384595750 Mon Sep 17 00:00:00 2001 From: markus-bonk Date: Wed, 27 Oct 2021 11:28:49 +0200 Subject: [PATCH] Move pcbnew_navlib compilation into pcbcommon. Although pcb_base_frame.cpp is in the pcbnew source tree, it is compiled and included in pcbcommon.lib. Because pcb_base_frame has a dependency on pcbnew_navlib, the latter also needs to be included in pcbcommon to avoid linkage issues. The superfluous references to pcbnew_navlib in the qa projects have been removed. --- CMakeLists.txt | 8 +++++++- common/CMakeLists.txt | 7 +++++++ pcbnew/CMakeLists.txt | 6 ------ qa/pcbnew/CMakeLists.txt | 5 ----- qa/pcbnew_tools/CMakeLists.txt | 5 ----- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8298d5d2d6..ec5d34025e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,7 +157,13 @@ option( KICAD_USE_3DCONNEXION ON ) if( KICAD_USE_3DCONNEXION ) - add_compile_definitions( KICAD_USE_3DCONNEXION ) + if( WIN32 ) + add_definitions( -DKICAD_USE_3DCONNEXION ) + elseif( APPLE ) + add_definitions( -DKICAD_USE_3DCONNEXION ) + else() + remove_definitions( -DKICAD_USE_3DCONNEXION ) + endif() endif() # Global setting: exports are explicit diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 5b84ec9543..3e0cc66d58 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -609,6 +609,13 @@ target_link_libraries( pcbcommon PUBLIC kiplatform ) +if( KICAD_USE_3DCONNEXION ) + message( STATUS "Including 3Dconnexion SpaceMouse navigation support in pcbcommon" ) + add_subdirectory( ../pcbnew/navlib ./navlib) + target_link_libraries( pcbcommon PUBLIC pcbnew_navlib) +endif() + + add_dependencies( pcbcommon delaunator ) # The lemon grammar for the numeric evaluator diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 510367b6d2..0e908c4bc7 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -714,12 +714,6 @@ target_link_libraries( pcbnew_kiface ${PCBNEW_KIFACE_LIBRARIES} ) -if( KICAD_USE_3DCONNEXION ) - message( STATUS "Including 3Dconnexion SpaceMouse navigation support in PcbNew" ) - add_subdirectory( navlib ) - target_link_libraries( pcbnew_kiface pcbnew_navlib) -endif() - set_source_files_properties( pcbnew.cpp PROPERTIES # The KIFACE is in pcbnew.cpp, export it: COMPILE_DEFINITIONS "BUILD_KIWAY_DLL;COMPILING_DLL" diff --git a/qa/pcbnew/CMakeLists.txt b/qa/pcbnew/CMakeLists.txt index e311a229e6..c005885214 100644 --- a/qa/pcbnew/CMakeLists.txt +++ b/qa/pcbnew/CMakeLists.txt @@ -116,9 +116,4 @@ if( WIN32 ) ) endif() -if( KICAD_USE_3DCONNEXION ) - message( STATUS "Including 3Dconnexion SpaceMouse navigation support in PcbNew" ) - target_link_libraries( qa_pcbnew pcbnew_navlib) -endif() - kicad_add_boost_test( qa_pcbnew qa_pcbnew ) diff --git a/qa/pcbnew_tools/CMakeLists.txt b/qa/pcbnew_tools/CMakeLists.txt index 09f1703edd..c30dad905c 100644 --- a/qa/pcbnew_tools/CMakeLists.txt +++ b/qa/pcbnew_tools/CMakeLists.txt @@ -63,9 +63,4 @@ target_link_libraries( qa_pcbnew_tools ${PCBNEW_EXTRA_LIBS} # -lrt must follow Boost ) -if( KICAD_USE_3DCONNEXION ) - message( STATUS "Including 3Dconnexion SpaceMouse navigation support in PcbNew" ) - target_link_libraries( qa_pcbnew_tools pcbnew_navlib) -endif() - kicad_add_utils_executable( qa_pcbnew_tools )