OpenCVExtraTargets.cmake 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # ----------------------------------------------------------------------------
  2. # Uninstall target, for "make uninstall"
  3. # ----------------------------------------------------------------------------
  4. if(NOT TARGET uninstall) # avoid conflicts with parent projects
  5. configure_file(
  6. "${OpenCV_SOURCE_DIR}/cmake/templates/cmake_uninstall.cmake.in"
  7. "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  8. @ONLY
  9. )
  10. add_custom_target(uninstall
  11. COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  12. )
  13. if(ENABLE_SOLUTION_FOLDERS)
  14. set_target_properties(uninstall PROPERTIES FOLDER "CMakeTargets")
  15. endif()
  16. endif()
  17. # ----------------------------------------------------------------------------
  18. # target building all OpenCV modules
  19. # ----------------------------------------------------------------------------
  20. add_custom_target(opencv_modules)
  21. if(ENABLE_SOLUTION_FOLDERS)
  22. set_target_properties(opencv_modules PROPERTIES FOLDER "extra")
  23. endif()
  24. # ----------------------------------------------------------------------------
  25. # targets building all tests
  26. # ----------------------------------------------------------------------------
  27. if(BUILD_TESTS)
  28. add_custom_target(opencv_tests)
  29. if(ENABLE_SOLUTION_FOLDERS)
  30. set_target_properties(opencv_tests PROPERTIES FOLDER "extra")
  31. endif()
  32. endif()
  33. if(BUILD_PERF_TESTS)
  34. add_custom_target(opencv_perf_tests)
  35. if(ENABLE_SOLUTION_FOLDERS)
  36. set_target_properties(opencv_perf_tests PROPERTIES FOLDER "extra")
  37. endif()
  38. endif()
  39. # Documentation
  40. if(BUILD_DOCS)
  41. add_custom_target(opencv_docs)
  42. add_custom_target(install_docs DEPENDS opencv_docs
  43. COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=docs -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
  44. endif()
  45. # Samples
  46. if(BUILD_EXAMPLES)
  47. add_custom_target(opencv_samples)
  48. if(ENABLE_SOLUTION_FOLDERS)
  49. set_target_properties(opencv_samples PROPERTIES FOLDER "extra")
  50. endif()
  51. endif()