From 748328a0d128b403fe5ff05a7664cbca2d606ecd Mon Sep 17 00:00:00 2001 From: Magnus Bjerke Vik Date: Tue, 6 Jan 2015 09:51:44 +0100 Subject: [PATCH] Fix cmake_package install being broken because of wrong include path. The TARGET_INCLUDE_DIRECTORIES from inside the IF(JSONCPP_WITH_CMAKE_PACKAGE) block was removed, since it only needs to be set once. In addition the CMAKE_VERSION check was simplified. --- src/lib_json/CMakeLists.txt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index f21069b..d0f6a5e 100644 --- a/src/lib_json/CMakeLists.txt +++ b/src/lib_json/CMakeLists.txt @@ -49,18 +49,15 @@ ADD_LIBRARY( jsoncpp_lib ${JSONCPP_LIB_TYPE} SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES OUTPUT_NAME jsoncpp ) SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_VERSION_MAJOR} ) -IF(CMAKE_VERSION VERSION_EQUAL 2.8.11 OR CMAKE_VERSION VERSION_GREATER 2.8.11) - TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib - PUBLIC ${JSONCPP_INCLUDE_DIR} +IF(NOT CMAKE_VERSION VERSION_LESS 2.8.11) + TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib PUBLIC + $ + $ ) -ENDIF(CMAKE_VERSION VERSION_EQUAL 2.8.11 OR CMAKE_VERSION VERSION_GREATER 2.8.11) +ENDIF(NOT CMAKE_VERSION VERSION_LESS 2.8.11) # Install instructions for this target IF(JSONCPP_WITH_CMAKE_PACKAGE) - TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib - PUBLIC $ - $ - ) SET(INSTALL_EXPORT EXPORT jsoncpp) ELSE(JSONCPP_WITH_CMAKE_PACKAGE) SET(INSTALL_EXPORT)