Skip to content
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
30 changes: 21 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ if(NOT C_ONLY)
/usr/local/include
${Boost_INCLUDE_DIRS}
${LZ4_INCLUDE_DIRS}
${DISRUPTOR_INCLUDE_DIR}
$<BUILD_INTERFACE:${DISRUPTOR_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Disruptor>
)

# Build utility programs
Expand Down Expand Up @@ -260,6 +261,7 @@ endif()

# Basic C library installation - minimal approach
install(TARGETS evio
EXPORT evioTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand All @@ -271,7 +273,8 @@ install(FILES ${C_HEADER_FILES}

# C++ components if enabled
if(NOT C_ONLY)
install(TARGETS eviocc
install(TARGETS eviocc ${DISRUPTOR_LIBRARY}
EXPORT evioTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand All @@ -282,15 +285,24 @@ if(NOT C_ONLY)
)
endif()

# Install config files for find_package
# Export targets and install config for find_package()
install(EXPORT evioTargets
FILE evioTargets.cmake
NAMESPACE evio::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evio
)

include(CMakePackageConfigHelpers)

configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/evioConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/evioConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}/evio/cmake"
${CMAKE_SOURCE_DIR}/cmake/evioConfig.cmake.in
${CMAKE_BINARY_DIR}/evioConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evio
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/evioConfig.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/evio/cmake"

install(FILES
${CMAKE_BINARY_DIR}/evioConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evio
)

# Unit testing setup
Expand Down
6 changes: 3 additions & 3 deletions cmake/evioConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ if(NOT DEFINED C_ONLY)
message(WARNING "You may need to set DISRUPTOR_CPP_HOME environment variable.")
endif()
else()
# If evio was built with FetchContent, we make no assumptions
message(STATUS "evio was built with integrated Disruptor. You need to provide Disruptor separately.")
endif()
# Disruptor is built and exported together with evio
message(STATUS "evio includes Disruptor internally; you do not need to provide it separately.")
endif()
endif()

# Include the targets file
Expand Down