From a159bdbdb0714bb553633f749a3dc5d0b3516601 Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 16 Nov 2017 00:33:28 +0100 Subject: [PATCH] Propagate binary and source dir to parent scope --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d367ddd..809c229 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,3 +40,11 @@ option(NO_GENERATOR "disables building the generator (useful for cross-compiling if(NOT NO_GENERATOR) add_subdirectory(generator) endif() + +# propagate binary and source directory of library to parent scope +get_directory_property(HAS_PARENT PARENT_DIRECTORY) +if(HAS_PARENT) + set(REFLECTIVE_RAPIDJSON_BINARY_DIR "${REFLECTIVE_RAPIDJSON_BINARY_DIR}" PARENT_SCOPE) + set(REFLECTIVE_RAPIDJSON_SOURCE_DIR "${REFLECTIVE_RAPIDJSON_SOURCE_DIR}" PARENT_SCOPE) + set(reflective_rapidjson_DIR "${REFLECTIVE_RAPIDJSON_BINARY_DIR}" PARENT_SCOPE) +endif()