cmake/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake

22 lines
595 B
CMake
Raw Normal View History

2019-11-11 23:01:05 +01:00
include(GetPrerequisites)
function(check_script script)
set(prereqs "")
get_prerequisites(${script} prereqs 1 1 "" "")
if(NOT "${prereqs}" STREQUAL "")
message(FATAL_ERROR "Prerequisites for ${script} not empty")
endif()
endfunction()
# Should not throw any errors
# Regular executable
2023-05-23 16:38:00 +02:00
if(SAMPLE_EXE)
get_prerequisites("${SAMPLE_EXE}" cmake_prereqs 1 1 "" "")
endif()
2019-11-11 23:01:05 +01:00
# Shell script
check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh)
# Batch script
check_script(${CMAKE_CURRENT_LIST_DIR}/script.bat)
# Shell script without extension
check_script(${CMAKE_CURRENT_LIST_DIR}/script)