Skip to content

Commit

Permalink
Merge pull request #144 from ClausKlein/feature/install_file_set_head…
Browse files Browse the repository at this point in the history
…ers_too [skip ci]

install FILE_SET HEADERS for the new CMake versions
  • Loading branch information
aminya authored Aug 11, 2022
2 parents ce343c8 + 889e14e commit f4e3163
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/PackageProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,22 @@ function(package_project)
# Installation of package (compatible with vcpkg, etc)
set(_targets_list ${_PackageProject_TARGETS})
unset(_PackageProject_TARGETS) # to avoid ycm conflict

if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.23.0")
# required in CMake 3.23 and more
set(FILE_SET_ARGS "FILE_SET" "HEADERS")
endif()

install(
TARGETS ${_targets_list}
EXPORT ${_PackageProject_EXPORT}
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_PackageProject_NAME}" COMPONENT dev)
PUBLIC_HEADER
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_PackageProject_NAME}"
COMPONENT dev
${FILE_SET_ARGS})

# download ForwardArguments
FetchContent_Declare(
Expand Down

0 comments on commit f4e3163

Please sign in to comment.