aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/CMakeLists.txt.template
diff options
context:
space:
mode:
authorGravatar Stefan Hacker <mail@hacst.net>2018-01-14 13:38:20 +0100
committerGravatar Stefan Hacker <dd0t@users.sourceforge.net>2018-01-14 19:30:38 +0100
commit471a5dc18b4465b051cddf4e02dbdf44336f80ce (patch)
treefd534dba572be147b0c8bee6f7bc2d257d1ae45d /templates/CMakeLists.txt.template
parente1e562eb171c81fad24176e898cc4e722bee227b (diff)
Fix cmake export for grpc
This patch fixes two issues with the targets exported by the grpc cmake build: - Install directories are now given relative instead of absolute. Previously the exported targets would contain absolute paths to their created targets when they should be relative. The actual installation location stays the same as cmake automatically interprets the paths relative to CMAKE_INSTALL_PREFIX - ZLIB and OpenSSL are now linked using targets instead of the legacy library variables if possible. Using the legacy paths produces absolute paths to those dependencies in the export. With this change cmake inserts the target names instead. With these changes no more absolute paths are inserted into the export allowing the install location to be used as an artifact that can be moved or transfered to another machine and used there.
Diffstat (limited to 'templates/CMakeLists.txt.template')
-rw-r--r--templates/CMakeLists.txt.template8
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index 8de0ccde82..8bd62dca43 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -74,10 +74,10 @@
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")
project(<%text>${PACKAGE_NAME}</%text> C CXX)
- set(gRPC_INSTALL_BINDIR "<%text>${CMAKE_INSTALL_PREFIX}</%text>/bin" CACHE PATH "Installation directory for executables")
- set(gRPC_INSTALL_LIBDIR "<%text>${CMAKE_INSTALL_PREFIX}</%text>/lib" CACHE PATH "Installation directory for libraries")
- set(gRPC_INSTALL_INCLUDEDIR "<%text>${CMAKE_INSTALL_PREFIX}</%text>/include" CACHE PATH "Installation directory for headers")
- set(gRPC_INSTALL_CMAKEDIR "<%text>${CMAKE_INSTALL_PREFIX}/lib/cmake/${PACKAGE_NAME}</%text>" CACHE PATH "Installation directory for cmake config files")
+ set(gRPC_INSTALL_BINDIR "bin" CACHE STRING "Installation directory for executables")
+ set(gRPC_INSTALL_LIBDIR "lib" CACHE STRING "Installation directory for libraries")
+ set(gRPC_INSTALL_INCLUDEDIR "include" CACHE STRING "Installation directory for headers")
+ set(gRPC_INSTALL_CMAKEDIR "lib/cmake/<%text>${PACKAGE_NAME}</%text>" CACHE STRING "Installation directory for cmake config files")
# Options
option(gRPC_BUILD_TESTS "Build tests" OFF)