From 35468965ce347e8a555c1c845a8b162e2e6de012 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Wed, 3 Apr 2024 16:54:20 -0400 Subject: [PATCH 1/3] build: add `libHipoDataFrame` to `pkg-config` file --- CMakeLists.txt | 15 ++++++++++++--- cmake/hipo4.pc.in | 2 +- extensions/dataframes/CMakeLists.txt | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14d730d..168a90c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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 @@ -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) diff --git a/cmake/hipo4.pc.in b/cmake/hipo4.pc.in index 3e61d3b..b6281ee 100644 --- a/cmake/hipo4.pc.in +++ b/cmake/hipo4.pc.in @@ -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} diff --git a/extensions/dataframes/CMakeLists.txt b/extensions/dataframes/CMakeLists.txt index ca29ed5..5ee631e 100644 --- a/extensions/dataframes/CMakeLists.txt +++ b/extensions/dataframes/CMakeLists.txt @@ -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() From 4c8325bcf289c5da84f20e6e2b84f9b9ad121447 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Fri, 5 Apr 2024 20:46:45 -0400 Subject: [PATCH 2/3] fix: drop `#pragma clang diagnostic` calls --- extensions/dataframes/RHipoDS.hxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/extensions/dataframes/RHipoDS.hxx b/extensions/dataframes/RHipoDS.hxx index 72af1f7..53fa85e 100644 --- a/extensions/dataframes/RHipoDS.hxx +++ b/extensions/dataframes/RHipoDS.hxx @@ -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 }; From 3f615258df28295d8dc3c5f02369dbf89dadb9e5 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Wed, 17 Apr 2024 12:07:31 -0400 Subject: [PATCH 3/3] feat: add `with_dataframes` var --- CMakeLists.txt | 1 + cmake/hipo4.pc.in | 2 ++ extensions/dataframes/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 168a90c..10b9075 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,7 @@ 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) diff --git a/cmake/hipo4.pc.in b/cmake/hipo4.pc.in index b6281ee..a9f593d 100644 --- a/cmake/hipo4.pc.in +++ b/cmake/hipo4.pc.in @@ -2,6 +2,8 @@ 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@ diff --git a/extensions/dataframes/CMakeLists.txt b/extensions/dataframes/CMakeLists.txt index 5ee631e..5b4be09 100644 --- a/extensions/dataframes/CMakeLists.txt +++ b/extensions/dataframes/CMakeLists.txt @@ -134,4 +134,5 @@ else() list(APPEND PKGCONFIG_LIBS HipoDataFrame) set(PKGCONFIG_LIBS ${PKGCONFIG_LIBS} PARENT_SCOPE) + set(WITH_DATAFRAMES TRUE PARENT_SCOPE) endif()