mirror of
https://github.com/SFML/SFML.git
synced 2024-12-01 07:41:05 +08:00
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:
parent
78e532215a
commit
b7510fd09e
@ -52,8 +52,8 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
|||||||
set(OPENGL_ES 0)
|
set(OPENGL_ES 0)
|
||||||
|
|
||||||
# detect OS X version. (use '/usr/bin/sw_vers -productVersion' to extract V from '10.V.x'.)
|
# 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)
|
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}")
|
string(REGEX REPLACE "10\\.([0-9]+).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")
|
||||||
if(${MACOSX_VERSION} LESS 7)
|
if(${MACOSX_VERSION} LESS 7)
|
||||||
message(FATAL_ERROR "Unsupported version of OS X: ${MACOSX_VERSION_RAW}")
|
message(FATAL_ERROR "Unsupported version of OS X: ${MACOSX_VERSION_RAW}")
|
||||||
return()
|
return()
|
||||||
|
@ -262,10 +262,10 @@ macro(sfml_add_example target)
|
|||||||
|
|
||||||
# For iOS apps we need the launch screen storyboard,
|
# For iOS apps we need the launch screen storyboard,
|
||||||
# and a custom info.plist to use it
|
# and a custom info.plist to use it
|
||||||
SET(LAUNCH_SCREEN "${CMAKE_SOURCE_DIR}/examples/assets/LaunchScreen.storyboard")
|
set(LAUNCH_SCREEN "${CMAKE_SOURCE_DIR}/examples/assets/LaunchScreen.storyboard")
|
||||||
SET(LOGO "${CMAKE_SOURCE_DIR}/examples/assets/logo.png")
|
set(LOGO "${CMAKE_SOURCE_DIR}/examples/assets/logo.png")
|
||||||
SET(INFO_PLIST "${CMAKE_SOURCE_DIR}/examples/assets/info.plist")
|
set(INFO_PLIST "${CMAKE_SOURCE_DIR}/examples/assets/info.plist")
|
||||||
SET(ICONS "${CMAKE_SOURCE_DIR}/examples/assets/icon.icns")
|
set(ICONS "${CMAKE_SOURCE_DIR}/examples/assets/icon.icns")
|
||||||
add_executable(${target} MACOSX_BUNDLE ${target_input} ${LAUNCH_SCREEN} ${LOGO} ${ICONS})
|
add_executable(${target} MACOSX_BUNDLE ${target_input} ${LAUNCH_SCREEN} ${LOGO} ${ICONS})
|
||||||
set(RESOURCES ${LAUNCH_SCREEN} ${LOGO} ${ICONS})
|
set(RESOURCES ${LAUNCH_SCREEN} ${LOGO} ${ICONS})
|
||||||
set_target_properties(${target} PROPERTIES RESOURCE "${RESOURCES}"
|
set_target_properties(${target} PROPERTIES RESOURCE "${RESOURCES}"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Redistribution and use of this file is allowed according to the terms of the BSD license.
|
# Redistribution and use of this file is allowed according to the terms of the BSD license.
|
||||||
#
|
#
|
||||||
|
|
||||||
FIND_PATH(
|
find_path(
|
||||||
UDEV_INCLUDE_DIR
|
UDEV_INCLUDE_DIR
|
||||||
libudev.h
|
libudev.h
|
||||||
/usr/include
|
/usr/include
|
||||||
@ -17,37 +17,37 @@ FIND_PATH(
|
|||||||
${UDEV_PATH_INCLUDES}
|
${UDEV_PATH_INCLUDES}
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(
|
find_library(
|
||||||
UDEV_LIBRARIES
|
UDEV_LIBRARIES
|
||||||
NAMES udev libudev
|
NAMES udev libudev
|
||||||
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
||||||
${UDEV_PATH_LIB}
|
${UDEV_PATH_LIB}
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
|
if(UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
|
||||||
SET(UDEV_FOUND "YES")
|
set(UDEV_FOUND "YES")
|
||||||
execute_process(COMMAND pkg-config --atleast-version=143 libudev RESULT_VARIABLE UDEV_STABLE)
|
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...
|
# retvale is 0 of the condition is "true" so we need to negate the value...
|
||||||
if (UDEV_STABLE)
|
if(UDEV_STABLE)
|
||||||
set(UDEV_STABLE 0)
|
set(UDEV_STABLE 0)
|
||||||
else (UDEV_STABLE)
|
else()
|
||||||
set(UDEV_STABLE 1)
|
set(UDEV_STABLE 1)
|
||||||
endif (UDEV_STABLE)
|
endif()
|
||||||
message(STATUS "libudev stable: ${UDEV_STABLE}")
|
message(STATUS "libudev stable: ${UDEV_STABLE}")
|
||||||
ENDIF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
|
endif()
|
||||||
|
|
||||||
IF (UDEV_FOUND)
|
if(UDEV_FOUND)
|
||||||
MESSAGE(STATUS "Found UDev: ${UDEV_LIBRARIES}")
|
message(STATUS "Found UDev: ${UDEV_LIBRARIES}")
|
||||||
MESSAGE(STATUS " include: ${UDEV_INCLUDE_DIR}")
|
message(STATUS " include: ${UDEV_INCLUDE_DIR}")
|
||||||
ELSE (UDEV_FOUND)
|
else()
|
||||||
MESSAGE(STATUS "UDev not found.")
|
message(STATUS "UDev not found.")
|
||||||
MESSAGE(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
|
message(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
|
||||||
MESSAGE(STATUS " currently found includes: ${UDEV_INCLUDE_DIR}")
|
message(STATUS " currently found includes: ${UDEV_INCLUDE_DIR}")
|
||||||
MESSAGE(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
|
message(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
|
||||||
MESSAGE(STATUS " currently found libs: ${UDEV_LIBRARIES}")
|
message(STATUS " currently found libs: ${UDEV_LIBRARIES}")
|
||||||
IF (UDev_FIND_REQUIRED)
|
if(UDev_FIND_REQUIRED)
|
||||||
MESSAGE(FATAL_ERROR "Could not find UDev library")
|
message(FATAL_ERROR "Could not find UDev library")
|
||||||
ENDIF (UDev_FIND_REQUIRED)
|
endif()
|
||||||
ENDIF (UDEV_FOUND)
|
endif()
|
||||||
|
|
||||||
mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBRARIES)
|
mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBRARIES)
|
||||||
|
@ -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)
|
target_link_libraries(sfml-test-main PUBLIC SFML::System doctest::doctest)
|
||||||
set_target_warnings(sfml-test-main)
|
set_target_warnings(sfml-test-main)
|
||||||
|
|
||||||
SET(SYSTEM_SRC
|
set(SYSTEM_SRC
|
||||||
System/Angle.cpp
|
System/Angle.cpp
|
||||||
System/Clock.cpp
|
System/Clock.cpp
|
||||||
System/Config.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>
|
EXPECTED_SFML_VERSION_IS_RELEASE=$<IF:$<BOOL:${VERSION_IS_RELEASE}>,true,false>
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(WINDOW_SRC
|
set(WINDOW_SRC
|
||||||
Window/ContextSettings.cpp
|
Window/ContextSettings.cpp
|
||||||
Window/VideoMode.cpp
|
Window/VideoMode.cpp
|
||||||
)
|
)
|
||||||
sfml_add_test(test-sfml-window "${WINDOW_SRC}" SFML::Window)
|
sfml_add_test(test-sfml-window "${WINDOW_SRC}" SFML::Window)
|
||||||
|
|
||||||
SET(GRAPHICS_SRC
|
set(GRAPHICS_SRC
|
||||||
Graphics/BlendMode.cpp
|
Graphics/BlendMode.cpp
|
||||||
Graphics/CircleShape.cpp
|
Graphics/CircleShape.cpp
|
||||||
Graphics/Color.cpp
|
Graphics/Color.cpp
|
||||||
@ -65,13 +65,13 @@ SET(GRAPHICS_SRC
|
|||||||
)
|
)
|
||||||
sfml_add_test(test-sfml-graphics "${GRAPHICS_SRC}" SFML::Graphics)
|
sfml_add_test(test-sfml-graphics "${GRAPHICS_SRC}" SFML::Graphics)
|
||||||
|
|
||||||
SET(NETWORK_SRC
|
set(NETWORK_SRC
|
||||||
Network/IpAddress.cpp
|
Network/IpAddress.cpp
|
||||||
Network/Packet.cpp
|
Network/Packet.cpp
|
||||||
)
|
)
|
||||||
sfml_add_test(test-sfml-network "${NETWORK_SRC}" SFML::Network)
|
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
|
Audio/Dummy.cpp # TODO: Remove when there are real tests
|
||||||
)
|
)
|
||||||
sfml_add_test(test-sfml-audio "${AUDIO_SRC}" SFML::Audio)
|
sfml_add_test(test-sfml-audio "${AUDIO_SRC}" SFML::Audio)
|
||||||
|
Loading…
Reference in New Issue
Block a user