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

build: add libHipoDataFrame to pkg-config file #53

Merged
merged 3 commits into from
Apr 18, 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
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