CMake: Handle build time checks to choose between modern and/or legacy space mouse devices
This commit is contained in:
@@ -144,16 +144,10 @@ macro(InitializeFreeCADBuildOptions)
|
||||
|
||||
if(MSVC)
|
||||
set(FREECAD_3DCONNEXION_SUPPORT "NavLib" CACHE STRING "Select version of the 3Dconnexion device integration")
|
||||
set_property(CACHE FREECAD_3DCONNEXION_SUPPORT PROPERTY STRINGS "NavLib" "Raw input")
|
||||
else(MSVC)
|
||||
set(FREECAD_3DCONNEXION_SUPPORT "Raw input")
|
||||
endif(MSVC)
|
||||
|
||||
if(MSVC)
|
||||
option(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
|
||||
option(FREECAD_USE_PCL "Build the features that use PCL libs" OFF) # 3/5/2021 current LibPack uses non-C++17 FLANN
|
||||
set_property(CACHE FREECAD_3DCONNEXION_SUPPORT PROPERTY STRINGS "NavLib" "Raw input" "Both")
|
||||
option(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
|
||||
elseif(APPLE)
|
||||
set(FREECAD_USE_3DCONNEXION_RAWINPUT ON)
|
||||
find_library(3DCONNEXIONCLIENT_FRAMEWORK 3DconnexionClient)
|
||||
if(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK})
|
||||
option(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
|
||||
@@ -161,18 +155,27 @@ macro(InitializeFreeCADBuildOptions)
|
||||
option(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." OFF)
|
||||
endif(IS_DIRECTORY ${3DCONNEXIONCLIENT_FRAMEWORK})
|
||||
else(MSVC)
|
||||
set(FREECAD_USE_3DCONNEXION_RAWINPUT ON)
|
||||
set(FREECAD_USE_3DCONNEXION OFF )
|
||||
endif(MSVC)
|
||||
|
||||
if(FREECAD_3DCONNEXION_SUPPORT STREQUAL "NavLib" AND FREECAD_USE_3DCONNEXION)
|
||||
set(FREECAD_USE_3DCONNEXION_NAVLIB ON)
|
||||
set(FREECAD_USE_3DCONNEXION OFF)
|
||||
elseif(FREECAD_3DCONNEXION_SUPPORT STREQUAL "Both" AND FREECAD_USE_3DCONNEXION)
|
||||
set(FREECAD_USE_3DCONNEXION_NAVLIB ON)
|
||||
set(FREECAD_USE_3DCONNEXION_RAWINPUT ON)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
option(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
|
||||
option(FREECAD_USE_PCL "Build the features that use PCL libs" OFF) # 3/5/2021 current LibPack uses non-C++17 FLANN
|
||||
endif(MSVC)
|
||||
if(NOT MSVC)
|
||||
option(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF)
|
||||
option(FREECAD_USE_PCL "Build the features that use PCL libs" OFF)
|
||||
endif(NOT MSVC)
|
||||
|
||||
if(FREECAD_3DCONNEXION_SUPPORT STREQUAL "NavLib" AND FREECAD_USE_3DCONNEXION)
|
||||
set(FREECAD_USE_3DCONNEXION_NAVLIB ON)
|
||||
set(FREECAD_USE_3DCONNEXION OFF)
|
||||
endif()
|
||||
|
||||
# if this is set override some options
|
||||
if (FREECAD_BUILD_DEBIAN)
|
||||
set(FREECAD_USE_EXTERNAL_ZIPIOS ON )
|
||||
|
||||
@@ -193,13 +193,19 @@ macro(PrintFinalReport)
|
||||
simple(Coin3D "${COIN3D_VERSION} [${COIN3D_LIBRARIES}] [${COIN3D_INCLUDE_DIRS}]")
|
||||
simple(pivy ${PIVY_VERSION})
|
||||
if (WIN32)
|
||||
if (FREECAD_USE_3DCONNEXION)
|
||||
simple(3Dconnexion "Building 3Dconnexion support with original code")
|
||||
if (FREECAD_USE_3DCONNEXION_RAWINPUT AND FREECAD_USE_3DCONNEXION_NAVLIB)
|
||||
simple(3Dconnexion "Building 3Dconnexion support with raw input and NavLib")
|
||||
elseif (FREECAD_USE_3DCONNEXION)
|
||||
simple(3Dconnexion "Building 3Dconnexion support with raw input")
|
||||
elseif(FREECAD_USE_3DCONNEXION_NAVLIB)
|
||||
simple(3Dconnexion "Building 3Dconnexion support with NavLib")
|
||||
else()
|
||||
simple(3Dconnexion "Not building 3Dconnexion device support")
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if (FREECAD_USE_3DCONNEXION)
|
||||
simple(3Dconnexion "Building 3Dconnexion support with raw input")
|
||||
endif()
|
||||
else()
|
||||
conditional(SPNAV SPNAV_FOUND "not found" "[${SPNAV_LIBRARY}] [${SPNAV_INCLUDE_DIR}]")
|
||||
endif()
|
||||
|
||||
@@ -151,22 +151,28 @@ IF(SPNAV_FOUND)
|
||||
SET(FreeCADGui_SDK_SRCS
|
||||
3Dconnexion/GuiAbstractNativeEvent.cpp
|
||||
3Dconnexion/GuiNativeEventLinuxX11.cpp
|
||||
)
|
||||
)
|
||||
SET(FreeCADGui_SDK_MOC_HDRS
|
||||
3Dconnexion/GuiAbstractNativeEvent.h
|
||||
3Dconnexion/GuiNativeEventLinuxX11.h
|
||||
)
|
||||
)
|
||||
else(SPNAV_USE_X11)
|
||||
SET(FreeCADGui_SDK_SRCS
|
||||
3Dconnexion/GuiAbstractNativeEvent.cpp
|
||||
3Dconnexion/GuiNativeEventLinux.cpp
|
||||
)
|
||||
)
|
||||
SET(FreeCADGui_SDK_MOC_HDRS
|
||||
3Dconnexion/GuiAbstractNativeEvent.h
|
||||
3Dconnexion/GuiNativeEventLinux.h
|
||||
)
|
||||
)
|
||||
endif(SPNAV_USE_X11)
|
||||
SOURCE_GROUP("3D connexion SDK" FILES ${FreeCADGui_SDK_SRCS})
|
||||
list(APPEND FreeCADGui_connexion_SRCS
|
||||
${FreeCADGui_SDK_SRCS}
|
||||
)
|
||||
list(APPEND FreeCADGui_connexion_HDRS
|
||||
${FreeCADGui_SDK_MOC_HDRS}
|
||||
)
|
||||
|
||||
add_definitions(-DSPNAV_FOUND)
|
||||
include_directories(
|
||||
@@ -270,30 +276,42 @@ SOURCE_GROUP("XML" FILES ${FreeCADApp_XML_SRCS})
|
||||
|
||||
# The 3D Connexion SDK files
|
||||
if(FREECAD_USE_3DCONNEXION AND MSVC)
|
||||
SET(FreeCADGui_SDK_SRCS
|
||||
3Dconnexion/I3dMouseParams.h
|
||||
3Dconnexion/MouseParameters.cpp
|
||||
3Dconnexion/MouseParameters.h
|
||||
3Dconnexion/GuiAbstractNativeEvent.cpp
|
||||
3Dconnexion/GuiNativeEventWin32.cpp
|
||||
)
|
||||
SOURCE_GROUP("3D connexion SDK" FILES ${FreeCADGui_SDK_SRCS})
|
||||
SET(FreeCADGui_SDK_MOC_HDRS
|
||||
3Dconnexion/GuiAbstractNativeEvent.h
|
||||
3Dconnexion/GuiNativeEventWin32.h
|
||||
)
|
||||
SET(FreeCADGui_SDK_SRCS
|
||||
3Dconnexion/I3dMouseParams.h
|
||||
3Dconnexion/MouseParameters.cpp
|
||||
3Dconnexion/MouseParameters.h
|
||||
3Dconnexion/GuiAbstractNativeEvent.cpp
|
||||
3Dconnexion/GuiNativeEventWin32.cpp
|
||||
)
|
||||
SOURCE_GROUP("3D connexion SDK" FILES ${FreeCADGui_SDK_SRCS})
|
||||
SET(FreeCADGui_SDK_MOC_HDRS
|
||||
3Dconnexion/GuiAbstractNativeEvent.h
|
||||
3Dconnexion/GuiNativeEventWin32.h
|
||||
)
|
||||
list(APPEND FreeCADGui_connexion_SRCS
|
||||
${FreeCADGui_SDK_SRCS}
|
||||
)
|
||||
list(APPEND FreeCADGui_connexion_HDRS
|
||||
${FreeCADGui_SDK_MOC_HDRS}
|
||||
)
|
||||
endif(FREECAD_USE_3DCONNEXION AND MSVC)
|
||||
|
||||
if(FREECAD_USE_3DCONNEXION AND APPLE)
|
||||
SET(FreeCADGui_SDK_SRCS
|
||||
3Dconnexion/GuiAbstractNativeEvent.cpp
|
||||
3Dconnexion/GuiNativeEventMac.cpp
|
||||
)
|
||||
SOURCE_GROUP("3D connexion SDK" FILES ${FreeCADGui_SDK_SRCS})
|
||||
SET(FreeCADGui_SDK_MOC_HDRS
|
||||
3Dconnexion/GuiAbstractNativeEvent.h
|
||||
3Dconnexion/GuiNativeEventMac.h
|
||||
)
|
||||
SET(FreeCADGui_SDK_SRCS
|
||||
3Dconnexion/GuiAbstractNativeEvent.cpp
|
||||
3Dconnexion/GuiNativeEventMac.cpp
|
||||
)
|
||||
SOURCE_GROUP("3D connexion SDK" FILES ${FreeCADGui_SDK_SRCS})
|
||||
SET(FreeCADGui_SDK_MOC_HDRS
|
||||
3Dconnexion/GuiAbstractNativeEvent.h
|
||||
3Dconnexion/GuiNativeEventMac.h
|
||||
)
|
||||
list(APPEND FreeCADGui_connexion_SRCS
|
||||
${FreeCADGui_SDK_SRCS}
|
||||
)
|
||||
list(APPEND FreeCADGui_connexion_HDRS
|
||||
${FreeCADGui_SDK_MOC_HDRS}
|
||||
)
|
||||
endif(FREECAD_USE_3DCONNEXION AND APPLE)
|
||||
|
||||
if(FREECAD_USE_3DCONNEXION_NAVLIB AND (MSVC OR APPLE))
|
||||
@@ -306,9 +324,15 @@ if(FREECAD_USE_3DCONNEXION_NAVLIB AND (MSVC OR APPLE))
|
||||
${NAVLIB_STUB_DIR}/navlib_stub.c
|
||||
)
|
||||
SOURCE_GROUP("3Dconnexion Navlib" FILES ${FreeCADGui_SDK_SRCS})
|
||||
SET(FreeCADGui_SDK_MOC_HDRS
|
||||
SET(FreeCADGui_SDK_MOC_HDRS
|
||||
3Dconnexion/navlib/NavlibInterface.h
|
||||
)
|
||||
)
|
||||
list(APPEND FreeCADGui_connexion_SRCS
|
||||
${FreeCADGui_SDK_SRCS}
|
||||
)
|
||||
list(APPEND FreeCADGui_connexion_HDRS
|
||||
${FreeCADGui_SDK_MOC_HDRS}
|
||||
)
|
||||
endif(FREECAD_USE_3DCONNEXION_NAVLIB AND (MSVC OR APPLE))
|
||||
|
||||
set_property(SOURCE GraphvizView.h GraphvizView.cpp PROPERTY SKIP_AUTOMOC ON)
|
||||
@@ -390,9 +414,9 @@ SET(Gui_UIC_SRCS
|
||||
VectorListEditor.ui
|
||||
)
|
||||
|
||||
if(FREECAD_3DCONNEXION_SUPPORT STREQUAL "Raw input")
|
||||
list(APPEND Gui_UIC_SRCS DlgCustomizeSpNavSettings.ui)
|
||||
endif(FREECAD_3DCONNEXION_SUPPORT STREQUAL "Raw input")
|
||||
if(FREECAD_USE_3DCONNEXION_RAWINPUT)
|
||||
list(APPEND Gui_UIC_SRCS DlgCustomizeSpNavSettings.ui)
|
||||
endif(FREECAD_USE_3DCONNEXION_RAWINPUT)
|
||||
|
||||
set (FreeCAD_TR_QRC ${CMAKE_CURRENT_BINARY_DIR}/Language/FreeCAD_translation.qrc)
|
||||
qt_find_and_add_translation(QM_SRCS "Language/FreeCAD_*.ts"
|
||||
@@ -581,10 +605,10 @@ SET(Dialog_Customize_HPP_SRCS
|
||||
ListWidgetDragBugFix.h
|
||||
)
|
||||
|
||||
if(FREECAD_3DCONNEXION_SUPPORT STREQUAL "Raw input")
|
||||
list(APPEND Dialog_Customize_CPP_SRCS DlgCustomizeSpaceball.cpp DlgCustomizeSpNavSettings.cpp)
|
||||
list(APPEND Dialog_Customize_HPP_SRCS DlgCustomizeSpaceball.h DlgCustomizeSpNavSettings.h)
|
||||
endif(FREECAD_3DCONNEXION_SUPPORT STREQUAL "Raw input")
|
||||
if(FREECAD_USE_3DCONNEXION_RAWINPUT)
|
||||
list(APPEND Dialog_Customize_CPP_SRCS DlgCustomizeSpaceball.cpp DlgCustomizeSpNavSettings.cpp)
|
||||
list(APPEND Dialog_Customize_HPP_SRCS DlgCustomizeSpaceball.h DlgCustomizeSpNavSettings.h)
|
||||
endif(FREECAD_USE_3DCONNEXION_RAWINPUT)
|
||||
|
||||
SET(Dialog_Customize_SRCS
|
||||
${Dialog_Customize_CPP_SRCS}
|
||||
@@ -595,9 +619,9 @@ SET(Dialog_Customize_SRCS
|
||||
DlgToolbars.ui
|
||||
)
|
||||
|
||||
if(FREECAD_3DCONNEXION_SUPPORT STREQUAL "Raw input")
|
||||
list(APPEND Dialog_Customize_SRCS DlgCustomizeSpNavSettings.ui)
|
||||
endif(FREECAD_3DCONNEXION_SUPPORT STREQUAL "Raw input")
|
||||
if(FREECAD_USE_3DCONNEXION_RAWINPUT)
|
||||
list(APPEND Dialog_Customize_SRCS DlgCustomizeSpNavSettings.ui)
|
||||
endif(FREECAD_USE_3DCONNEXION_RAWINPUT)
|
||||
|
||||
SOURCE_GROUP("Dialog\\Customize" FILES ${Dialog_Customize_SRCS})
|
||||
|
||||
@@ -1295,11 +1319,11 @@ SET(FreeCADGui_SRCS
|
||||
StartupProcess.h
|
||||
TransactionObject.h
|
||||
ToolHandler.h
|
||||
${FreeCADGui_SDK_MOC_HDRS}
|
||||
)
|
||||
|
||||
SET(FreeCADGui_SRCS
|
||||
${FreeCADGui_SDK_SRCS}
|
||||
${FreeCADGui_connexion_SRCS}
|
||||
${FreeCADGui_connexion_HDRS}
|
||||
${FreeCADGui_CPP_SRCS}
|
||||
${FreeCADGui_XML_SRCS}
|
||||
${qsint_MOC_SRCS}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include "DlgActionsImp.h"
|
||||
#include "DlgKeyboardImp.h"
|
||||
|
||||
#ifndef USE_3DCONNEXION_NAVLIB
|
||||
#if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND)
|
||||
#include "DlgCustomizeSpaceball.h"
|
||||
#include "DlgCustomizeSpNavSettings.h"
|
||||
#endif
|
||||
@@ -98,7 +98,7 @@ WidgetFactorySupplier::WidgetFactorySupplier()
|
||||
new CustomPageProducer<DlgCustomKeyboardImp>;
|
||||
new CustomPageProducer<DlgCustomToolbarsImp>;
|
||||
new CustomPageProducer<DlgCustomActionsImp>;
|
||||
#ifndef USE_3DCONNEXION_NAVLIB
|
||||
#if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND)
|
||||
new CustomPageProducer<DlgCustomizeSpNavSettings>;
|
||||
new CustomPageProducer<DlgCustomizeSpaceball>;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user