From 67f4a13ec529500999a64cf65e73d485ffbe0164 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Mon, 5 Nov 2018 15:43:31 +0100 Subject: [PATCH] reorganize install path --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3d5c2a..df290d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++11 -Wpedantic -O3 enable_testing() -set(INSTALL_PATH ${CMAKE_SOURCE_DIR}/install) +if(IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}") + set(INSTALL_PATH ${CMAKE_INSTALL_PREFIX}) +else() + #set(INSTALL_PATH ${CMAKE_SOURCE_DIR}/install) + get_filename_component(INSTALL_PATH ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX} ABSOLUTE) +endif() +message(WARNING "found absolute install path '${INSTALL_PATH}'") find_package( GTest REQUIRED ) if(GTest_FOUND)