CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_AUTOMOC ON)
  12. # OpenSceneGraph
  13. INCLUDE(thirdparty/openscenegraph.cmake)
  14. # lib3mf
  15. INCLUDE(thirdparty/lib3mf.cmake)
  16. # Json
  17. INCLUDE(thirdparty/json.cmake)
  18. # Qt
  19. #INCLUDE(thirdparty/qt.cmake)
  20. find_package(Qt6 COMPONENTS Widgets OpenGLWidgets REQUIRED)
  21. # The executable we want to build
  22. ADD_EXECUTABLE(TrackpointApp
  23. include/MainWindow.hpp
  24. src/MainWindow.cpp
  25. include/OSGWidget.hpp
  26. src/OSGWidget.cpp
  27. src/PickHandler.cpp
  28. src/main.cpp
  29. )
  30. INCLUDE_DIRECTORIES(
  31. ${${OPENSCENEGRAPH_PREFIX}_SOURCE_DIR}/include
  32. ${${LIB3MF_PREFIX}_BINARY_DIR}/Autogenerated/Bindings/Cpp
  33. ${${JSON_PREFIX}_SOURCE_DIR}/include
  34. include
  35. )
  36. TARGET_LINK_LIBRARIES(TrackpointApp
  37. osg osgViewer osgDB osgGA osgText osgUtil
  38. lib3mf
  39. nlohmann_json::nlohmann_json
  40. Qt6::Widgets
  41. Qt6::OpenGLWidgets
  42. )
  43. # Header to have version number available in the code
  44. CONFIGURE_FILE(src/trackpointapp.hpp.in src/trackpointapp.hpp)