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> INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC ${dlib_needed_includes} PUBLIC ${dlib_needed_includes}
) )
target_include_directories(dlib_shared if (UNIX AND NOT DLIB_IN_PROJECT_BUILD)
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> target_include_directories(dlib_shared
INTERFACE $<INSTALL_INTERFACE:include> INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC ${dlib_needed_includes} INTERFACE $<INSTALL_INTERFACE:include>
) PUBLIC ${dlib_needed_includes}
)
endif()
# Install the library # Install the library
if (NOT DLIB_IN_PROJECT_BUILD) if (NOT DLIB_IN_PROJECT_BUILD)