diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a1e96368..0ead9ec8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,25 +20,16 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() # Setup command line parameters for the compiler and linker -CHECK_CXX_COMPILER_FLAG("-Wall" WALL_FLAG_SUPPORTED) -if ( WALL_FLAG_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )-Wall($| )") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -endif ( ) -CHECK_CXX_COMPILER_FLAG("-Wpedantic" PEDANTIC_FLAG_SUPPORTED) -if ( PEDANTIC_FLAG_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )pedantic($| )") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic") -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) +foreach (FLAG all pedantic error=return-type) + CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) + if ( WARN_${FLAG}_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )-W?${FLAG}($| )") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W${FLAG}") + endif ( ) +endforeach () + +set(CMAKE_CXX_STANDARD 14) + +find_package(Qt5 5.6 REQUIRED Network Gui) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) message( STATUS ) @@ -76,10 +67,8 @@ set(libqmatrixclient_SRCS events/receiptevent.cpp jobs/basejob.cpp jobs/checkauthmethods.cpp - jobs/passwordlogin.cpp jobs/sendeventjob.cpp jobs/setroomstatejob.cpp - jobs/postreceiptjob.cpp jobs/joinroomjob.cpp jobs/roommessagesjob.cpp jobs/syncjob.cpp |