CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. cmake_minimum_required(VERSION 3.5)
  2. project(rs_driver_viewer)
  3. message(=============================================================)
  4. message("-- Ready to compile tools")
  5. message(=============================================================)
  6. include_directories(${DRIVER_INCLUDE_DIRS})
  7. set(CMAKE_BUILD_TYPE Release)
  8. if(WIN32)
  9. cmake_policy(SET CMP0074 NEW)
  10. set(OPENNI_ROOT "C:\\Program Files\\OpenNI2")
  11. set(OPENNI_LIBRARY "${OPENNI_ROOT}\\Lib\\OpenNI2.lib")
  12. set(OPENNI_INCLUDE_DIRS "${OPENNI_ROOT}\\Include\\")
  13. file(COPY ${OPENNI_ROOT}\\Redist\\OpenNI2.dll DESTINATION ${PROJECT_BINARY_DIR}\\Release)
  14. file(COPY ${OPENNI_ROOT}\\Redist\\OpenNI2.dll DESTINATION ${PROJECT_BINARY_DIR}\\Debug)
  15. endif(WIN32)
  16. find_package(PCL COMPONENTS common visualization io QUIET REQUIRED)
  17. add_definitions(${PCL_DEFINITIONS})
  18. include_directories(${PCL_INCLUDE_DIRS})
  19. link_directories(${PCL_LIBRARY_DIRS})
  20. if(PCL_FOUND)
  21. add_executable(rs_driver_viewer
  22. rs_driver_viewer.cpp)
  23. target_link_libraries(rs_driver_viewer
  24. ${EXTERNAL_LIBS}
  25. ${PCL_LIBRARIES})
  26. else()
  27. message("PCL Not found! Can not compile rs_driver_viewer!")
  28. endif()
  29. install(TARGETS rs_driver_viewer
  30. RUNTIME DESTINATION /usr/bin)