Fix INSTALL_INTERFACE for exported target

CMake war reporting: 'Target "GSL" INTERFACE_SOURCES property contains
path: "..." which is prefixed in the source directory'.
CMake was confused because the $<BUILD_INTERFACE: ...> had linebreaks
in it.
Putting everything in one line fixed the issue.
This commit is contained in:
Stefan Reinhold 2018-07-17 11:56:38 +02:00
parent 030454e3e9
commit 0a31a14d09

View File

@ -55,12 +55,8 @@ target_compile_definitions(GSL INTERFACE
# add include folders to the library and targets that consume it # add include folders to the library and targets that consume it
target_include_directories(GSL INTERFACE target_include_directories(GSL INTERFACE
$<BUILD_INTERFACE: $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
${CMAKE_CURRENT_SOURCE_DIR}/include $<INSTALL_INTERFACE:include>
>
$<INSTALL_INTERFACE:
include
>
) )
if ((CMAKE_VERSION GREATER 3.7.9) OR (CMAKE_VERSION EQUAL 3.7.9)) if ((CMAKE_VERSION GREATER 3.7.9) OR (CMAKE_VERSION EQUAL 3.7.9))
@ -79,9 +75,7 @@ if ((CMAKE_VERSION GREATER 3.7.9) OR (CMAKE_VERSION EQUAL 3.7.9))
endif() endif()
install(TARGETS GSL EXPORT GSLConfig install(TARGETS GSL EXPORT GSLConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
) )
install( install(
DIRECTORY include/gsl DIRECTORY include/gsl