diff options
author | Kevin Funk <kfunk@kde.org> | 2018-01-12 12:15:02 +0100 |
---|---|---|
committer | Kevin Funk <kfunk@kde.org> | 2018-01-12 12:17:13 +0100 |
commit | 0b05f432098266093ce80573845eb50e4f486176 (patch) | |
tree | 1ed3356069f27e1cf015b5f26427da60d801d1de /libtiff/CMakeLists.txt | |
parent | 1dcf5303e138dd6d717058de0958efc42a05b8e4 (diff) | |
download | libtiff-git-0b05f432098266093ce80573845eb50e4f486176.tar.gz |
Prefer target_include_directories
When libtiff is included in a super project via a simple
`add_subdirectory(libtiff)`, this way the `tiff` library target has all
the necessary information to build against it.
Note: The BUILD_INTERFACE generator expression feature requires at least
CMake v2.8.11 if I'm correct.
Diffstat (limited to 'libtiff/CMakeLists.txt')
-rw-r--r-- | libtiff/CMakeLists.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt index 087dfa9e..2e4ef3cf 100644 --- a/libtiff/CMakeLists.txt +++ b/libtiff/CMakeLists.txt @@ -110,12 +110,14 @@ else() list(APPEND tiff_SOURCES tif_unix.c) endif() -include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${TIFF_INCLUDES}) - add_library(tiff ${tiff_SOURCES} ${tiff_HEADERS} ${nodist_tiff_HEADERS} ${tiff_port_SOURCES} libtiff.def) +target_include_directories(tiff + PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> + ${TIFF_INCLUDES} +) target_link_libraries(tiff ${TIFF_LIBRARY_DEPS}) set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION}) if(NOT CYGWIN) |