diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5449446b..24cdd58d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,18 +19,28 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) "MinSizeRel" "RelWithDebInfo") endif() -find_package(Qt5Core 5.2.0 REQUIRED) # For JSON (de)serialization -find_package(Qt5Network 5.2.0 REQUIRED) # For networking -find_package(Qt5Gui 5.2.0 REQUIRED) # For userpics +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) message( STATUS ) -message( STATUS "================================================================================" ) -message( STATUS " libqmatrixclient Build Information " ) -message( STATUS "================================================================================" ) -message( STATUS "Building with: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) -message( STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}" ) -message( STATUS "Path to Qt Core: ${Qt5Core_DIR}" ) -message( STATUS "================================================================================" ) +message( STATUS "=============================================================================" ) +message( STATUS " libqmatrixclient Build Information" ) +message( STATUS "=============================================================================" ) +if (CMAKE_BUILD_TYPE) + message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") +endif(CMAKE_BUILD_TYPE) +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 ) # Set up source files @@ -39,7 +49,6 @@ set(libqmatrixclient_SRCS connection.cpp room.cpp user.cpp - logmessage.cpp state.cpp settings.cpp events/event.cpp @@ -69,20 +78,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) |