Apply cmake-format
This commit is contained in:
parent
b48b2f5c06
commit
6c9a956a4f
|
@ -284,7 +284,10 @@ function (use_standard_filesystem)
|
||||||
set(CMAKE_REQUIRED_FLAGS -std=c++17)
|
set(CMAKE_REQUIRED_FLAGS -std=c++17)
|
||||||
set(REQUIRED_LIBRARY FAILED)
|
set(REQUIRED_LIBRARY FAILED)
|
||||||
set(INDEX 0)
|
set(INDEX 0)
|
||||||
foreach (LIBRARY "" "stdc++fs" "c++fs")
|
foreach (LIBRARY
|
||||||
|
""
|
||||||
|
"stdc++fs"
|
||||||
|
"c++fs")
|
||||||
if (NOT LIBRARY STREQUAL "")
|
if (NOT LIBRARY STREQUAL "")
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${DEFAULT_REQUIRED_LIBRARIES} -l${LIBRARY})
|
set(CMAKE_REQUIRED_LIBRARIES ${DEFAULT_REQUIRED_LIBRARIES} -l${LIBRARY})
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -298,7 +301,10 @@ function (use_standard_filesystem)
|
||||||
|
|
||||||
# handle error
|
# handle error
|
||||||
if (REQUIRED_LIBRARY STREQUAL "FAILED")
|
if (REQUIRED_LIBRARY STREQUAL "FAILED")
|
||||||
message(FATAL_ERROR "Unable to compile a simple std::filesystem example. A compiler supporting C++17 is required to build this project.")
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"Unable to compile a simple std::filesystem example. A compiler supporting C++17 is required to build this project."
|
||||||
|
)
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -308,8 +314,8 @@ function (use_standard_filesystem)
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# prefer the static version of the library because the ABI might not be stable
|
# prefer the static version of the library because the ABI might not be stable note: stdc++fs seems to be only available
|
||||||
# note: stdc++fs seems to be only available as static lib anyways
|
# as static lib anyways
|
||||||
configure_static_library_suffixes()
|
configure_static_library_suffixes()
|
||||||
set(USED_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
set(USED_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
find_library(STANDARD_FILE_SYSTEM_LIBRARY "${REQUIRED_LIBRARY}")
|
find_library(STANDARD_FILE_SYSTEM_LIBRARY "${REQUIRED_LIBRARY}")
|
||||||
|
@ -319,7 +325,9 @@ function (use_standard_filesystem)
|
||||||
set(STANDARD_FILE_SYSTEM_LIBRARY "-l${REQUIRED_LIBRARY}")
|
set(STANDARD_FILE_SYSTEM_LIBRARY "-l${REQUIRED_LIBRARY}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
message(STATUS "Linking ${META_PROJECT_NAME} against library \"${STANDARD_FILE_SYSTEM_LIBRARY}\" for std::filesystem support.")
|
message(
|
||||||
|
STATUS
|
||||||
|
"Linking ${META_PROJECT_NAME} against library \"${STANDARD_FILE_SYSTEM_LIBRARY}\" for std::filesystem support.")
|
||||||
set("${ARGS_LIBRARIES_VARIABLE}" "${${ARGS_LIBRARIES_VARIABLE}};${STANDARD_FILE_SYSTEM_LIBRARY}" PARENT_SCOPE)
|
set("${ARGS_LIBRARIES_VARIABLE}" "${${ARGS_LIBRARIES_VARIABLE}};${STANDARD_FILE_SYSTEM_LIBRARY}" PARENT_SCOPE)
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,11 @@ if (NOT META_NO_TIDY AND CMAKE_FORMAT_ENABLED AND FORMATABLE_FILES_CMAKE)
|
||||||
message(FATAL_ERROR "Unable to add tidy target; cmake-format not found")
|
message(FATAL_ERROR "Unable to add tidy target; cmake-format not found")
|
||||||
endif ()
|
endif ()
|
||||||
if (NOT META_CMAKE_FORMAT_OPTIONS)
|
if (NOT META_CMAKE_FORMAT_OPTIONS)
|
||||||
set(META_CMAKE_FORMAT_OPTIONS --tab-size=4 --separate-ctrl-name-with-space=True --line-width=125 --autosort=False)
|
set(META_CMAKE_FORMAT_OPTIONS
|
||||||
|
--tab-size=4
|
||||||
|
--separate-ctrl-name-with-space=True
|
||||||
|
--line-width=125
|
||||||
|
--autosort=False)
|
||||||
endif ()
|
endif ()
|
||||||
add_custom_target("${META_TARGET_NAME}_cmake_tidy"
|
add_custom_target("${META_TARGET_NAME}_cmake_tidy"
|
||||||
COMMAND "${CMAKE_FORMAT_BIN}" --in-place ${META_CMAKE_FORMAT_OPTIONS} ${FORMATABLE_FILES_CMAKE}
|
COMMAND "${CMAKE_FORMAT_BIN}" --in-place ${META_CMAKE_FORMAT_OPTIONS} ${FORMATABLE_FILES_CMAKE}
|
||||||
|
|
|
@ -452,7 +452,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
|
||||||
|
|
||||||
# add targets to ease creating mingw-w64 packages under Arch Linux
|
# add targets to ease creating mingw-w64 packages under Arch Linux
|
||||||
if (MINGW)
|
if (MINGW)
|
||||||
option(ENABLE_TARGETS_FOR_MINGW_CROSS_PACKAGING "enable targets to ease creating mingw-w64 packages under Arch Linux" OFF)
|
option(ENABLE_TARGETS_FOR_MINGW_CROSS_PACKAGING "enable targets to ease creating mingw-w64 packages under Arch Linux"
|
||||||
|
OFF)
|
||||||
else ()
|
else ()
|
||||||
set(ENABLE_TARGETS_FOR_MINGW_CROSS_PACKAGING OFF)
|
set(ENABLE_TARGETS_FOR_MINGW_CROSS_PACKAGING OFF)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
Loading…
Reference in New Issue