CMake: made install step export the targets stable-3.0
authorKevin d'Orange
Fri, 19 Apr 2019 12:33:08 +0200
branchstable-3.0
changeset 1669 6ad125b6b379
parent 1667 ae84e126219c
child 1670 de1ea3b2cfc4
CMake: made install step export the targets (transplanted from b2abaf7d4e4b2af671763b9ef2887dd30b42d6da)
CMakeLists.txt
--- a/CMakeLists.txt	Mon Mar 18 14:37:22 2019 -0400
+++ b/CMakeLists.txt	Fri Apr 19 12:33:08 2019 +0200
@@ -213,12 +213,19 @@
     set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs")
 endif()
 
-install(TARGETS ${PHYSFS_INSTALL_TARGETS}
+install(TARGETS ${PHYSFS_INSTALL_TARGETS} EXPORT PhysFSExport
         RUNTIME DESTINATION bin
         LIBRARY DESTINATION lib${LIB_SUFFIX}
-        ARCHIVE DESTINATION lib${LIB_SUFFIX})
+        ARCHIVE DESTINATION lib${LIB_SUFFIX}
+        INCLUDES DESTINATION include)
 install(FILES src/physfs.h DESTINATION include)
 
+install(EXPORT PhysFSExport
+        DESTINATION "lib${LIB_SUFFIX}/cmake/PhysFS"
+        FILE PhysFSConfig.cmake
+)
+
+
 find_package(Doxygen)
 if(DOXYGEN_FOUND)
     set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")