After INTERFACE (header only library) is added with add_library and setting of INTERFACE for BUILD_INTERFACE and INSTALL_INTERFACE with target_include_directories, followed by install(TARGETS EXPORT and install(EXPORTS (see details below), the INTERFACE library is not installed. There were generated and configuration and generation phases completed successfully. Then make install passed fine but INTERFACE library was not installed.
It could be installed directly via install(DIRECTORY but that is not acceptable method. Attempts to get it installed as a dependent library to main mylib SHARED library also did not succeed.
Could you please advise how this should be done.
EXPECTED RESULTS:
${ARCHITECTURE}/myintlib/include DIR is created
ACTUAL RESULTS
no ${ARCHITECTURE}/myintlib/include DIR is created
CODE FLOW:
add_library(myintlib INTERFACE)
target_include_directories(myintlib
INTERFACE
$<BUILD_INTERFACE:${IMPORTED_LOCATION_ROOT}/include>
$<INSTALL_INTERFACE:${ARCHITECTURE}/myintlib/include>
)
target_link_libraries(mylib ...
myintlib
)
install(TARGETS myintlib
EXPORT ${proj_targets_export_name}
CONFIGURATIONS ${CMAKE_BUILD_TYPE}
INCLUDES DESTINATION ${CMAKE_INSTALL_PREFIX}/myintlib/include
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(EXPORT ${proj_targets_export_name}
DESTINATION "${CONFIG_INSTALL_DIR}"
FILE ${proj_targets_export_filename}
COMPONENT ${PROJECT_NAME}_Development
)
Note: the builtTargets
obtained as get_directory_property(builtTargets BUILDSYSTEM_TARGETS)
lists mintlib