CMakeLists.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. #INCLUDE(thirdparty/qt.cmake)
  23. find_package(Qt6 COMPONENTS Widgets OpenGLWidgets REQUIRED)
  24. # The executable we want to build
  25. 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
  46. osg osgViewer osgDB osgGA osgText osgUtil
  47. lib3mf
  48. nlohmann_json::nlohmann_json
  49. Qt6::Core
  50. Qt6::Widgets
  51. Qt6::OpenGLWidgets
  52. )
  53. # Header to have version number available in the code
  54. CONFIGURE_FILE(src/trackpointapp.hpp.in src/trackpointapp.hpp)