diff --git a/CMakeLists.txt b/CMakeLists.txt index 14d730d..10b9075 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,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 @@ -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) diff --git a/cmake/hipo4.pc.in b/cmake/hipo4.pc.in index 3e61d3b..a9f593d 100644 --- a/cmake/hipo4.pc.in +++ b/cmake/hipo4.pc.in @@ -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} diff --git a/extensions/dataframes/CMakeLists.txt b/extensions/dataframes/CMakeLists.txt index ca29ed5..5b4be09 100644 --- a/extensions/dataframes/CMakeLists.txt +++ b/extensions/dataframes/CMakeLists.txt @@ -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() 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 };