diff options
author | Arne Juul <arnej@yahooinc.com> | 2022-10-03 13:13:29 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2022-10-03 13:14:00 +0000 |
commit | 0c4c6af0371e9c37a720e9d74937f05c08805030 (patch) | |
tree | fd208c13b8382d5830c5b7136ba9ad46de20c87c /functions.cmake | |
parent | 7a13dc92cd0705d1ca919cd46e0b382e0ce7cc41 (diff) |
give better messages at install time
Diffstat (limited to 'functions.cmake')
-rw-r--r-- | functions.cmake | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/functions.cmake b/functions.cmake index 90613d13aa4..fd492a55c5b 100644 --- a/functions.cmake +++ b/functions.cmake @@ -663,8 +663,19 @@ function(install_jar_dependencies NAME) install(DIRECTORY "target/dependency/" DESTINATION lib/jars FILES_MATCHING PATTERN "*.jar") endfunction() +function(checked_execute_process_at_install) + list(JOIN ARGV " " my_process_to_execute) + install(CODE "execute_process(RESULT_VARIABLE my_cmd_exit_status COMMAND ${my_process_to_execute}) + if (NOT my_cmd_exit_status EQUAL \"0\") + message(FATAL_ERROR \"failed: ${my_process_to_execute}\") + endif()") +endfunction(checked_execute_process_at_install) + function(install_absolute_symlink TARGET LINK) - install(CODE "execute_process(COMMAND ln -snf ${TARGET} \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${LINK} COMMAND_ERROR_IS_FATAL ANY)") + get_filename_component(target_directory ${LINK} DIRECTORY) + install(DIRECTORY DESTINATION ${target_directory} MESSAGE_NEVER) + checked_execute_process_at_install(ln -snf ${TARGET} \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${LINK}) + install(CODE "message(\"-- Installing: ${LINK} -> ${TARGET})\")") endfunction(install_absolute_symlink) function(install_symlink TARGET LINK) |