CMake: quiet noisy messages on every run

Printing that a library is found every time CMake runs isn't helpful.
Restrict these messages for the first execution so messages are limited
to information developers may need to know such as features being
disabled because of incompatible configurations.
This commit is contained in:
Campbell Barton 2023-10-07 18:20:30 +11:00
parent 4b3e7b3928
commit b434d40dbf
5 changed files with 31 additions and 17 deletions

View File

@ -1366,23 +1366,27 @@ if(WITH_CPU_SIMD)
endif()
endif()
endif()
endif()
# Print instructions used
if(SUPPORT_NEON_BUILD)
if(SSE2NEON_FOUND)
message(STATUS "Neon SIMD instructions enabled")
# Print instructions used on first run.
if(FIRST_RUN)
if(WITH_CPU_SIMD)
if(SUPPORT_NEON_BUILD)
if(SSE2NEON_FOUND)
message(STATUS "Neon SIMD instructions enabled")
else()
message(STATUS "Neon SIMD instructions detected but unused, requires sse2neon")
endif()
elseif(SUPPORT_SSE2_BUILD)
message(STATUS "SSE2 SIMD instructions enabled")
elseif(SUPPORT_SSE_BUILD)
message(STATUS "SSE SIMD instructions enabled")
else()
message(STATUS "Neon SIMD instructions detected but unused, requires sse2neon")
message(STATUS "No SIMD instructions detected")
endif()
elseif(SUPPORT_SSE2_BUILD)
message(STATUS "SSE2 SIMD instructions enabled")
elseif(SUPPORT_SSE_BUILD)
message(STATUS "SSE SIMD instructions enabled")
else()
message(STATUS "No SIMD instructions detected")
message(STATUS "SIMD instructions disabled")
endif()
else()
message(STATUS "SIMD instructions disabled")
endif()
# set the endian define

View File

@ -54,7 +54,9 @@ if(NOT DEFINED LIBDIR)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin_${CMAKE_OSX_ARCHITECTURES})
endif()
else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
if(FIRST_RUN)
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
endif(()
endif()
if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")

View File

@ -50,7 +50,9 @@ endif()
set(WITH_STATIC_LIBS_INIT ${WITH_STATIC_LIBS})
if(DEFINED LIBDIR)
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
if(FIRST_RUN)
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
endif()
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
@ -549,7 +551,9 @@ if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
if(openpgl_FOUND)
get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "Found OpenPGL: ${OPENPGL_LIBRARIES}")
if(FIRST_RUN)
message(STATUS "Found OpenPGL: ${OPENPGL_LIBRARIES}")
endif()
else()
set(WITH_CYCLES_PATH_GUIDING OFF)
message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")

View File

@ -278,7 +278,9 @@ if(NOT DEFINED LIBDIR)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
endif()
else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
if(FIRST_RUN)
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
endif()
endif()
if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. Please run `make update` in the blender source folder to obtain them.")

View File

@ -27,7 +27,9 @@ endif()
# To suit different needs, the user can pass `-DTEST_PYTHON_EXE=/path/to/python` to CMake.
if(NOT TEST_PYTHON_EXE)
set(TEST_PYTHON_EXE ${PYTHON_EXECUTABLE})
message(STATUS "Tests: Using Python executable: ${TEST_PYTHON_EXE}")
if(FIRST_RUN)
message(STATUS "Tests: Using Python executable: ${TEST_PYTHON_EXE}")
endif()
elseif(NOT EXISTS ${TEST_PYTHON_EXE})
message(FATAL_ERROR "Tests: TEST_PYTHON_EXE ${TEST_PYTHON_EXE} does not exist")
endif()