Skip to content

Commit ac7ee5f

Browse files
authored
[BUILD] CMake cleanup for message() (open-telemetry#2582)
1 parent e5c2e25 commit ac7ee5f

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

CMakeLists.txt

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,16 @@ function(install_windows_deps)
301301
set(VCPKG_TARGET_ARCHITECTURE
302302
${ARCH}
303303
PARENT_SCOPE)
304-
message("Installing build tools and dependencies...")
304+
message(STATUS "Installing build tools and dependencies...")
305305
set(ENV{ARCH} ${ARCH})
306306
execute_process(
307307
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/setup-buildtools.cmd)
308308
set(CMAKE_TOOLCHAIN_FILE
309309
${CMAKE_CURRENT_SOURCE_DIR}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
310310
CACHE FILEPATH "")
311311
message(
312-
"Make sure that vcpkg.cmake is set as the CMAKE_TOOLCHAIN_FILE at the START of the cmake build process!
312+
STATUS
313+
"Make sure that vcpkg.cmake is set as the CMAKE_TOOLCHAIN_FILE at the START of the cmake build process!
313314
Can be command-line arg (cmake -DCMAKE_TOOLCHAIN_FILE=...) or set in your editor of choice."
314315
)
315316

@@ -347,7 +348,7 @@ include(GNUInstallDirs)
347348
if(WITH_PROMETHEUS)
348349
find_package(prometheus-cpp CONFIG QUIET)
349350
if(NOT prometheus-cpp_FOUND)
350-
message("Trying to use local prometheus-cpp from submodule")
351+
message(STATUS "Trying to use local prometheus-cpp from submodule")
351352
if(EXISTS ${PROJECT_SOURCE_DIR}/third_party/prometheus-cpp/.git)
352353
set(SAVED_ENABLE_TESTING ${ENABLE_TESTING})
353354
set(ENABLE_TESTING OFF)
@@ -361,7 +362,7 @@ if(WITH_PROMETHEUS)
361362
"git submodule update --init --recursive")
362363
endif()
363364
else()
364-
message("Using external prometheus-cpp")
365+
message(STATUS "Using external prometheus-cpp")
365366
endif()
366367
endif()
367368

@@ -389,7 +390,7 @@ if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
389390
endif()
390391

391392
if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE))
392-
message(STATUS_FATAL "Windows dependency installation failed!")
393+
message(FATAL_ERROR "Windows dependency installation failed!")
393394
endif()
394395
if(WIN32)
395396
include(${CMAKE_TOOLCHAIN_FILE})
@@ -485,15 +486,15 @@ endif()
485486

486487
if(OTELCPP_MAINTAINER_MODE)
487488
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
488-
message("Building with gcc in maintainer mode.")
489+
message(STATUS "Building with gcc in maintainer mode.")
489490

490491
add_compile_options(-Wall)
491492
add_compile_options(-Werror)
492493
add_compile_options(-Wextra)
493494

494495
# Tested with GCC 9.4 on github.
495496
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.4)
496-
message("Building with additional warnings for gcc.")
497+
message(STATUS "Building with additional warnings for gcc.")
497498

498499
# Relaxed warnings
499500

@@ -518,15 +519,15 @@ if(OTELCPP_MAINTAINER_MODE)
518519
add_compile_options(-Wvla)
519520
endif()
520521
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
521-
message("Building with clang in maintainer mode.")
522+
message(STATUS "Building with clang in maintainer mode.")
522523

523524
add_compile_options(-Wall)
524525
add_compile_options(-Werror)
525526
add_compile_options(-Wextra)
526527

527528
# Tested with Clang 11.0 on github.
528529
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
529-
message("Building with additional warnings for clang.")
530+
message(STATUS "Building with additional warnings for clang.")
530531

531532
# Relaxed warnings
532533
add_compile_options(-Wno-error=unused-private-field)
@@ -549,7 +550,7 @@ if(OTELCPP_MAINTAINER_MODE)
549550
add_compile_options(-Wold-style-cast)
550551
endif()
551552
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
552-
message("Building with msvc in maintainer mode.")
553+
message(STATUS "Building with msvc in maintainer mode.")
553554

554555
add_compile_options(/WX)
555556
add_compile_options(/W4)
@@ -619,8 +620,8 @@ if(BUILD_TESTING)
619620
if(GTEST_INCLUDE_DIRS)
620621
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
621622
endif()
622-
message("GTEST_INCLUDE_DIRS = ${GTEST_INCLUDE_DIRS}")
623-
message("GTEST_BOTH_LIBRARIES = ${GTEST_BOTH_LIBRARIES}")
623+
message(STATUS "GTEST_INCLUDE_DIRS = ${GTEST_INCLUDE_DIRS}")
624+
message(STATUS "GTEST_BOTH_LIBRARIES = ${GTEST_BOTH_LIBRARIES}")
624625
enable_testing()
625626
if(WITH_BENCHMARK)
626627
# Benchmark respects the CMAKE_PREFIX_PATH
@@ -652,7 +653,7 @@ if(WITH_OPENTRACING)
652653
find_package(OpenTracing CONFIG QUIET)
653654
if(NOT OpenTracing_FOUND)
654655
set(OPENTRACING_DIR "third_party/opentracing-cpp")
655-
message("Trying to use local ${OPENTRACING_DIR} from submodule")
656+
message(STATUS "Trying to use local ${OPENTRACING_DIR} from submodule")
656657
if(EXISTS "${PROJECT_SOURCE_DIR}/${OPENTRACING_DIR}/.git")
657658
set(SAVED_BUILD_TESTING ${BUILD_TESTING})
658659
set(BUILD_TESTING OFF)
@@ -666,7 +667,7 @@ if(WITH_OPENTRACING)
666667
"git submodule update --init --recursive")
667668
endif()
668669
else()
669-
message("Using external opentracing-cpp")
670+
message(STATUS "Using external opentracing-cpp")
670671
endif()
671672
add_subdirectory(opentracing-shim)
672673
endif()

examples/grpc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
get_filename_component(proto_file "./protos/messages.proto" ABSOLUTE)
66
get_filename_component(proto_file_path "${proto_file}" PATH)
77

8-
message("PATH:${proto_file_path}:${proto_file}")
8+
message(STATUS "PATH:${proto_file_path}:${proto_file}")
99
# Generated sources
1010
set(example_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/messages.pb.cc")
1111
set(example_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/messages.pb.h")

0 commit comments

Comments
 (0)