|
@@ -18,26 +18,32 @@ SET(CMAKE_AUTORCC ON)
|
|
|
|
|
|
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
-# Set dependency directory
|
|
|
|
-#LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/thirdparty/openscenegraph/install")
|
|
|
|
-#LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/thirdparty/lib3mf/install")
|
|
|
|
-#LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/thirdparty/json/install")
|
|
|
|
-LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/thirdparty/qt/install")
|
|
|
|
-
|
|
|
|
-# OpenSceneGraph
|
|
|
|
-INCLUDE(thirdparty/openscenegraph.cmake)
|
|
|
|
-#FIND_PACKAGE(OpenSceneGraph REQUIRED COMPONENTS osgViewer osgDB osgGA osgText osgUtil)
|
|
|
|
-
|
|
|
|
# Qt
|
|
# Qt
|
|
|
|
+LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/thirdparty/qt/install")
|
|
FIND_PACKAGE(Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets REQUIRED NO_CMAKE_SYSTEM_PATH)
|
|
FIND_PACKAGE(Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets REQUIRED NO_CMAKE_SYSTEM_PATH)
|
|
|
|
|
|
-# lib3mf
|
|
|
|
-INCLUDE(thirdparty/lib3mf.cmake)
|
|
|
|
-#FIND_PACKAGE(Lib3MF REQUIRED)
|
|
|
|
-
|
|
|
|
# Json
|
|
# Json
|
|
INCLUDE(thirdparty/json.cmake)
|
|
INCLUDE(thirdparty/json.cmake)
|
|
-#FIND_PACKAGE(nlohmann_json REQUIRED NO_CMAKE_SYSTEM_PATH)
|
|
|
|
|
|
+
|
|
|
|
+# Development build: dynamic link
|
|
|
|
+if(NOT BUILD_STATIC_RELEASE)
|
|
|
|
+ # OpenSceneGraph
|
|
|
|
+ INCLUDE(thirdparty/openscenegraph.cmake)
|
|
|
|
+
|
|
|
|
+ # lib3mf
|
|
|
|
+ INCLUDE(thirdparty/lib3mf.cmake)
|
|
|
|
+ENDIF()
|
|
|
|
+
|
|
|
|
+# Release build: static link
|
|
|
|
+if(BUILD_STATIC_RELEASE)
|
|
|
|
+ # OpenSceneGraph
|
|
|
|
+ LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/thirdparty/openscenegraph/install")
|
|
|
|
+ FIND_PACKAGE(OpenSceneGraph REQUIRED COMPONENTS osgViewer osgDB osgGA osgText osgUtil)
|
|
|
|
+
|
|
|
|
+ # lib3mf
|
|
|
|
+ LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/thirdparty/lib3mf/install")
|
|
|
|
+ FIND_PACKAGE(Lib3MF REQUIRED)
|
|
|
|
+ENDIF()
|
|
|
|
|
|
# The executable we want to build
|
|
# The executable we want to build
|
|
QT_ADD_EXECUTABLE(TrackpointApp
|
|
QT_ADD_EXECUTABLE(TrackpointApp
|
|
@@ -54,17 +60,44 @@ QT_ADD_EXECUTABLE(TrackpointApp
|
|
src/OpenScadRenderer.cpp
|
|
src/OpenScadRenderer.cpp
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+set (TRACKPOINTAPP_INCLUDE_DIRS "")
|
|
|
|
+set (TRACKPOINTAPP_LINK_LIBRARIES "")
|
|
|
|
+
|
|
|
|
+if(NOT BUILD_STATIC_RELEASE)
|
|
|
|
+ LIST(APPEND TRACKPOINTAPP_INCLUDE_DIRS
|
|
|
|
+ ${${OPENSCENEGRAPH_PREFIX}_SOURCE_DIR}/include
|
|
|
|
+ ${${LIB3MF_PREFIX}_BINARY_DIR}/Autogenerated/Bindings/Cpp
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ LIST(APPEND TRACKPOINTAPP_LINK_LIBRARIES
|
|
|
|
+ osg osgViewer osgDB osgGA osgText osgUtil
|
|
|
|
+ lib3mf
|
|
|
|
+ )
|
|
|
|
+ENDIF()
|
|
|
|
+
|
|
|
|
+if(BUILD_STATIC_RELEASE)
|
|
|
|
+ LIST(APPEND TRACKPOINTAPP_INCLUDE_DIRS
|
|
|
|
+ ${OPENSCENEGRAPH_INCLUDE_DIRS}
|
|
|
|
+ ${LIB3MF_INCLUDE_DIRS}
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ LIST(APPEND TRACKPOINTAPP_LINK_LIBRARIES
|
|
|
|
+ ${OPENSCENEGRAPH_LIBRARIES}
|
|
|
|
+ ${LIB3MF_LIBRARIES}
|
|
|
|
+ )
|
|
|
|
+ENDIF()
|
|
|
|
+
|
|
|
|
+message(${TRACKPOINTAPP_INCLUDE_DIRS} status)
|
|
|
|
+
|
|
INCLUDE_DIRECTORIES(
|
|
INCLUDE_DIRECTORIES(
|
|
- ${${OPENSCENEGRAPH_PREFIX}_SOURCE_DIR}/include
|
|
|
|
- ${${LIB3MF_PREFIX}_BINARY_DIR}/Autogenerated/Bindings/Cpp
|
|
|
|
|
|
+ ${TRACKPOINTAPP_INCLUDE_DIRS}
|
|
${${JSON_PREFIX}_SOURCE_DIR}/include
|
|
${${JSON_PREFIX}_SOURCE_DIR}/include
|
|
include
|
|
include
|
|
gui
|
|
gui
|
|
)
|
|
)
|
|
|
|
|
|
TARGET_LINK_LIBRARIES(TrackpointApp PRIVATE
|
|
TARGET_LINK_LIBRARIES(TrackpointApp PRIVATE
|
|
- osg osgViewer osgDB osgGA osgText osgUtil
|
|
|
|
- lib3mf
|
|
|
|
|
|
+ ${TRACKPOINTAPP_LINK_LIBRARIES}
|
|
nlohmann_json::nlohmann_json
|
|
nlohmann_json::nlohmann_json
|
|
Qt6::Core
|
|
Qt6::Core
|
|
Qt6::Gui
|
|
Qt6::Gui
|