UsePackage.cmake 743 B

1234567891011121314151617181920212223242526
  1. # This file is designed to be included in a top level CMakeLists.txt like so:
  2. #
  3. # include(path/to/here/UsePackage.cmake)
  4. #
  5. # It will add to the module path all subdirectories with a FindXXX.cmake file
  6. # Do everything inside a function so as not to clash with any existing variables
  7. function(AddDirsToModulePath)
  8. get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
  9. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
  10. ${CURRENT_DIR}/ISPC_lib
  11. ${CURRENT_DIR}/ISP_api
  12. PARENT_SCOPE
  13. )
  14. endfunction()
  15. if(DEBUG_MODULES)
  16. message("CMAKE_MODULE_PATH before: ${CMAKE_MODULE_PATH}")
  17. endif()
  18. AddDirsToModulePath()
  19. if(DEBUG_MODULES)
  20. message("CMAKE_MODULE_PATH after: ${CMAKE_MODULE_PATH}")
  21. endif()