CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930
  1. # This file includes all FindXXX.cmake modules, so they are all executed.
  2. # As it is it doesn't test a lot.
  3. # It makes sure that the modules don't contain basic syntax errors.
  4. # It also makes sure that modules don't fail with an error if something
  5. # wasn't found but REQUIRED was not given.
  6. #
  7. # I guess more things could be added, like checking whether variables are
  8. # defined after running the modules (e.g. FOO_FOUND etc.).
  9. cmake_minimum_required(VERSION 2.8.4) # new enough for CMP0017
  10. project(FindModulesExecuteAll)
  11. file(GLOB all_modules "${CMAKE_CURRENT_SOURCE_DIR}/../../Modules/Find*cmake")
  12. foreach(module ${all_modules})
  13. message(STATUS "module: ${module}")
  14. include("${module}")
  15. # get the "basename" of the package, so the existence of variables like
  16. # FOO_FOUND could be tested later on, Alex
  17. string(REGEX REPLACE ".+Find([^\\.]+)\\.cmake" "\\1" packageName "${module}")
  18. string(TOUPPER "${packageName}" packageNameUpper)
  19. # disabled for now, since too many modules break:
  20. # if(NOT DEFINED ${packageNameUpper}_FOUND)
  21. # message(SEND_ERROR "${packageNameUpper}_FOUND not defined !")
  22. # endif()
  23. endforeach()
  24. add_executable(FindModulesExecuteAll main.c)