diff --git a/Cargo.lock b/Cargo.lock index e6ed935..dac16d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1111,7 +1111,7 @@ dependencies = [ [[package]] name = "resolvo_cpp" -version = "0.2.0" +version = "0.2.1" dependencies = [ "anyhow", "cbindgen", diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index b7c6d13..70d35a2 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -106,6 +106,8 @@ target_include_directories( $ $) +include(GNUInstallDirs) + export( TARGETS Resolvo resolvo_cpp NAMESPACE Resolvo:: @@ -113,17 +115,21 @@ export( install( EXPORT ResolvoTargets NAMESPACE Resolvo:: - DESTINATION lib/cmake/Resolvo) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Resolvo) + install( TARGETS Resolvo resolvo_cpp EXPORT ResolvoTargets - LIBRARY DESTINATION lib - PUBLIC_HEADER DESTINATION include/resolvo) - -install(FILES $ TYPE LIB) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/resolvo) -if(WIN32) - install(FILES $ TYPE LIB) +if(BUILD_SHARED_LIBS) + install(FILES $ TYPE BIN) + if(WIN32) + install(FILES $ TYPE LIB) + endif() +else() + install(FILES $ TYPE LIB) endif() include(CMakePackageConfigHelpers) @@ -160,7 +166,7 @@ function(_resolvo_write_configure_file) configure_package_config_file( "cmake/ResolvoConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Resolvo/ResolvoConfig.cmake" - INSTALL_DESTINATION lib/cmake/resolvo) + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Resolvo) endfunction() cmake_language(DEFER CALL _resolvo_write_configure_file) @@ -175,7 +181,7 @@ install( FILES "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Resolvo/ResolvoConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Resolvo/ResolvoConfigVersion.cmake" - DESTINATION lib/cmake/Resolvo) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Resolvo) if(RESOLVO_BUILD_TESTING) add_subdirectory(tests) diff --git a/cpp/Cargo.toml b/cpp/Cargo.toml index 4c9001c..e7dda0c 100644 --- a/cpp/Cargo.toml +++ b/cpp/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "resolvo_cpp" description = "Resolvo C++ integration" -version = "0.2.0" +version = "0.2.1" authors.workspace = true keywords.workspace = true categories.workspace = true