An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 28b8e6c2 authored by Hans Johnson's avatar Hans Johnson Committed by Hans Johnson
Browse files

STYLE: Convert CMake-language commands to lower case

Ancient CMake versions required upper-case commands.  Later command names
became case-insensitive.  Now the preferred style is lower-case.
parent 81d1e737
This diff is collapsed.
MESSAGE("*** This message is generated by message inside a file that is included in DartTestfile.txt ***")
message("*** This message is generated by message inside a file that is included in DartTestfile.txt ***")
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing#kwsys for details.
SET(KWSYS_PLATFORM_TEST_FILE_C kwsysPlatformTestsC.c)
SET(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx)
set(KWSYS_PLATFORM_TEST_FILE_C kwsysPlatformTestsC.c)
set(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx)
MACRO(KWSYS_PLATFORM_TEST lang var description invert)
IF(NOT DEFINED ${var}_COMPILED)
MESSAGE(STATUS "${description}")
macro(KWSYS_PLATFORM_TEST lang var description invert)
if(NOT DEFINED ${var}_COMPILED)
message(STATUS "${description}")
set(maybe_cxx_standard "")
if(CMAKE_VERSION VERSION_LESS 3.8 AND CMAKE_CXX_STANDARD)
set(maybe_cxx_standard "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}")
endif()
TRY_COMPILE(${var}_COMPILED
try_compile(${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}}
COMPILE_DEFINITIONS -DTEST_${var} ${KWSYS_PLATFORM_TEST_DEFINES} ${KWSYS_PLATFORM_TEST_EXTRA_FLAGS}
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=${KWSYS_PLATFORM_TEST_LINK_LIBRARIES}"
${maybe_cxx_standard}
OUTPUT_VARIABLE OUTPUT)
IF(${var}_COMPILED)
FILE(APPEND
if(${var}_COMPILED)
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"${description} compiled with the following output:\n${OUTPUT}\n\n")
ELSE()
FILE(APPEND
else()
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${description} failed to compile with the following output:\n${OUTPUT}\n\n")
ENDIF()
IF(${invert} MATCHES INVERT)
IF(${var}_COMPILED)
MESSAGE(STATUS "${description} - no")
ELSE()
MESSAGE(STATUS "${description} - yes")
ENDIF()
ELSE()
IF(${var}_COMPILED)
MESSAGE(STATUS "${description} - yes")
ELSE()
MESSAGE(STATUS "${description} - no")
ENDIF()
ENDIF()
ENDIF()
IF(${invert} MATCHES INVERT)
IF(${var}_COMPILED)
SET(${var} 0)
ELSE()
SET(${var} 1)
ENDIF()
ELSE()
IF(${var}_COMPILED)
SET(${var} 1)
ELSE()
SET(${var} 0)
ENDIF()
ENDIF()
ENDMACRO()
endif()
if(${invert} MATCHES INVERT)
if(${var}_COMPILED)
message(STATUS "${description} - no")
else()
message(STATUS "${description} - yes")
endif()
else()
if(${var}_COMPILED)
message(STATUS "${description} - yes")
else()
message(STATUS "${description} - no")
endif()
endif()
endif()
if(${invert} MATCHES INVERT)
if(${var}_COMPILED)
set(${var} 0)
else()
set(${var} 1)
endif()
else()
if(${var}_COMPILED)
set(${var} 1)
else()
set(${var} 0)
endif()
endif()
endmacro()
MACRO(KWSYS_PLATFORM_TEST_RUN lang var description invert)
IF(NOT DEFINED ${var})
MESSAGE(STATUS "${description}")
TRY_RUN(${var} ${var}_COMPILED
macro(KWSYS_PLATFORM_TEST_RUN lang var description invert)
if(NOT DEFINED ${var})
message(STATUS "${description}")
try_run(${var} ${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}}
COMPILE_DEFINITIONS -DTEST_${var} ${KWSYS_PLATFORM_TEST_DEFINES} ${KWSYS_PLATFORM_TEST_EXTRA_FLAGS}
OUTPUT_VARIABLE OUTPUT)
# Note that ${var} will be a 0 return value on success.
IF(${var}_COMPILED)
IF(${var})
FILE(APPEND
if(${var}_COMPILED)
if(${var})
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${description} compiled but failed to run with the following output:\n${OUTPUT}\n\n")
ELSE()
FILE(APPEND
else()
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"${description} compiled and ran with the following output:\n${OUTPUT}\n\n")
ENDIF()
ELSE()
FILE(APPEND
endif()
else()
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${description} failed to compile with the following output:\n${OUTPUT}\n\n")
SET(${var} -1 CACHE INTERNAL "${description} failed to compile.")
ENDIF()
set(${var} -1 CACHE INTERNAL "${description} failed to compile.")
endif()
IF(${invert} MATCHES INVERT)
IF(${var}_COMPILED)
IF(${var})
MESSAGE(STATUS "${description} - yes")
ELSE()
MESSAGE(STATUS "${description} - no")
ENDIF()
ELSE()
MESSAGE(STATUS "${description} - failed to compile")
ENDIF()
ELSE()
IF(${var}_COMPILED)
IF(${var})
MESSAGE(STATUS "${description} - no")
ELSE()
MESSAGE(STATUS "${description} - yes")
ENDIF()
ELSE()
MESSAGE(STATUS "${description} - failed to compile")
ENDIF()
ENDIF()
ENDIF()
if(${invert} MATCHES INVERT)
if(${var}_COMPILED)
if(${var})
message(STATUS "${description} - yes")
else()
message(STATUS "${description} - no")
endif()
else()
message(STATUS "${description} - failed to compile")
endif()
else()
if(${var}_COMPILED)
if(${var})
message(STATUS "${description} - no")
else()
message(STATUS "${description} - yes")
endif()
else()
message(STATUS "${description} - failed to compile")
endif()
endif()
endif()
IF(${invert} MATCHES INVERT)
IF(${var}_COMPILED)
IF(${var})
SET(${var} 1)
ELSE()
SET(${var} 0)
ENDIF()
ELSE()
SET(${var} 1)
ENDIF()
ELSE()
IF(${var}_COMPILED)
IF(${var})
SET(${var} 0)
ELSE()
SET(${var} 1)
ENDIF()
ELSE()
SET(${var} 0)
ENDIF()
ENDIF()
ENDMACRO()
if(${invert} MATCHES INVERT)
if(${var}_COMPILED)
if(${var})
set(${var} 1)
else()
set(${var} 0)
endif()
else()
set(${var} 1)
endif()
else()
if(${var}_COMPILED)
if(${var})
set(${var} 0)
else()
set(${var} 1)
endif()
else()
set(${var} 0)
endif()
endif()
endmacro()
MACRO(KWSYS_PLATFORM_C_TEST var description invert)
SET(KWSYS_PLATFORM_TEST_DEFINES ${KWSYS_PLATFORM_C_TEST_DEFINES})
SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS ${KWSYS_PLATFORM_C_TEST_EXTRA_FLAGS})
macro(KWSYS_PLATFORM_C_TEST var description invert)
set(KWSYS_PLATFORM_TEST_DEFINES ${KWSYS_PLATFORM_C_TEST_DEFINES})
set(KWSYS_PLATFORM_TEST_EXTRA_FLAGS ${KWSYS_PLATFORM_C_TEST_EXTRA_FLAGS})
KWSYS_PLATFORM_TEST(C "${var}" "${description}" "${invert}")
SET(KWSYS_PLATFORM_TEST_DEFINES)
SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS)
ENDMACRO()
set(KWSYS_PLATFORM_TEST_DEFINES)
set(KWSYS_PLATFORM_TEST_EXTRA_FLAGS)
endmacro()
MACRO(KWSYS_PLATFORM_C_TEST_RUN var description invert)
SET(KWSYS_PLATFORM_TEST_DEFINES ${KWSYS_PLATFORM_C_TEST_DEFINES})
SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS ${KWSYS_PLATFORM_C_TEST_EXTRA_FLAGS})
macro(KWSYS_PLATFORM_C_TEST_RUN var description invert)
set(KWSYS_PLATFORM_TEST_DEFINES ${KWSYS_PLATFORM_C_TEST_DEFINES})
set(KWSYS_PLATFORM_TEST_EXTRA_FLAGS ${KWSYS_PLATFORM_C_TEST_EXTRA_FLAGS})
KWSYS_PLATFORM_TEST_RUN(C "${var}" "${description}" "${invert}")
SET(KWSYS_PLATFORM_TEST_DEFINES)
SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS)
ENDMACRO()
set(KWSYS_PLATFORM_TEST_DEFINES)
set(KWSYS_PLATFORM_TEST_EXTRA_FLAGS)
endmacro()
MACRO(KWSYS_PLATFORM_CXX_TEST var description invert)
SET(KWSYS_PLATFORM_TEST_DEFINES ${KWSYS_PLATFORM_CXX_TEST_DEFINES})
SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS ${KWSYS_PLATFORM_CXX_TEST_EXTRA_FLAGS})
SET(KWSYS_PLATFORM_TEST_LINK_LIBRARIES ${KWSYS_PLATFORM_CXX_TEST_LINK_LIBRARIES})
macro(KWSYS_PLATFORM_CXX_TEST var description invert)
set(KWSYS_PLATFORM_TEST_DEFINES ${KWSYS_PLATFORM_CXX_TEST_DEFINES})
set(KWSYS_PLATFORM_TEST_EXTRA_FLAGS ${KWSYS_PLATFORM_CXX_TEST_EXTRA_FLAGS})
set(KWSYS_PLATFORM_TEST_LINK_LIBRARIES ${KWSYS_PLATFORM_CXX_TEST_LINK_LIBRARIES})
KWSYS_PLATFORM_TEST(CXX "${var}" "${description}" "${invert}")
SET(KWSYS_PLATFORM_TEST_DEFINES)
SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS)
SET(KWSYS_PLATFORM_TEST_LINK_LIBRARIES)
ENDMACRO()
set(KWSYS_PLATFORM_TEST_DEFINES)
set(KWSYS_PLATFORM_TEST_EXTRA_FLAGS)
set(KWSYS_PLATFORM_TEST_LINK_LIBRARIES)
endmacro()
MACRO(KWSYS_PLATFORM_CXX_TEST_RUN var description invert)
SET(KWSYS_PLATFORM_TEST_DEFINES ${KWSYS_PLATFORM_CXX_TEST_DEFINES})
SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS ${KWSYS_PLATFORM_CXX_TEST_EXTRA_FLAGS})
macro(KWSYS_PLATFORM_CXX_TEST_RUN var description invert)
set(KWSYS_PLATFORM_TEST_DEFINES ${KWSYS_PLATFORM_CXX_TEST_DEFINES})
set(KWSYS_PLATFORM_TEST_EXTRA_FLAGS ${KWSYS_PLATFORM_CXX_TEST_EXTRA_FLAGS})
KWSYS_PLATFORM_TEST_RUN(CXX "${var}" "${description}" "${invert}")
SET(KWSYS_PLATFORM_TEST_DEFINES)
SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS)
ENDMACRO()
set(KWSYS_PLATFORM_TEST_DEFINES)
set(KWSYS_PLATFORM_TEST_EXTRA_FLAGS)
endmacro()
#-----------------------------------------------------------------------------
# KWSYS_PLATFORM_INFO_TEST(lang var description)
#
# Compile test named by ${var} and store INFO strings extracted from binary.
MACRO(KWSYS_PLATFORM_INFO_TEST lang var description)
macro(KWSYS_PLATFORM_INFO_TEST lang var description)
# We can implement this macro on CMake 2.6 and above.
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6)
SET(${var} "")
ELSE()
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6)
set(${var} "")
else()
# Choose a location for the result binary.
SET(KWSYS_PLATFORM_INFO_FILE
set(KWSYS_PLATFORM_INFO_FILE
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${var}.bin)
# Compile the test binary.
IF(NOT EXISTS ${KWSYS_PLATFORM_INFO_FILE})
MESSAGE(STATUS "${description}")
TRY_COMPILE(${var}_COMPILED
if(NOT EXISTS ${KWSYS_PLATFORM_INFO_FILE})
message(STATUS "${description}")
try_compile(${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}}
COMPILE_DEFINITIONS -DTEST_${var}
......@@ -188,29 +188,29 @@ MACRO(KWSYS_PLATFORM_INFO_TEST lang var description)
OUTPUT_VARIABLE OUTPUT
COPY_FILE ${KWSYS_PLATFORM_INFO_FILE}
)
IF(${var}_COMPILED)
FILE(APPEND
if(${var}_COMPILED)
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"${description} compiled with the following output:\n${OUTPUT}\n\n")
ELSE()
FILE(APPEND
else()
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${description} failed to compile with the following output:\n${OUTPUT}\n\n")
ENDIF()
IF(${var}_COMPILED)
MESSAGE(STATUS "${description} - compiled")
ELSE()
MESSAGE(STATUS "${description} - failed")
ENDIF()
ENDIF()
endif()
if(${var}_COMPILED)
message(STATUS "${description} - compiled")
else()
message(STATUS "${description} - failed")
endif()
endif()
# Parse info strings out of the compiled binary.
IF(${var}_COMPILED)
FILE(STRINGS ${KWSYS_PLATFORM_INFO_FILE} ${var} REGEX "INFO:[A-Za-z0-9]+\\[[^]]*\\]")
ELSE()
SET(${var} "")
ENDIF()
if(${var}_COMPILED)
file(STRINGS ${KWSYS_PLATFORM_INFO_FILE} ${var} REGEX "INFO:[A-Za-z0-9]+\\[[^]]*\\]")
else()
set(${var} "")
endif()
SET(KWSYS_PLATFORM_INFO_FILE)
ENDIF()
ENDMACRO()
set(KWSYS_PLATFORM_INFO_FILE)
endif()
endmacro()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment