aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmake/vcpkg_common_definitions.cmake
diff options
context:
space:
mode:
authorAlexander Neumann <30894796+Neumann-A@users.noreply.github.com>2019-08-19 21:40:43 +0200
committerGitHub <noreply@github.com>2019-08-19 21:40:43 +0200
commit70f4aabbe8bf5273e11a03f804d4361354cf0a11 (patch)
treec2d553869f70b8fce7b2539bcaa8ffb8bb8aa0cc /scripts/cmake/vcpkg_common_definitions.cmake
parent173642528e2cf7a3f18b41d903b5ff5a758d34ae (diff)
parent8e7ce6d91a060bba5f9e252a5d9aad92f5bd4a56 (diff)
downloadvcpkg-70f4aabbe8bf5273e11a03f804d4361354cf0a11.tar.gz
vcpkg-70f4aabbe8bf5273e11a03f804d4361354cf0a11.zip
Merge branch 'master' into path_separator
Diffstat (limited to 'scripts/cmake/vcpkg_common_definitions.cmake')
-rw-r--r--scripts/cmake/vcpkg_common_definitions.cmake28
1 files changed, 27 insertions, 1 deletions
diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake
index d9b397fa1..ec444c858 100644
--- a/scripts/cmake/vcpkg_common_definitions.cmake
+++ b/scripts/cmake/vcpkg_common_definitions.cmake
@@ -7,7 +7,14 @@
## VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if <target>
## VCPKG_HOST_PATH_SEPARATOR Host specific path separator
## VCPKG_HOST_PATH_SEPARATOR_ESCAPED Escaped version of VCPKG_HOST_PATH_SEPARATOR if necessary (e.g. symbol with special meaning in cmake like ";")
+## VCPKG_TARGET_STATIC_LIBRARY_PREFIX static library prefix for target (same as CMAKE_STATIC_LIBRARY_PREFIX)
+## VCPKG_TARGET_STATIC_LIBRARY_SUFFIX static library suffix for target (same as CMAKE_STATIC_LIBRARY_SUFFIX)
+## VCPKG_TARGET_SHARED_LIBRARY_PREFIX shared library prefix for target (same as CMAKE_SHARED_LIBRARY_PREFIX)
+## VCPKG_TARGET_SHARED_LIBRARY_SUFFIX shared library suffix for target (same as CMAKE_SHARED_LIBRARY_SUFFIX)
## ```
+##
+## CMAKE_STATIC_LIBRARY_PREFIX, CMAKE_STATIC_LIBRARY_SUFFIX, CMAKE_SHARED_LIBRARY_PREFIX, CMAKE_SHARED_LIBRARY_SUFFIX are defined for the target so that
+## portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports.
##
#Helper variable to identify the Target system. VCPKG_TARGET_IS_<targetname>
@@ -33,4 +40,23 @@ if(CMAKE_HOST_WIN32)
elseif(CMAKE_HOST_UNIX)
set(VCPKG_HOST_PATH_SEPARATOR ":")
set(VCPKG_HOST_PATH_SEPARATOR_ESCAPED ":")
-endif() \ No newline at end of file
+endif()
+
+#Helper variables for libraries
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".lib")
+ set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".dll")
+ set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "")
+ set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "")
+else()
+ set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".a")
+ set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".so")
+ set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "lib")
+ set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "lib")
+endif()
+#Setting these variables allows find_library to work in script mode and thus in portfiles!
+#This allows us scale down on hardcoded target dependent paths in portfiles
+set(CMAKE_STATIC_LIBRARY_SUFFIX ${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX})
+set(CMAKE_SHARED_LIBRARY_SUFFIX ${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX})
+set(CMAKE_STATIC_LIBRARY_PREFIX ${VCPKG_TARGET_STATIC_LIBRARY_PREFIX})
+set(CMAKE_SHARED_LIBRARY_PREFIX ${VCPKG_TARGET_SHARED_LIBRARY_PREFIX})