Skip to content

Commit

Permalink
build: add libHipoDataFrame to pkg-config file
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Apr 9, 2024
1 parent a8342ee commit 3546896
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ endif()

add_compile_definitions(__LZ4__)

set(DATAFRAME_IN_MAIN TRUE)
add_subdirectory(extensions/dataframes)

set(HIPO_SOURCE_FILES
hipo4/bank.cpp
hipo4/datastream.cpp
Expand Down Expand Up @@ -146,6 +143,15 @@ target_include_directories(hipo4 PUBLIC
target_link_libraries(hipo4 PUBLIC PkgConfig::LZ4 )
target_link_libraries(hipo4_static PUBLIC PkgConfig::LZ4)

list(APPEND PKGCONFIG_LIBS hipo4)

# build extensions
option(BUILD_DATAFRAMES "Build dataframes extension" ON)
if(BUILD_DATAFRAMES)
set(DATAFRAME_IN_MAIN TRUE)
add_subdirectory(extensions/dataframes)
endif()

install(TARGETS hipo4
EXPORT hipo4-export
LIBRARY DESTINATION lib
Expand Down Expand Up @@ -177,6 +183,9 @@ configure_package_config_file( cmake/hipo4Config.cmake.in
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hipo4Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/hipo4ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/hipo4)

# pkgconfig file
list(TRANSFORM PKGCONFIG_LIBS PREPEND -l)
list(JOIN PKGCONFIG_LIBS " " PKGCONFIG_LIB_ARGS)
configure_file(${PROJECT_SOURCE_DIR}/cmake/hipo4.pc.in
${PROJECT_BINARY_DIR}/hipo4.pc
@ONLY)
Expand Down
2 changes: 1 addition & 1 deletion cmake/hipo4.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Name: hipo4
Description: High Performance Output data format for experimental physics
Version: @HIPO_VERSION@
Requires: liblz4 >= @LZ4_VERSION@
Libs: -L${libdir} -lhipo4
Libs: -L${libdir} @PKGCONFIG_LIB_ARGS@
Cflags: -I${includedir}
2 changes: 2 additions & 0 deletions extensions/dataframes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@ else()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/HipoDataFrameConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/HipoDataFrameConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/HipoDataFrame)

list(APPEND PKGCONFIG_LIBS HipoDataFrame)
set(PKGCONFIG_LIBS ${PKGCONFIG_LIBS} PARENT_SCOPE)
endif()

0 comments on commit 3546896

Please sign in to comment.