Simplify package-relative installation

LT1AB
Ryan Burns 2020-05-22 13:13:46 -07:00
parent 149b4aa29a
commit 8725bd0573
1 changed files with 1 additions and 7 deletions

View File

@ -50,22 +50,16 @@ endfunction()
# Note that it first checks if a provided file is a target, # Note that it first checks if a provided file is a target,
# and if so, installs it as a TARGET instead. Make sure your # and if so, installs it as a TARGET instead. Make sure your
# filenames and target names don't have any overlap! # filenames and target names don't have any overlap!
function(InstallSameDir) function(InstallSameDir)
mark_as_advanced(isce2_bin_base)
foreach(name ${ARGN}) foreach(name ${ARGN})
if(TARGET ${name}) if(TARGET ${name})
set(installtype TARGETS) set(installtype TARGETS)
else() else()
set(installtype FILES) set(installtype FILES)
endif() endif()
file(RELATIVE_PATH path ${isce2_bin_dir} ${CMAKE_CURRENT_BINARY_DIR}) file(RELATIVE_PATH path ${isce2_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
install(${installtype} ${name} install(${installtype} ${name}
DESTINATION ${ISCE2_PKG}/${path} DESTINATION ${ISCE2_PKG}/${path}
) )
endforeach() endforeach()
endfunction() endfunction()
# We use this instead of CMAKE_BINARY_DIR to handle
# cases where isce2 is added as a subdirectory
set(isce2_bin_dir ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
"ISCE2 root build directory")