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

my rpm package contains an extra prometheus directory #727

Open
whhe opened this issue Dec 10, 2024 · 0 comments
Open

my rpm package contains an extra prometheus directory #727

whhe opened this issue Dec 10, 2024 · 0 comments

Comments

@whhe
Copy link

whhe commented Dec 10, 2024

I include the prometheus-cpp in my project, the cmake file is like below:

include(ExternalProject)
set(PROMETHEUS_INSTALL_DIR ${THIRD_PARTY_PATH}/install/prometheus-cpp)

if (NOT EXISTS ${PROMETHEUS_INSTALL_DIR}/include)
    execute_process(COMMAND mkdir -p ${PROMETHEUS_INSTALL_DIR}/include COMMAND_ERROR_IS_FATAL ANY)
endif ()
add_library(prometheus-cpp INTERFACE)
ExternalProject_Add(
    extern_prometheus-cpp
    ${EXTERNAL_PROJECT_LOG_ARGS}
    GIT_REPOSITORY "https://github.com/jupp0r/prometheus-cpp.git"
    GIT_TAG "v1.1.0"
    PREFIX ${THIRD_PARTY_PATH}/prometheus-cpp
    CMAKE_ARGS
    -DCMAKE_POSITION_INDEPENDENT_CODE=ON
    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
    -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
    -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
    -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
    -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
    -DCMAKE_INSTALL_PREFIX=${PROMETHEUS_INSTALL_DIR}
    -DENABLE_PUSH=ON
    -DENABLE_PULL=ON
    -DENABLE_TESTING=OFF
    -DENABLE_COMPRESSION=ON
    -DUSE_THIRDPARTY_LIBRARIES=ON
)
add_dependencies(prometheus-cpp extern_prometheus-cpp)
target_link_libraries(prometheus-cpp INTERFACE
        ${PROMETHEUS_INSTALL_DIR}/lib64/libprometheus-cpp-pull.a
        ${PROMETHEUS_INSTALL_DIR}/lib64/libprometheus-cpp-push.a
        ${PROMETHEUS_INSTALL_DIR}/lib64/libprometheus-cpp-core.a
)
target_include_directories(prometheus-cpp INTERFACE ${PROMETHEUS_INSTALL_DIR}/include)

I use CPack to make the rpm for my project, but I find that there is an extra directory $PROMETHEUS_INSTALL_DIR in the rpm. What could be the reason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant