Skip to content

Commit

Permalink
Exclude header files for metrics from header-only cmake targets (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored May 28, 2021
1 parent 2734b78 commit 12e56f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ install(
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

set(METRICS_EXCLUDE_PATTERN "")
if(NOT WITH_METRICS_PREVIEW)
set(METRICS_EXCLUDE_PATTERN "metrics")
endif()

install(
DIRECTORY include/opentelemetry
DESTINATION include
FILES_MATCHING
PATTERN "*.h")
PATTERN "*.h"
PATTERN "${METRICS_EXCLUDE_PATTERN}" EXCLUDE)

if(BUILD_TESTING)
add_subdirectory(test)
Expand Down
8 changes: 7 additions & 1 deletion sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ install(
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

set(METRICS_EXCLUDE_PATTERN "")
if(NOT WITH_METRICS_PREVIEW)
set(METRICS_EXCLUDE_PATTERN "metrics")
endif()

install(
DIRECTORY include/opentelemetry/sdk
DESTINATION include/opentelemetry/
FILES_MATCHING
PATTERN "*.h")
PATTERN "*.h"
PATTERN "${METRICS_EXCLUDE_PATTERN}" EXCLUDE)

add_subdirectory(src)

Expand Down

0 comments on commit 12e56f9

Please sign in to comment.