Skip to content

Commit

Permalink
perf: default to RUNPATH_DEPENDENCY_PATH
Browse files Browse the repository at this point in the history
install dependencies use a default setting  as directories to search
dependencies from Runpath.cmake.

Close #13

Signed-off-by: msclock <[email protected]>
  • Loading branch information
msclock committed Nov 18, 2023
1 parent ea6de71 commit 307f4e6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions cmake/install/InstallDependency.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ A function to enable installation of dependencies as part of the

Arguments:
TARGETS - a list of installed targets to have dependencies copied for. (required)
DIRECTORIES - the directories to search dependencies. (required)
DESTINATION - the runtime directory for those targets (usually `$<IF:$<PLATFORM_ID:Windows>,bin,lib>`).(optional)
DIRECTORIES - directories to search dependencies. Default to ${RUNPATH_DEPENDENCY_PATH}. (optional)
PRE_EXCLUDE_REGEXES - regular expressions to handle results. (optional)
POST_EXCLUDE_REGEXES - regular expressions to handle results. (optional)
POST_INCLUDE_REGEXES - regular expressions to handle results. (optional)
Expand All @@ -23,13 +22,7 @@ Examples:
add_library(shared SHARED shared.cpp)
add_executable(${app} main.cpp)

install(
TARGETS ${app}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install_dependency(
TARGETS ${app}
DIRECTORIES /opt/to/dependencies/find/path)
install_dependency(TARGETS ${app})

Note:
This requires CMake 3.14 for policy CMP0087
Expand All @@ -55,7 +48,9 @@ function(install_dependency)
endif()

if(NOT DEFINED arg_DIRECTORIES)
message(WARNING "DEPENDENIDES DIRECTORIES must be specified")
set(arg_DIRECTORIES ${RUNPATH_DEPENDENCY_PATH})
endif()

endif()

if(NOT DEFINED arg_DESTINATION)
Expand Down

0 comments on commit 307f4e6

Please sign in to comment.