File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,9 +47,15 @@ else()
4747endif ()
4848
4949
50+ # GNUInstallDirs defines CMAKE_INSTALL_INCLUDEDIR (and friends), which is used
51+ # below in the INSTALL_INTERFACE include path. It must be included before that
52+ # expansion, otherwise the variable is empty and the exported target ends up
53+ # with a bogus "/fastpfor" include directory that breaks find_package().
54+ include (GNUInstallDirs )
55+
5056# library target
5157add_library (FastPFOR STATIC )
52- target_include_directories (FastPFOR PUBLIC
58+ target_include_directories (FastPFOR PUBLIC
5359 $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR } /headers >
5460 $<INSTALL_INTERFACE :${CMAKE_INSTALL_INCLUDEDIR} /fastpfor >
5561)
@@ -193,8 +199,7 @@ if(FASTPFOR_WITH_TEST)
193199 enable_testing ()
194200 add_test ("FastPFOR_unittest" FastPFOR_unittest )
195201endif ()
196-
197- include (GNUInstallDirs )
202+
198203install (TARGETS FastPFOR
199204 EXPORT FastPFORExport
200205 ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR} "
You can’t perform that action at this time.
0 commit comments