From 474344e9f47d86b5bc9bee844980cb85495b10f6 Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Wed, 3 Sep 2014 16:05:03 +0200 Subject: [PATCH] build: configure default installation directories in cmake Set the default installation paths in main CMakeLists.txt. On Tizen these settings will be overridden by variables passed to cmake by rpmbuild. But having them defined makes the standalone build possible, outside of Tizen. Change-Id: Idf84ff5a5e15fd99912b53e0970198d031bbbee5 Signed-off-by: Rafal Krypa --- CMakeLists.txt | 17 +++++++++++++++++ src/service/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cdd475..18b0dee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,23 @@ set(CYNARA_VERSION 0.2.2) INCLUDE(FindPkgConfig) INCLUDE(CheckCXXCompilerFlag) +############################# install dirs ################################## + +SET(LIB_INSTALL_DIR + "${CMAKE_INSTALL_PREFIX}/lib" + CACHE PATH + "Library installation directory") + +SET(BIN_INSTALL_DIR + "${CMAKE_INSTALL_PREFIX}/bin" + CACHE PATH + "Binary installation directory") + +SET(INCLUDE_INSTALL_DIR + "${CMAKE_INSTALL_PREFIX}/include" + CACHE PATH + "Include installation directory") + ############################# compiler flags ################################## SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -g -pg") diff --git a/src/service/CMakeLists.txt b/src/service/CMakeLists.txt index 47482eb..ce1e67d 100644 --- a/src/service/CMakeLists.txt +++ b/src/service/CMakeLists.txt @@ -42,4 +42,4 @@ TARGET_LINK_LIBRARIES(${TARGET_CYNARA} ${TARGET_CYNARA_COMMON} ) -INSTALL(TARGETS ${TARGET_CYNARA} DESTINATION bin) +INSTALL(TARGETS ${TARGET_CYNARA} DESTINATION ${BIN_INSTALL_DIR}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c3e3eea..b04f6d8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -69,4 +69,4 @@ ADD_EXECUTABLE(${TARGET_CYNARA_TESTS} TARGET_LINK_LIBRARIES(${TARGET_CYNARA_TESTS} ${PKGS_LDFLAGS} ${PKGS_LIBRARIES} ) -INSTALL(TARGETS ${TARGET_CYNARA_TESTS} DESTINATION bin) +INSTALL(TARGETS ${TARGET_CYNARA_TESTS} DESTINATION ${BIN_INSTALL_DIR}) -- 2.7.4