ExecutableScripts.cmake 595 B

123456789101112131415161718192021
  1. include(GetPrerequisites)
  2. function(check_script script)
  3. set(prereqs "")
  4. get_prerequisites(${script} prereqs 1 1 "" "")
  5. if(NOT "${prereqs}" STREQUAL "")
  6. message(FATAL_ERROR "Prerequisites for ${script} not empty")
  7. endif()
  8. endfunction()
  9. # Should not throw any errors
  10. # Regular executable
  11. if(SAMPLE_EXE)
  12. get_prerequisites("${SAMPLE_EXE}" cmake_prereqs 1 1 "" "")
  13. endif()
  14. # Shell script
  15. check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh)
  16. # Batch script
  17. check_script(${CMAKE_CURRENT_LIST_DIR}/script.bat)
  18. # Shell script without extension
  19. check_script(${CMAKE_CURRENT_LIST_DIR}/script)