Skip to content

Commit

Permalink
Merge pull request #53 from c-dilks/pkgconf-dataframes
Browse files Browse the repository at this point in the history
build: add `libHipoDataFrame` to `pkg-config` file
  • Loading branch information
gavalian authored Apr 18, 2024
2 parents a8342ee + 3f61525 commit d0805e3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
16 changes: 13 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,16 @@ 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)
set(WITH_DATAFRAMES FALSE)
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 +184,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
4 changes: 3 additions & 1 deletion cmake/hipo4.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ prefix=${pcfiledir}/../..
includedir=${prefix}/include
libdir=${prefix}/lib

with_dataframes=@WITH_DATAFRAMES@

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}
3 changes: 3 additions & 0 deletions extensions/dataframes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,7 @@ 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)
set(WITH_DATAFRAMES TRUE PARENT_SCOPE)
endif()
3 changes: 0 additions & 3 deletions extensions/dataframes/RHipoDS.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ public:
// Not required utility methods.
int getEntries(){ return fHipoReader.getEntries(); }

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
ClassDef(RHipoDS, 0);
#pragma clang diagnostic pop

};

Expand Down

0 comments on commit d0805e3

Please sign in to comment.