diff --git a/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt b/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt --- a/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt +++ b/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt @@ -37,23 +37,27 @@ $ ) -install(TARGETS comm-cryptotools EXPORT comm-cryptotools-export - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-cryptotools - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-cryptotools - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-cryptotools -) - -install(FILES ${TOOLS_HDRS} DESTINATION include/Tools) - -set(_builddir_export_path cmake/comm-cryptotools/comm-cryptotools-targets.cmake) -export(TARGETS comm-cryptotools - NAMESPACE comm-cryptotools:: - FILE ${CMAKE_CURRENT_BINARY_DIR}/${_builddir_export_path} -) - -# For installation -install(EXPORT comm-cryptotools-export - FILE comm-cryptotools-targets.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-cryptotools - NAMESPACE comm-cryptotools:: -) +if(NOT ANDROID_NDK) + install(TARGETS comm-cryptotools EXPORT comm-cryptotools-export + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-cryptotools + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-cryptotools + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-cryptotools + ) + + install(FILES ${TOOLS_HDRS} DESTINATION include/Tools) + + set(_builddir_export_path + cmake/comm-cryptotools/comm-cryptotools-targets.cmake + ) + export(TARGETS comm-cryptotools + NAMESPACE comm-cryptotools:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/${_builddir_export_path} + ) + + # For installation + install(EXPORT comm-cryptotools-export + FILE comm-cryptotools-targets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-cryptotools + NAMESPACE comm-cryptotools:: + ) +endif() diff --git a/native/cpp/CommonCpp/DatabaseManagers/CMakeLists.txt b/native/cpp/CommonCpp/DatabaseManagers/CMakeLists.txt --- a/native/cpp/CommonCpp/DatabaseManagers/CMakeLists.txt +++ b/native/cpp/CommonCpp/DatabaseManagers/CMakeLists.txt @@ -45,22 +45,26 @@ Folly::folly ) -install(TARGETS comm-databasemanagers EXPORT comm-databasemanagers-export - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-databasemanagers - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-databasemanagers - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-databasemanagers -) +if(NOT ANDROID_NDK) + install(TARGETS comm-databasemanagers EXPORT comm-databasemanagers-export + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-databasemanagers + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-databasemanagers + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-databasemanagers + ) -install(FILES ${TOOLS_HDRS} DESTINATION include/comm/DatabaseManagers) + install(FILES ${TOOLS_HDRS} DESTINATION include/comm/DatabaseManagers) -set(_builddir_export_path cmake/comm-tools/comm-databasemanagers-targets.cmake) -export(TARGETS comm-databasemanagers - NAMESPACE comm-databasemanagers:: - FILE ${CMAKE_CURRENT_BINARY_DIR}/${_builddir_export_path} -) + set(_builddir_export_path + cmake/comm-tools/comm-databasemanagers-targets.cmake + ) + export(TARGETS comm-databasemanagers + NAMESPACE comm-databasemanagers:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/${_builddir_export_path} + ) -# For installation -install(EXPORT comm-databasemanagers-export - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-databasemanagers - NAMESPACE comm-tools:: -) + # For installation + install(EXPORT comm-databasemanagers-export + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-databasemanagers + NAMESPACE comm-tools:: + ) +endif() diff --git a/native/cpp/CommonCpp/NativeModules/CMakeLists.txt b/native/cpp/CommonCpp/NativeModules/CMakeLists.txt --- a/native/cpp/CommonCpp/NativeModules/CMakeLists.txt +++ b/native/cpp/CommonCpp/NativeModules/CMakeLists.txt @@ -95,33 +95,39 @@ "../../../node_modules/react-native/ReactCommon/jsi" ) -set(_components internal native persistentstorage) -foreach(component ${_components}) - - install(TARGETS comm-modules-${component} EXPORT comm-modules-export - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-modules - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-modules - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-modules +if(NOT ANDROID_NDK) + set(_components internal native persistentstorage) + foreach(component ${_components}) + + install(TARGETS comm-modules-${component} EXPORT comm-modules-export + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-modules + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-modules + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-modules + ) + + endforeach() + + install(FILES ${INTERNAL_HDRS} DESTINATION include/InternalModules) + install(FILES ${NATIVE_HDRS} DESTINATION include/NativeModules) + install(FILES ${MESSAGE_HDRS} DESTINATION include/PersistentStorageUtilities) + install(FILES ${MESSAGE_SPEC_HDRS} + DESTINATION include/PersistentStorageUtilities/MessageSpecs ) + install(FILES ${THREAD_OP_HDRS} DESTINATION include/ThreadOperationsUtilities) -endforeach() - -install(FILES ${INTERNAL_HDRS} DESTINATION include/InternalModules) -install(FILES ${NATIVE_HDRS} DESTINATION include/NativeModules) -install(FILES ${MESSAGE_HDRS} DESTINATION include/PersistentStorageUtilities) -install(FILES ${MESSAGE_SPEC_HDRS} - DESTINATION include/PersistentStorageUtilities/MessageSpecs -) -install(FILES ${THREAD_OP_HDRS} DESTINATION include/ThreadOperationsUtilities) + set(_builddir_export_cmake + ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm-modules/comm-modules-targets.cmake + ) -export(TARGETS comm-modules-internal comm-modules-native - NAMESPACE comm-modules:: - FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm-modules/comm-modules-targets.cmake -) + export(TARGETS comm-modules-internal comm-modules-native + NAMESPACE comm-modules:: + FILE ${_builddir_export_cmake} + ) -# For installation -install(EXPORT comm-modules-export - FILE comm-modules-targets.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-modules - NAMESPACE comm-modules:: -) + # For installation + install(EXPORT comm-modules-export + FILE comm-modules-targets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-modules + NAMESPACE comm-modules:: + ) +endif() diff --git a/native/cpp/CommonCpp/Tools/CMakeLists.txt b/native/cpp/CommonCpp/Tools/CMakeLists.txt --- a/native/cpp/CommonCpp/Tools/CMakeLists.txt +++ b/native/cpp/CommonCpp/Tools/CMakeLists.txt @@ -32,22 +32,24 @@ $ ) -install(TARGETS comm-tools EXPORT comm-tools-export - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-tools - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-tools - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-tools -) - -install(FILES ${TOOLS_HDRS} DESTINATION include/Tools) - -export(TARGETS comm-tools - NAMESPACE comm-tools:: - FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm-tools/comm-tools-targets.cmake -) - -# For installation -install(EXPORT comm-tools-export - FILE comm-tools-targets.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-tool - NAMESPACE comm-tools:: -) +if(NOT ANDROID_NDK) + install(TARGETS comm-tools EXPORT comm-tools-export + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-tools + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-tools + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-tools + ) + + install(FILES ${TOOLS_HDRS} DESTINATION include/Tools) + + export(TARGETS comm-tools + NAMESPACE comm-tools:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm-tools/comm-tools-targets.cmake + ) + + # For installation + install(EXPORT comm-tools-export + FILE comm-tools-targets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-tool + NAMESPACE comm-tools:: + ) +endif() diff --git a/native/cpp/CommonCpp/grpc/CMakeLists.txt b/native/cpp/CommonCpp/grpc/CMakeLists.txt --- a/native/cpp/CommonCpp/grpc/CMakeLists.txt +++ b/native/cpp/CommonCpp/grpc/CMakeLists.txt @@ -46,23 +46,25 @@ "../../../node_modules/react-native/ReactCommon/jsi" ) -install(TARGETS comm-client EXPORT comm-export - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-client - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-client - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-client -) +if(NOT ANDROID_NDK) + install(TARGETS comm-client EXPORT comm-export + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-client + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-client + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-client + ) -install(FILES ${CLIENT_HDRS} DESTINATION include/grpc) + install(FILES ${CLIENT_HDRS} DESTINATION include/grpc) -# For development purposes, able to reference build directory -export(TARGETS comm-client - NAMESPACE comm:: - FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm/comm-grpc-client-targets.cmake -) + # For development purposes, able to reference build directory + export(TARGETS comm-client + NAMESPACE comm:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm/comm-grpc-client-targets.cmake + ) -# For installation -install(EXPORT comm-export - FILE comm-grpc-targets.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-grpc - NAMESPACE comm-grpc:: -) + # For installation + install(EXPORT comm-export + FILE comm-grpc-targets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-grpc + NAMESPACE comm-grpc:: + ) +endif()