diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index eea2f5dd..eff5653d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,15 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) "MinSizeRel" "RelWithDebInfo") endif() +if ( CMAKE_VERSION VERSION_LESS "3.1" ) + CHECK_CXX_COMPILER_FLAG("-std=c++11" STD_FLAG_SUPPORTED) + if ( STD_FLAG_SUPPORTED ) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif ( STD_FLAG_SUPPORTED ) +else ( CMAKE_VERSION VERSION_LESS "3.1" ) + set(CMAKE_CXX_STANDARD 11) +endif ( CMAKE_VERSION VERSION_LESS "3.1" ) + find_package(Qt5 5.2.1 REQUIRED Network Gui) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) @@ -26,11 +35,11 @@ message( STATUS ) message( STATUS "=============================================================================" ) message( STATUS " libqmatrixclient Build Information" ) message( STATUS "=============================================================================" ) -message( STATUS "Building with: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) if (CMAKE_BUILD_TYPE) message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") endif(CMAKE_BUILD_TYPE) -message( STATUS "Building with Qt ${Qt5_VERSION} at: ${Qt5_Prefix}" ) +message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) +message( STATUS "Using Qt ${Qt5_VERSION} at: ${Qt5_Prefix}" ) message( STATUS "=============================================================================" ) message( STATUS ) @@ -70,20 +79,4 @@ add_library(qmatrixclient ${libqmatrixclient_SRCS}) set_property(TARGET qmatrixclient PROPERTY VERSION "0.0.0") set_property(TARGET qmatrixclient PROPERTY SOVERSION 0 ) -if ( CMAKE_VERSION VERSION_LESS "3.1" ) - CHECK_CXX_COMPILER_FLAG("-std=c++11" STD_FLAG_SUPPORTED) - if ( STD_FLAG_SUPPORTED ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - endif ( STD_FLAG_SUPPORTED ) -else ( CMAKE_VERSION VERSION_LESS "3.1" ) - target_compile_features(qmatrixclient PRIVATE cxx_range_for) - target_compile_features(qmatrixclient PRIVATE cxx_override) - target_compile_features(qmatrixclient PRIVATE cxx_strong_enums) - target_compile_features(qmatrixclient PRIVATE cxx_lambdas) - target_compile_features(qmatrixclient PRIVATE cxx_auto_type) - target_compile_features(qmatrixclient PRIVATE cxx_generalized_initializers) - target_compile_features(qmatrixclient PRIVATE cxx_nullptr) - target_compile_features(qmatrixclient PRIVATE cxx_variadic_templates) -endif ( CMAKE_VERSION VERSION_LESS "3.1" ) - target_link_libraries(qmatrixclient Qt5::Core Qt5::Network Qt5::Gui) |