Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compile features for cmake 3.8+ #1103

Merged
merged 2 commits into from
Apr 7, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ if (FMT_PEDANTIC)
target_compile_options(fmt PRIVATE ${PEDANTIC_COMPILE_FLAGS})
endif ()

if (NOT ${CMAKE_VERSION} VERSION_LESS 3.8)
target_compile_features(fmt INTERFACE cxx_std_11)
Lectem marked this conversation as resolved.
Show resolved Hide resolved
endif ()


Lectem marked this conversation as resolved.
Show resolved Hide resolved
target_include_directories(fmt PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
Expand All @@ -180,6 +185,10 @@ add_library(fmt::fmt-header-only ALIAS fmt-header-only)

target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1)

if (NOT ${CMAKE_VERSION} VERSION_LESS 3.8)
target_compile_features(fmt-header-only INTERFACE cxx_std_11)
endif ()

target_include_directories(fmt-header-only INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
Expand Down