Fixed cmake 'message' for multiple arguments (#3901)

This commit is contained in:
Ilya Lavrenov 2021-01-19 15:35:31 +03:00 committed by GitHub
parent 4f5230bb03
commit 7e54cdba15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View File

@ -11,12 +11,17 @@ if(UNIX AND ENABLE_ERROR_HIGHLIGHT)
list(GET ARGV 0 MessageType)
list(REMOVE_AT ARGV 0)
foreach(arg IN LISTS ARGV)
set(_msg "${_msg}${arg}")
endforeach()
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
_message(${MessageType} "${RED}${ARGV}${RESET}")
_message(${MessageType} "${RED}${_msg}${RESET}")
elseif(MessageType STREQUAL WARNING)
_message(${MessageType} "${YELLOW}${ARGV}${RESET}")
_message(${MessageType} "${YELLOW}${_msg}${RESET}")
else()
_message(${MessageType} "${ARGV}")
_message(${MessageType} "${_msg}")
endif()
endfunction()
endif()

View File

@ -2,9 +2,11 @@
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET fluid_preproc_tests)
find_package(OpenCV COMPONENTS gapi QUIET)
if(NOT OpenCV_FOUND)
message(WARNING "No suitable OpenCV version detected, " ${TARGET_NAME} " skipped")
message(WARNING "No suitable OpenCV version detected, ${TARGET} skipped")
return()
endif()
@ -13,7 +15,6 @@ add_subdirectory(fluid_test_computations)
file(GLOB SOURCES *.cpp common/*.cpp cpu/*.cpp)
file(GLOB HEADERS *.hpp common/*.hpp cpu/*.hpp)
set(TARGET fluid_preproc_tests)
add_executable(${TARGET} ${SOURCES} ${HEADERS})
target_include_directories(${TARGET} PRIVATE

View File

@ -37,7 +37,7 @@ find_package(OpenCV COMPONENTS imgcodecs imgproc QUIET)
if(OpenCV_FOUND)
target_compile_definitions(${TARGET_NAME} PUBLIC USE_OPENCV)
else()
message(WARNING "No suitable OpenCV version detected, pre-processing tests are skipped in " ${TARGET_NAME})
message(WARNING "No suitable OpenCV version detected, pre-processing tests are skipped in ${TARGET_NAME}")
endif()
target_include_directories(${TARGET_NAME} PUBLIC