Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use GNUInstallDirs for installation locations #72

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 15 additions & 9 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,30 @@ target_include_directories(
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/resolvo>)

include(GNUInstallDirs)

export(
TARGETS Resolvo resolvo_cpp
NAMESPACE Resolvo::
FILE "${CMAKE_BINARY_DIR}/lib/cmake/Resolvo/ResolvoTargets.cmake")
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 $<TARGET_FILE:${resolvo_cpp_impl}> TYPE LIB)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/resolvo)

if(WIN32)
install(FILES $<TARGET_LINKER_FILE:${resolvo_cpp_impl}> TYPE LIB)
if(BUILD_SHARED_LIBS)
install(FILES $<TARGET_FILE:${resolvo_cpp_impl}> TYPE BIN)
if(WIN32)
install(FILES $<TARGET_LINKER_FILE:${resolvo_cpp_impl}> TYPE LIB)
endif()
else()
install(FILES $<TARGET_FILE:${resolvo_cpp_impl}> TYPE LIB)
endif()

include(CMakePackageConfigHelpers)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cpp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading