From ab02e60b5da28647bfcc864b0bb1b9a90504cdb1 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sun, 19 Jun 2022 16:14:11 -0700 Subject: [PATCH 1/2] Install fbjniLibraryConfig.cmake at CMAKE_INSTALL_LIBDIR It's pretty common for the lib directory to be added to the cmake modules path, but much less so for share. This is to better align with dominate cmake pratices. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74425a2..97aa923 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,7 +107,7 @@ install(TARGETS fbjni EXPORT fbjniLibraryConfig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) #For windows -install(EXPORT fbjniLibraryConfig DESTINATION share/cmake/fbjni +install(EXPORT fbjniLibraryConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fbjni FILE fbjniLibraryConfig.cmake) if(MSVC) From 74e125caa9a815244f1e6bd08eaba57d015378b4 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sun, 3 Jul 2022 12:21:05 -0700 Subject: [PATCH 2/2] Install fbjni headers as part of CMake install --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97aa923..53a1b85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,15 @@ file(GLOB fbjni_SOURCES cxx/lyra/*.cpp ) -add_library(fbjni SHARED ${fbjni_SOURCES}) +file(GLOB fbjni_HEADERS + cxx/fbjni/*.h +) + +file(GLOB fbjni_detail_HEADERS + cxx/fbjni/detail/*.h +) + +add_library(fbjni SHARED ${fbjni_SOURCES} ${fbjni_HEADERS}) set_target_properties(fbjni PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) target_compile_options(fbjni PRIVATE ${FBJNI_COMPILE_OPTIONS}) @@ -110,6 +118,9 @@ install(TARGETS fbjni EXPORT fbjniLibraryConfig install(EXPORT fbjniLibraryConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fbjni FILE fbjniLibraryConfig.cmake) +install(FILES ${fbjni_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fbjni) +install(FILES ${fbjni_detail_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fbjni/detail) + if(MSVC) install(FILES $ DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) install(TARGETS fbjni DESTINATION ${CMAKE_INSTALL_LIBDIR})