vcpkg/ports/enkits/update_install.patch

36 lines
1.2 KiB
Diff
Raw Normal View History

2023-10-14 02:43:06 +08:00
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f8572e..f42ec18 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0)
project( enkiTS )
+include(GNUInstallDirs)
+
option( ENKITS_BUILD_C_INTERFACE "Build C interface" ON )
option( ENKITS_BUILD_EXAMPLES "Build example applications" ON )
option( ENKITS_BUILD_SHARED "Build shared library" OFF )
@@ -59,9 +63,19 @@ if( UNIX )
2023-10-14 02:43:06 +08:00
target_link_libraries( enkiTS ${CMAKE_THREAD_LIBS_INIT} )
endif()
+target_include_directories(enkiTS PUBLIC "$<INSTALL_INTERFACE:include>")
if( ENKITS_INSTALL )
- install(TARGETS enkiTS DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/enkiTS")
- install(FILES ${ENKITS_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/enkiTS")
+ install(
+ TARGETS enkiTS
+ EXPORT enkiTS-config
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
2023-10-14 02:43:06 +08:00
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES ${ENKITS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ install(
+ EXPORT enkiTS-config
+ NAMESPACE enkiTS::
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/enkiTS)
endif()
if( UNIX )