diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2015-06-05 19:03:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-06-15 19:09:07 (GMT) |
commit | e726fc025a3543c0be8a4eb217b0a80f9c16051c (patch) | |
tree | 2ed4f4114caff68ff16d06fc2e0e518ff6f5a771 /Tests/RunCMake/CPack/RPM/Prerequirements.cmake | |
parent | 092f1539af99e031c99a74d5a0f24731f58bf10a (diff) | |
download | CMake-e726fc025a3543c0be8a4eb217b0a80f9c16051c.zip CMake-e726fc025a3543c0be8a4eb217b0a80f9c16051c.tar.gz CMake-e726fc025a3543c0be8a4eb217b0a80f9c16051c.tar.bz2 |
Tests: Add RunCMake tests for CPack{Deb,RPM}
Add script structure for easier addition of new CPack related tests.
Diffstat (limited to 'Tests/RunCMake/CPack/RPM/Prerequirements.cmake')
-rw-r--r-- | Tests/RunCMake/CPack/RPM/Prerequirements.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/RPM/Prerequirements.cmake b/Tests/RunCMake/CPack/RPM/Prerequirements.cmake new file mode 100644 index 0000000..3416205 --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/Prerequirements.cmake @@ -0,0 +1,16 @@ +function(get_test_prerequirements found_var config_file) + if(CMAKE_CURRENT_BINARY_DIR MATCHES " ") + # rpmbuild can't handle spaces in path + return() + endif() + + find_program(RPM_EXECUTABLE rpm) + find_program(RPMBUILD_EXECUTABLE rpmbuild) + + if(RPM_EXECUTABLE AND RPMBUILD_EXECUTABLE) + file(WRITE "${config_file}" "set(RPM_EXECUTABLE \"${RPM_EXECUTABLE}\")") + file(APPEND "${config_file}" + "\nset(RPMBUILD_EXECUTABLE \"${RPMBUILD_EXECUTABLE}\")") + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() |