vcpkg/ports/fmilib/0003-export-targets.patch
Cheney Wang 90e8f9da45
[fmilib] Export targets for usage (#28002)
* [fmilib] Export targets for usage

* Use "version" instead of "version-string"

* Add unofficial as namespace
2022-11-28 10:53:15 -08:00

26 lines
775 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3c11f1..2461ecb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -299,10 +299,18 @@ endif()
file(COPY "${FMILIBRARYHOME}/Config.cmake/fmilib.h" DESTINATION "${FMILibrary_BINARY_DIR}")
-install(TARGETS ${FMILIB_TARGETS}
+TARGET_INCLUDE_DIRECTORIES(${FMILIB_TARGETS} INTERFACE $<INSTALL_INTERFACE:include>)
+
+install(TARGETS ${FMILIB_TARGETS} EXPORT unofficial-fmilib-config
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
- RUNTIME DESTINATION lib
+ RUNTIME DESTINATION bin
+)
+
+install(EXPORT unofficial-fmilib-config
+ FILE unofficial-fmilib-config.cmake
+ NAMESPACE unofficial::fmilib::
+ DESTINATION share/unofficial-fmilib
)
install(FILES
"${FMILIBRARYHOME}/FMILIB_Readme.txt"