CMake: Only add include directory to jsoncpp_lib target if CMake version supports the command.

This commit is contained in:
Magnus Bjerke Vik 2014-12-16 08:58:52 +01:00
parent e99e6d9cc6
commit 3fd7f8b470

View File

@ -39,9 +39,11 @@ 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} )
TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib
PUBLIC ${JSONCPP_INCLUDE_DIR}
)
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}
)
ENDIF(CMAKE_VERSION VERSION_EQUAL 2.8.11 OR CMAKE_VERSION VERSION_GREATER 2.8.11)
# Install instructions for this target
IF(JSONCPP_WITH_CMAKE_PACKAGE)