aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2017-06-23 14:53:55 +0200
committerGravatar Jan Tattermusch <jtattermusch@google.com>2017-06-23 16:21:03 +0200
commitf691556db43779f2c33ef29e94392cc7efd0b025 (patch)
treee11c874af03217680f3a86120a562e91463d594a /templates
parent456b713f06b09a2bff42dc7f9ff09fbde973dd58 (diff)
dont reuse protobuf cmake install dirs
Diffstat (limited to 'templates')
-rw-r--r--templates/CMakeLists.txt.template24
1 files changed, 12 insertions, 12 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index 2a5b12b412..1c76136ce3 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -73,6 +73,11 @@
set(PACKAGE_TARNAME "<%text>${PACKAGE_NAME}-${PACKAGE_VERSION}</%text>")
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")
# Options
option(gRPC_BUILD_TESTS "Build tests" OFF)
@@ -335,11 +340,6 @@
set(_gRPC_BASELIB_LIBRARIES wsock32 ws2_32)
endif()
- include(GNUInstallDirs)
- if(NOT DEFINED CMAKE_INSTALL_CMAKEDIR)
- set(CMAKE_INSTALL_CMAKEDIR "<%text>${CMAKE_INSTALL_LIBDIR}</%text>/cmake/gRPC")
- endif()
-
# Create directory for generated .proto files
set(_gRPC_PROTO_GENS_DIR <%text>${CMAKE_BINARY_DIR}/gens</%text>)
file(MAKE_DIRECTORY <%text>${_gRPC_PROTO_GENS_DIR}</%text>)
@@ -500,7 +500,7 @@
)
if (gRPC_INSTALL)
install(FILES <%text>${CMAKE_CURRENT_BINARY_DIR}/</%text>${lib.name}.pdb
- DESTINATION <%text>${CMAKE_INSTALL_LIBDIR}</%text> OPTIONAL
+ DESTINATION <%text>${gRPC_INSTALL_LIBDIR}</%text> OPTIONAL
)
endif()
endif()
@@ -554,7 +554,7 @@
string(REPLACE "include/" "" _path <%text>${_hdr}</%text>)
get_filename_component(_path <%text>${_path}</%text> PATH)
install(FILES <%text>${_hdr}</%text>
- DESTINATION "<%text>${CMAKE_INSTALL_INCLUDEDIR}/${_path}</%text>"
+ DESTINATION "<%text>${gRPC_INSTALL_INCLUDEDIR}/${_path}</%text>"
)
endforeach()
% endif
@@ -622,16 +622,16 @@
<%def name="cc_install(tgt)">
if (gRPC_INSTALL)
install(TARGETS ${tgt.name} EXPORT gRPCTargets
- RUNTIME DESTINATION <%text>${CMAKE_INSTALL_BINDIR}</%text>
- LIBRARY DESTINATION <%text>${CMAKE_INSTALL_LIBDIR}</%text>
- ARCHIVE DESTINATION <%text>${CMAKE_INSTALL_LIBDIR}</%text>
+ RUNTIME DESTINATION <%text>${gRPC_INSTALL_BINDIR}</%text>
+ LIBRARY DESTINATION <%text>${gRPC_INSTALL_LIBDIR}</%text>
+ ARCHIVE DESTINATION <%text>${gRPC_INSTALL_LIBDIR}</%text>
)
endif()
</%def>
if (gRPC_INSTALL)
install(EXPORT gRPCTargets
- DESTINATION <%text>${CMAKE_INSTALL_CMAKEDIR}</%text>
+ DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}</%text>
NAMESPACE gRPC::
)
endif()
@@ -640,6 +640,6 @@
configure_file(tools/cmake/<%text>${_config}</%text>.cmake.in
<%text>${_config}</%text>.cmake @ONLY)
install(FILES <%text>${CMAKE_CURRENT_BINARY_DIR}/${_config}</%text>.cmake
- DESTINATION <%text>${CMAKE_INSTALL_CMAKEDIR}</%text>
+ DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}</%text>
)
endforeach()