From a6bb734f49ab221add4314946127af0832e63dbc Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Mon, 18 May 2020 19:33:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=9E=D0=A1=20=D0=AD=D0=BB=D1=8C=D0=B1=D1=80?= =?UTF-8?q?=D1=83=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCompilerFeaturesHPPGenerate.cmake | 44 ++++++++++++++------------ 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/CMLibCompilerFeaturesHPPGenerate.cmake b/CMLibCompilerFeaturesHPPGenerate.cmake index 462cb4a..175e35f 100644 --- a/CMLibCompilerFeaturesHPPGenerate.cmake +++ b/CMLibCompilerFeaturesHPPGenerate.cmake @@ -1,23 +1,25 @@ -include(WriteCompilerDetectionHeader) +if(${CMAKE_VERSION} VERSION_GREATER "3.6.0") + include(WriteCompilerDetectionHeader) -set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/include/compiler_features.hpp) -if(CMLIB_GENERATED_HEADERS_PATH) - set(OUTPUT_FILE ${CMLIB_GENERATED_HEADERS_PATH}/compiler_features.hpp) + set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/include/compiler_features.hpp) + if(CMLIB_GENERATED_HEADERS_PATH) + set(OUTPUT_FILE ${CMLIB_GENERATED_HEADERS_PATH}/compiler_features.hpp) + endif() + + write_compiler_detection_header( + FILE ${OUTPUT_FILE} + PREFIX ${CMLIB_PROJECT_NAME_CANONICAL} + COMPILERS GNU Clang MSVC Intel + FEATURES + cxx_nullptr + cxx_override + cxx_alignas + cxx_alignof + cxx_attributes + cxx_auto_type + cxx_constexpr + cxx_digit_separators + cxx_range_for) + + unset(OUTPUT_FILE) endif() - -write_compiler_detection_header( - FILE ${OUTPUT_FILE} - PREFIX ${CMLIB_PROJECT_NAME_CANONICAL} - COMPILERS GNU Clang MSVC Intel - FEATURES - cxx_nullptr - cxx_override - cxx_alignas - cxx_alignof - cxx_attributes - cxx_auto_type - cxx_constexpr - cxx_digit_separators - cxx_range_for) - -unset(OUTPUT_FILE)