mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Revert CMake changes
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.8...3.28)
|
cmake_minimum_required(VERSION 3.8...3.26)
|
||||||
|
|
||||||
# Fallback for using newer policies on CMake <3.12.
|
# Fallback for using newer policies on CMake <3.12.
|
||||||
if (${CMAKE_VERSION} VERSION_LESS 3.12)
|
if (${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||||
@ -26,7 +26,7 @@ endfunction()
|
|||||||
|
|
||||||
# DEPRECATED! Should be merged into add_module_library.
|
# DEPRECATED! Should be merged into add_module_library.
|
||||||
function(enable_module target)
|
function(enable_module target)
|
||||||
if (MSVC AND CMAKE_VERSION VERSION_LESS 3.28)
|
if (MSVC)
|
||||||
set(BMI ${CMAKE_CURRENT_BINARY_DIR}/${target}.ifc)
|
set(BMI ${CMAKE_CURRENT_BINARY_DIR}/${target}.ifc)
|
||||||
target_compile_options(${target}
|
target_compile_options(${target}
|
||||||
PRIVATE /interface /ifcOutput ${BMI}
|
PRIVATE /interface /ifcOutput ${BMI}
|
||||||
@ -65,7 +65,7 @@ function(add_module_library name)
|
|||||||
# `std` is affected by CMake options and may be higher than C++20.
|
# `std` is affected by CMake options and may be higher than C++20.
|
||||||
get_target_property(std ${name} CXX_STANDARD)
|
get_target_property(std ${name} CXX_STANDARD)
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_VERSION VERSION_LESS 3.28)
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
set(pcms)
|
set(pcms)
|
||||||
foreach (src ${sources})
|
foreach (src ${sources})
|
||||||
get_filename_component(pcm ${src} NAME_WE)
|
get_filename_component(pcm ${src} NAME_WE)
|
||||||
@ -103,12 +103,7 @@ function(add_module_library name)
|
|||||||
DEPENDS ${pcm})
|
DEPENDS ${pcm})
|
||||||
endforeach ()
|
endforeach ()
|
||||||
endif ()
|
endif ()
|
||||||
if (CMAKE_VERSION VERSION_LESS 3.28)
|
target_sources(${name} PRIVATE ${sources})
|
||||||
target_sources(${name} PRIVATE ${sources})
|
|
||||||
else ()
|
|
||||||
target_sources(${name} PUBLIC FILE_SET fmt_module TYPE CXX_MODULES
|
|
||||||
FILES ${sources})
|
|
||||||
endif ()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
include(CMakeParseArguments)
|
include(CMakeParseArguments)
|
||||||
@ -398,16 +393,8 @@ if (FMT_INSTALL)
|
|||||||
LIBRARY DESTINATION ${FMT_LIB_DIR}
|
LIBRARY DESTINATION ${FMT_LIB_DIR}
|
||||||
ARCHIVE DESTINATION ${FMT_LIB_DIR}
|
ARCHIVE DESTINATION ${FMT_LIB_DIR}
|
||||||
PUBLIC_HEADER DESTINATION "${FMT_INC_DIR}/fmt"
|
PUBLIC_HEADER DESTINATION "${FMT_INC_DIR}/fmt"
|
||||||
FILE_SET fmt_module DESTINATION "${FMT_LIB_DIR}/cxx/miu"
|
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
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 ()
|
|
||||||
|
|
||||||
# Use a namespace because CMake provides better diagnostics for namespaced
|
# Use a namespace because CMake provides better diagnostics for namespaced
|
||||||
# imported targets.
|
# imported targets.
|
||||||
export(TARGETS ${INSTALL_TARGETS} NAMESPACE fmt::
|
export(TARGETS ${INSTALL_TARGETS} NAMESPACE fmt::
|
||||||
|
Reference in New Issue
Block a user