From ec628561c2f7938a4bf9af40116eabe23c098ff3 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 13 Nov 2023 06:41:28 -1000 Subject: [PATCH] Fix formatting --- CMakeLists.txt | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9605cd59..e6467f6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.8...3.28) # Fallback for using newer policies on CMake <3.12. -if(${CMAKE_VERSION} VERSION_LESS 3.12) +if (${CMAKE_VERSION} VERSION_LESS 3.12) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) -endif() +endif () # Determine if fmt is built as a subproject (using add_subdirectory) # or if it is the master project. @@ -103,11 +103,12 @@ function(add_module_library name) DEPENDS ${pcm}) endforeach () endif () - if(CMAKE_VERSION VERSION_LESS 3.28) + if (CMAKE_VERSION VERSION_LESS 3.28) target_sources(${name} PRIVATE ${sources}) - else() - target_sources(${name} PUBLIC FILE_SET fmt_module TYPE CXX_MODULES FILES ${sources}) - endif() + else () + target_sources(${name} PUBLIC FILE_SET fmt_module TYPE CXX_MODULES + FILES ${sources}) + endif () endfunction() include(CMakeParseArguments) @@ -166,10 +167,10 @@ set(FMT_SYSTEM_HEADERS_ATTRIBUTE "") if (FMT_SYSTEM_HEADERS) set(FMT_SYSTEM_HEADERS_ATTRIBUTE SYSTEM) endif () -if(CMAKE_SYSTEM_NAME STREQUAL "MSDOS") +if (CMAKE_SYSTEM_NAME STREQUAL "MSDOS") set(FMT_TEST OFF) message(STATUS "MSDOS is incompatible with gtest") -endif() +endif () # Get version from core.h file(READ include/fmt/core.h core_h) @@ -338,7 +339,7 @@ if (BUILD_SHARED_LIBS) endif () if (FMT_SAFE_DURATION_CAST) target_compile_definitions(fmt PUBLIC FMT_SAFE_DURATION_CAST) -endif() +endif () add_library(fmt-header-only INTERFACE) add_library(fmt::fmt-header-only ALIAS fmt-header-only) @@ -346,7 +347,8 @@ add_library(fmt::fmt-header-only ALIAS fmt-header-only) target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1) target_compile_features(fmt-header-only INTERFACE cxx_std_11) -target_include_directories(fmt-header-only ${FMT_SYSTEM_HEADERS_ATTRIBUTE} INTERFACE +target_include_directories(fmt-header-only + ${FMT_SYSTEM_HEADERS_ATTRIBUTE} INTERFACE $ $) @@ -399,10 +401,12 @@ if (FMT_INSTALL) FILE_SET fmt_module DESTINATION "${FMT_LIB_DIR}/cxx/miu" RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - if(FMT_MODULE AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.28) - #Install format.cc and os.cc which are #included by the fmt.cc module interface file - install(FILES src/format.cc src/os.cc DESTINATION "${FMT_LIB_DIR}/cxx/miu/src") - endif() + if (FMT_MODULE AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.28) + # Install format.cc and os.cc which are included by the fmt.cc module + # interface file. + install(FILES src/format.cc src/os.cc + DESTINATION "${FMT_LIB_DIR}/cxx/miu/src") + endif () # Use a namespace because CMake provides better diagnostics for namespaced # imported targets.