Fix formatting and style

Use all lower_case commands with no space between the command name
and the open parentheses. Don't repeat conditional in else() and
endif() calls.
This commit is contained in:
Chris Thrasher 2022-08-07 00:06:13 -06:00 committed by Lukas Dürrenberger
parent 78e532215a
commit b7510fd09e
4 changed files with 32 additions and 32 deletions

View File

@ -52,8 +52,8 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(OPENGL_ES 0)
# detect OS X version. (use '/usr/bin/sw_vers -productVersion' to extract V from '10.V.x'.)
EXEC_PROGRAM(/usr/bin/sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW)
STRING(REGEX REPLACE "10\\.([0-9]+).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")
exec_program(/usr/bin/sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW)
string(REGEX REPLACE "10\\.([0-9]+).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")
if(${MACOSX_VERSION} LESS 7)
message(FATAL_ERROR "Unsupported version of OS X: ${MACOSX_VERSION_RAW}")
return()

View File

@ -262,10 +262,10 @@ macro(sfml_add_example target)
# For iOS apps we need the launch screen storyboard,
# and a custom info.plist to use it
SET(LAUNCH_SCREEN "${CMAKE_SOURCE_DIR}/examples/assets/LaunchScreen.storyboard")
SET(LOGO "${CMAKE_SOURCE_DIR}/examples/assets/logo.png")
SET(INFO_PLIST "${CMAKE_SOURCE_DIR}/examples/assets/info.plist")
SET(ICONS "${CMAKE_SOURCE_DIR}/examples/assets/icon.icns")
set(LAUNCH_SCREEN "${CMAKE_SOURCE_DIR}/examples/assets/LaunchScreen.storyboard")
set(LOGO "${CMAKE_SOURCE_DIR}/examples/assets/logo.png")
set(INFO_PLIST "${CMAKE_SOURCE_DIR}/examples/assets/info.plist")
set(ICONS "${CMAKE_SOURCE_DIR}/examples/assets/icon.icns")
add_executable(${target} MACOSX_BUNDLE ${target_input} ${LAUNCH_SCREEN} ${LOGO} ${ICONS})
set(RESOURCES ${LAUNCH_SCREEN} ${LOGO} ${ICONS})
set_target_properties(${target} PROPERTIES RESOURCE "${RESOURCES}"

View File

@ -9,7 +9,7 @@
# Redistribution and use of this file is allowed according to the terms of the BSD license.
#
FIND_PATH(
find_path(
UDEV_INCLUDE_DIR
libudev.h
/usr/include
@ -17,37 +17,37 @@ FIND_PATH(
${UDEV_PATH_INCLUDES}
)
FIND_LIBRARY(
find_library(
UDEV_LIBRARIES
NAMES udev libudev
PATHS ${ADDITIONAL_LIBRARY_PATHS}
${UDEV_PATH_LIB}
)
IF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
SET(UDEV_FOUND "YES")
if(UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
set(UDEV_FOUND "YES")
execute_process(COMMAND pkg-config --atleast-version=143 libudev RESULT_VARIABLE UDEV_STABLE)
# retvale is 0 of the condition is "true" so we need to negate the value...
if(UDEV_STABLE)
set(UDEV_STABLE 0)
else (UDEV_STABLE)
else()
set(UDEV_STABLE 1)
endif (UDEV_STABLE)
endif()
message(STATUS "libudev stable: ${UDEV_STABLE}")
ENDIF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
endif()
IF (UDEV_FOUND)
MESSAGE(STATUS "Found UDev: ${UDEV_LIBRARIES}")
MESSAGE(STATUS " include: ${UDEV_INCLUDE_DIR}")
ELSE (UDEV_FOUND)
MESSAGE(STATUS "UDev not found.")
MESSAGE(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
MESSAGE(STATUS " currently found includes: ${UDEV_INCLUDE_DIR}")
MESSAGE(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
MESSAGE(STATUS " currently found libs: ${UDEV_LIBRARIES}")
IF (UDev_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find UDev library")
ENDIF (UDev_FIND_REQUIRED)
ENDIF (UDEV_FOUND)
if(UDEV_FOUND)
message(STATUS "Found UDev: ${UDEV_LIBRARIES}")
message(STATUS " include: ${UDEV_INCLUDE_DIR}")
else()
message(STATUS "UDev not found.")
message(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
message(STATUS " currently found includes: ${UDEV_INCLUDE_DIR}")
message(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
message(STATUS " currently found libs: ${UDEV_LIBRARIES}")
if(UDev_FIND_REQUIRED)
message(FATAL_ERROR "Could not find UDev library")
endif()
endif()
mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBRARIES)

View File

@ -21,7 +21,7 @@ target_compile_definitions(sfml-test-main PUBLIC DOCTEST_CONFIG_REQUIRE_STRINGIF
target_link_libraries(sfml-test-main PUBLIC SFML::System doctest::doctest)
set_target_warnings(sfml-test-main)
SET(SYSTEM_SRC
set(SYSTEM_SRC
System/Angle.cpp
System/Clock.cpp
System/Config.cpp
@ -40,13 +40,13 @@ target_compile_definitions(test-sfml-system PRIVATE
EXPECTED_SFML_VERSION_IS_RELEASE=$<IF:$<BOOL:${VERSION_IS_RELEASE}>,true,false>
)
SET(WINDOW_SRC
set(WINDOW_SRC
Window/ContextSettings.cpp
Window/VideoMode.cpp
)
sfml_add_test(test-sfml-window "${WINDOW_SRC}" SFML::Window)
SET(GRAPHICS_SRC
set(GRAPHICS_SRC
Graphics/BlendMode.cpp
Graphics/CircleShape.cpp
Graphics/Color.cpp
@ -65,13 +65,13 @@ SET(GRAPHICS_SRC
)
sfml_add_test(test-sfml-graphics "${GRAPHICS_SRC}" SFML::Graphics)
SET(NETWORK_SRC
set(NETWORK_SRC
Network/IpAddress.cpp
Network/Packet.cpp
)
sfml_add_test(test-sfml-network "${NETWORK_SRC}" SFML::Network)
SET(AUDIO_SRC
set(AUDIO_SRC
Audio/Dummy.cpp # TODO: Remove when there are real tests
)
sfml_add_test(test-sfml-audio "${AUDIO_SRC}" SFML::Audio)