CMakeLists.txt 1.3 KB

123456789101112131415161718192021222324252627282930
  1. cmake_minimum_required(VERSION 3.0)
  2. project(nanoflann_gui_example_R3)
  3. find_package(nanoflann REQUIRED)
  4. find_package(mrpt-gui REQUIRED)
  5. add_executable(${PROJECT_NAME}_radius ${PROJECT_NAME}.cpp)
  6. add_executable(${PROJECT_NAME}_knn ${PROJECT_NAME}.cpp)
  7. add_executable(${PROJECT_NAME}_rknn ${PROJECT_NAME}.cpp)
  8. target_compile_definitions(${PROJECT_NAME}_radius PRIVATE USE_RADIUS_SEARCH)
  9. target_compile_definitions(${PROJECT_NAME}_knn PRIVATE USE_KNN_SEARCH)
  10. target_compile_definitions(${PROJECT_NAME}_rknn PRIVATE USE_RKNN_SEARCH)
  11. # optimized build:
  12. if (CMAKE_COMPILER_IS_GNUCXX)
  13. target_compile_options(${PROJECT_NAME}_radius PRIVATE -O2 -mtune=native)
  14. target_compile_options(${PROJECT_NAME}_knn PRIVATE -O2 -mtune=native)
  15. target_compile_options(${PROJECT_NAME}_rknn PRIVATE -O2 -mtune=native)
  16. endif()
  17. # Make sure the include path is used:
  18. target_link_libraries(${PROJECT_NAME}_radius nanoflann::nanoflann mrpt::gui)
  19. target_link_libraries(${PROJECT_NAME}_knn nanoflann::nanoflann mrpt::gui)
  20. target_link_libraries(${PROJECT_NAME}_rknn nanoflann::nanoflann mrpt::gui)
  21. # for this example to find "../utils.h"
  22. target_include_directories(${PROJECT_NAME}_radius PRIVATE ".")
  23. target_include_directories(${PROJECT_NAME}_knn PRIVATE ".")
  24. target_include_directories(${PROJECT_NAME}_rknn PRIVATE ".")