Hello,

The documentation of the INCLUDES option of install(TARGETS)
<https://cmake.org/cmake/help/latest/command/install.html#targets>
 command says:
"This option specifies a list of directories which will be added to the
INTERFACE_INCLUDE_DIRECTORIES target property of the <targets> when
exported by the install(EXPORT) command." But using it has no effect, for
example:

install(TARGETS foo
  EXPORT foo_export
  ARCHIVE DESTINATION bin
  LIBRARY DESTINATION lib
  RUNTIME DESTINATION lib
  INCLUDES include)

install(EXPORT foo_export
  DESTINATION cmake)
  FILE foo-config.cmake)

The installed foo-config.cmake doesn't set INTERFACE_INCLUDE_DIRECTORIES.

The only way to achieve the described above behaviour is using
target_include_directories()
<https://cmake.org/cmake/help/latest/command/target_include_directories.html>,
like this:

target_include_directories(foo PUBLIC $<INSTALL_INTERFACE:include>)

I'm using CMake 3.11.4 on Windows. Am I missing something?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to