summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-boilerplate.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-04-05 21:41:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-04-05 21:41:26 +0200
commit8815732f37c5899dbe65d507c082c0c62250ab7d (patch)
treed350ed3f031447f07794ae4ce51e6f6b00f4bfeb /cmake/opentrack-boilerplate.cmake
parent61592edd7b953c35167fb95f1d26aecc4e5c594a (diff)
cmake: install shared opencv libraries
Issue: #867 Requested by: @Slion
Diffstat (limited to 'cmake/opentrack-boilerplate.cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake27
1 files changed, 27 insertions, 0 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index eaccfc4e..5a4d7c71 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -242,3 +242,30 @@ function(otr_add_target_dirs var)
list(SORT projects)
set("${var}" "${projects}" PARENT_SCOPE)
endfunction()
+
+function(otr_pdb_for_dll varname path)
+ set("${varname}" "" PARENT_SCOPE)
+ get_filename_component(dir "${path}" DIRECTORY)
+ get_filename_component(name-only "${path}" NAME_WE)
+ set(pdb-path "${dir}/${name-only}.pdb")
+ if(EXISTS "${pdb-path}")
+ set("${varname}" "${pdb-path}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(otr_install_lib target dest)
+ get_property(path TARGET "${target}" PROPERTY "LOCATION_${CMAKE_BUILD_TYPE}")
+ if(path STREQUAL "")
+ get_property(path TARGET "${target}" PROPERTY "LOCATION")
+ endif()
+ if(path STREQUAL "")
+ message(FATAL_ERROR "Can't find ${target}")
+ endif()
+ string(TOLOWER "${path}" path_)
+ if(NOT path_ MATCHES "\\.(a|lib)$")
+ if(MSVC AND opentrack_install-debug-info)
+ otr_pdb_for_dll(pdb-path "${opentrack-hier-debug}")
+ endif()
+ install(FILES "${path}" DESTINATION "${dest}")
+ endif()
+endfunction()