CMakeLists.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. CMAKE_MINIMUM_REQUIRED(VERSION 3.19)
  2. PROJECT(TrackpointApp VERSION 0.0.1 LANGUAGES CXX)
  3. # Include modules
  4. INCLUDE(FetchContent)
  5. # Build TrackpointApp
  6. # Set C++ mode
  7. SET(CMAKE_CXX_STANDARD 20)
  8. SET(CMAKE_CXX_STANDARD_REQUIRED True)
  9. SET(CMAKE_CXX_FLAGS_DEBUG "-O0")
  10. SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
  11. SET(CMAKE_AUTOUIC ON)
  12. SET(CMAKE_AUTOMOC ON)
  13. SET(CMAKE_AUTORCC ON)
  14. SET(CMAKE_INCLUDE_CURRENT_DIR ON)
  15. # OpenSceneGraph
  16. INCLUDE(thirdparty/openscenegraph.cmake)
  17. # lib3mf
  18. INCLUDE(thirdparty/lib3mf.cmake)
  19. # Json
  20. INCLUDE(thirdparty/json.cmake)
  21. # Qt
  22. LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/thirdparty/qt/install")
  23. FIND_PACKAGE(Qt6 COMPONENTS Widgets OpenGLWidgets REQUIRED NO_CMAKE_SYSTEM_PATH)
  24. # The executable we want to build
  25. QT_ADD_EXECUTABLE(TrackpointApp
  26. src/main.cpp
  27. src/MainWindow.cpp
  28. include/MainWindow.hpp
  29. gui/MainWindow.ui
  30. include/OSGWidget.hpp
  31. src/OSGWidget.cpp
  32. src/PickHandler.cpp
  33. src/StoreHandler.cpp
  34. src/TrackPoint.cpp
  35. src/ThreeMFWriter.cpp
  36. src/OpenScadRenderer.cpp
  37. )
  38. INCLUDE_DIRECTORIES(
  39. ${${OPENSCENEGRAPH_PREFIX}_SOURCE_DIR}/include
  40. ${${LIB3MF_PREFIX}_BINARY_DIR}/Autogenerated/Bindings/Cpp
  41. ${${JSON_PREFIX}_SOURCE_DIR}/include
  42. include
  43. gui
  44. )
  45. TARGET_LINK_LIBRARIES(TrackpointApp PRIVATE
  46. osg osgViewer osgDB osgGA osgText osgUtil
  47. lib3mf
  48. nlohmann_json::nlohmann_json
  49. Qt6::Widgets
  50. Qt6::OpenGLWidgets
  51. )
  52. # Header to have version number available in the code
  53. CONFIGURE_FILE(src/trackpointapp.hpp.in src/trackpointapp.hpp)