Skip to content

Commit

Permalink
CMake: Use std c++ 11 or 17
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Aug 15, 2023
1 parent a31fa0e commit 5e6cb0b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ project(FaceRecognizer)

SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

Expand Down Expand Up @@ -43,6 +42,9 @@ if(ANDROID AND (Qt${QT_VERSION_MAJOR}_VERSION VERSION_LESS 6.0.0))
endif()
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
LIST(APPEND QT_COMPONENTS MultimediaWidgets Core5Compat)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS ${QT_COMPONENTS})
message("QT_VERSION:${Qt${QT_VERSION_MAJOR}_VERSION}")
Expand All @@ -67,13 +69,10 @@ IF(MSVC)
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
ENDIF(MSVC)
IF(MINGW)
add_compile_options("-std=c++0x")
ENDIF()
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")

add_compile_options(-std=c++0x -Wno-sign-compare -Wno-unused-parameter)
add_compile_options(-Wno-sign-compare -Wno-unused-parameter)

if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
add_compile_options(-g -ggdb)
Expand Down

0 comments on commit 5e6cb0b

Please sign in to comment.