UsePackage.cmake 888 B

12345678910111213141516171819202122232425262728
  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. include(${CURRENT_DIR}/mantis/UsePackage.cmake)
  10. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
  11. PARENT_SCOPE
  12. )
  13. set(MANTISDIR ${CURRENT_DIR} PARENT_SCOPE)
  14. endfunction()
  15. if(DEBUG_MODULES)
  16. message("CMAKE_MODULE_PATH before: ${CMAKE_MODULE_PATH}")
  17. endif()
  18. AddDirsToModulePath()
  19. include(${MANTISDIR}/mantis/project.cmake) # project options - not in the function to have the variables available
  20. if(DEBUG_MODULES)
  21. message("CMAKE_MODULE_PATH after: ${CMAKE_MODULE_PATH}")
  22. endif()