Only specify include directories for dlib_shared if it is built

This commit is contained in:
Alain Vaucher 2017-02-27 18:09:40 +01:00
parent 3eaa463ec6
commit b024f23512

View File

@ -671,11 +671,13 @@ if (NOT TARGET dlib)
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC ${dlib_needed_includes}
)
target_include_directories(dlib_shared
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC ${dlib_needed_includes}
)
if (UNIX AND NOT DLIB_IN_PROJECT_BUILD)
target_include_directories(dlib_shared
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC ${dlib_needed_includes}
)
endif()
# Install the library
if (NOT DLIB_IN_PROJECT_BUILD)