CMake/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirImport.cmake
Kyle Edwards 70f36de1e5 File set: Allow absolute CMAKE_INSTALL_INCLUDEDIR
When install(TARGETS) and install(EXPORT) were called with file sets
and an absolute CMAKE_INSTALL_INCLUDEDIR, "${_IMPORT_PREFIX}/" was
still being prepended to the base directory and files, resulting in
incorrect paths. Don't prepend this when absolute paths are used.

Fixes: #25010
2023-06-20 11:39:11 -04:00

10 lines
290 B
CMake

enable_language(CXX)
get_filename_component(CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}" DIRECTORY)
string(APPEND CMAKE_PREFIX_PATH "/FileSetAbsoluteInstallIncludeDirExport-build/install")
find_package(lib1 REQUIRED)
add_executable(exe main.cpp)
target_link_libraries(exe PRIVATE lib1::lib1)