Fix target_include_directories not available on semi-modern platforms (Issue 181)

This commit is contained in:
Jeffrey Walton 2016-06-18 22:13:18 -04:00
parent b0e9f4bebd
commit 0b56cf57b1

View File

@ -131,15 +131,22 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set_target_properties(cryptopp-object PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()
if (BUILD_STATIC)
add_library(cryptopp-static STATIC $<TARGET_OBJECTS:cryptopp-object>)
target_include_directories(cryptopp-static PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/cryptopp>)
if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
target_include_directories(cryptopp-static PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/cryptopp>)
else()
include_directories("${ROOT_SOURCE_DIR}")
endif()
endif()
if (BUILD_SHARED)
add_library(cryptopp-shared SHARED $<TARGET_OBJECTS:cryptopp-object>)
target_include_directories(cryptopp-shared PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/cryptopp>)
if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
target_include_directories(cryptopp-shared PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/cryptopp>)
else()
include_directories("${ROOT_SOURCE_DIR}")
endif()
endif()
if(NOT MSVC)
@ -252,4 +259,3 @@ endif()
if(BUILD_DOCUMENTATION)
install(DIRECTORY "${out_source_DOCS_DIR}" DESTINATION ${CMAKE_INSTALL_DOCDIR})
endif()