Skip to content

Commit

Permalink
CMake: Add mode to all cmake message() statements
Browse files Browse the repository at this point in the history
Pure status messages shall be printed to stdout.
But without mode, they were printed to stderr.
  • Loading branch information
dg0yt committed Feb 14, 2022
1 parent 0843361 commit 77a2b03
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ if (APPLE)
PROPERTY TYPE)
if (NOT result)
set(CMAKE_FIND_FRAMEWORK LAST)
message("Setting CMAKE_FIND_FRAMEWORK=${CMAKE_FIND_FRAMEWORK}")
message(STATUS "Setting CMAKE_FIND_FRAMEWORK=${CMAKE_FIND_FRAMEWORK}")
endif ()
endif ()

Expand Down
8 changes: 4 additions & 4 deletions autotest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ if (Python_Interpreter_FOUND)
RESULT res
SYMBOLIC)
if (NOT res EQUAL 0)
message("Copying content of ${source} to ${destination}")
message(STATUS "Copying content of ${source} to ${destination}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${source} ${destination})
endif ()
else ()
if (NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${source} ${destination})
else ()
message("Copying content of ${source} to ${destination}")
message(STATUS "Copying content of ${source} to ${destination}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${source} ${destination})
endif ()
endif ()
Expand All @@ -69,7 +69,7 @@ if (Python_Interpreter_FOUND)
# Needed for a autotest/osr test
symlink_or_copy(${CMAKE_CURRENT_SOURCE_DIR}/cpp/data ${CMAKE_CURRENT_BINARY_DIR}/cpp/data)
if (SKIP_COPYING_AUTOTEST_SUBDIRS)
message("Skipping copying ${CMAKE_CURRENT_SOURCE_DIR}/pymod")
message(STATUS "Skipping copying ${CMAKE_CURRENT_SOURCE_DIR}/pymod")
else ()
symlink_or_copy(${CMAKE_CURRENT_SOURCE_DIR}/pymod ${CMAKE_CURRENT_BINARY_DIR}/pymod)
endif ()
Expand All @@ -85,7 +85,7 @@ if (Python_Interpreter_FOUND)
pyscripts
utilities)
if (SKIP_COPYING_AUTOTEST_SUBDIRS)
message("Skipping copying ${CMAKE_CURRENT_SOURCE_DIR}/${tgt}")
message(STATUS "Skipping copying ${CMAKE_CURRENT_SOURCE_DIR}/${tgt}")
else ()
symlink_or_copy(${CMAKE_CURRENT_SOURCE_DIR}/${tgt} ${CMAKE_CURRENT_BINARY_DIR}/${tgt})
endif ()
Expand Down
4 changes: 2 additions & 2 deletions cmake/helpers/CheckDependentLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ macro (gdal_check_package name purpose)
elseif (NOT GDAL_USE_EXTERNAL_LIBS)
set(_gcpp_status OFF)
if (HAVE_${key} AND NOT GDAL_USE_${key})
message(
message(STATUS
"${key} has been found, but is disabled due to GDAL_USE_EXTERNAL_LIBS=OFF. Enable it by setting GDAL_USE_${key}=ON"
)
endif ()
endif ()
if (_gcpp_status AND _GCP_DISABLED_BY_DEFAULT)
set(_gcpp_status OFF)
if (HAVE_${key} AND NOT GDAL_USE_${key})
message("${key} has been found, but is disabled by default. Enable it by setting GDAL_USE_${key}=ON")
message(STATUS "${key} has been found, but is disabled by default. Enable it by setting GDAL_USE_${key}=ON")
endif ()
endif ()
cmake_dependent_option(GDAL_USE_${key} "Set ON to use ${key}" ${_gcpp_status} "HAVE_${key}" OFF)
Expand Down
2 changes: 1 addition & 1 deletion gdal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ else ()

endif ()

# message("GDAL_C_WARNING_FLAGS: ${GDAL_C_WARNING_FLAGS}") message("GDAL_CXX_WARNING_FLAGS: ${GDAL_CXX_WARNING_FLAGS}")
# message(STATUS "GDAL_C_WARNING_FLAGS: ${GDAL_C_WARNING_FLAGS}") message(STATUS "GDAL_CXX_WARNING_FLAGS: ${GDAL_CXX_WARNING_FLAGS}")

if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
check_cxx_compiler_flag(-fno-finite-math-only HAVE_FLAG_NO_FINITE_MATH_ONLY)
Expand Down
4 changes: 2 additions & 2 deletions scripts/install_bash_completions.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ set(PROGRAMS
set(INSTALL_DIR "$ENV{DESTDIR}@CMAKE_INSTALL_PREFIX@/@BASH_COMPLETIONS_DIR@")

file(MAKE_DIRECTORY "${INSTALL_DIR}")
message("Installing ${INSTALL_DIR}/gdalinfo")
message(STATUS "Installing ${INSTALL_DIR}/gdalinfo")
configure_file("@CMAKE_CURRENT_SOURCE_DIR@/gdal-bash-completion.sh" "${INSTALL_DIR}/gdalinfo" COPYONLY)

foreach (program IN LISTS PROGRAMS)
message("Installing ${INSTALL_DIR}/${program}")
message(STATUS "Installing ${INSTALL_DIR}/${program}")
if (NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "gdalinfo" "${INSTALL_DIR}/${program}")
else ()
Expand Down
11 changes: 3 additions & 8 deletions swig/csharp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function (gdal_csharp_dll)

else ()
if (CMAKE_VERBOSE_MAKEFILE)
message("BUILDING : " ${_CSHARP_TARGET} " : " ${CSHARP_COMPILER} ${CSC_OPTIONS} /out:${_CSHARP_TARGET})
message(STATUS "BUILDING : " ${_CSHARP_TARGET} " : " ${CSHARP_COMPILER} ${CSC_OPTIONS} /out:${_CSHARP_TARGET})
endif ()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_CSHARP_TARGET}
Expand Down Expand Up @@ -362,13 +362,8 @@ function (gdal_build_csharp_sample)
else ()
if (CMAKE_VERBOSE_MAKEFILE)
message(
"BUILDING : "
${_GBCS_OUTPUT}
" : "
${CSHARP_COMPILER}
${CSC_OPTIONS}
/out:${_GBCS_OUTPUT_NATIVE}
${SOURCE_NATIVE})
STATUS
"BUILDING : ${_GBCS_OUTPUT} : ${CSHARP_COMPILER} ${CSC_OPTIONS} /out:${_GBCS_OUTPUT_NATIVE} ${SOURCE_NATIVE}")
endif ()
add_custom_command(
OUTPUT ${OUTPUT_FILENAME}
Expand Down
2 changes: 1 addition & 1 deletion swig/java/build_java_doc.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
message("Building javadoc")
message(STATUS "Building javadoc")

file(GLOB_RECURSE SOURCE_JAVA_FILES RELATIVE "${BUILD_DIR}" "${BUILD_DIR}/org/*.java")

Expand Down
4 changes: 2 additions & 2 deletions swig/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ function (symlink_or_copy source destination)
RESULT res
SYMBOLIC)
if (NOT res EQUAL 0)
message("Copying content of ${source} to ${destination}")
message(STATUS "Copying content of ${source} to ${destination}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${source} ${destination})
endif ()
else ()
if (NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${source} ${destination})
else ()
message("Copying content of ${source} to ${destination}")
message(STATUS "Copying content of ${source} to ${destination}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${source} ${destination})
endif ()
endif ()
Expand Down

0 comments on commit 77a2b03

Please sign in to comment.