ExecutableScripts.cmake 571 B

12345678910111213141516171819
  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. get_prerequisites(${CMAKE_COMMAND} cmake_prereqs 1 1 "" "")
  12. # Shell script
  13. check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh)
  14. # Batch script
  15. check_script(${CMAKE_CURRENT_LIST_DIR}/script.bat)
  16. # Shell script without extension
  17. check_script(${CMAKE_CURRENT_LIST_DIR}/script)