-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
46 lines (35 loc) · 928 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required( VERSION 3.14 )
project ( Q7Zip
LANGUAGES C CXX
VERSION 1.0.0
)
list ( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/7zip )
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if (ANDROID)
set(BUILD_TESTING_INIT OFF)
else()
set(BUILD_TESTING_INIT ON)
endif()
option ( BUILD_TESTING "Build Unit Tests" ${BUILD_TESTING_INIT} )
option ( USE_QT5 "Use Qt5 libraries instead of Qt6" OFF )
if (USE_QT5)
find_package(QT NAMES Qt5 REQUIRED)
else()
find_package(QT NAMES Qt6 REQUIRED)
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Test REQUIRED)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED True)
include(GNUInstallDirs)
add_subdirectory( 7zip )
add_subdirectory( q7z )
if (BUILD_TESTING)
enable_testing()
add_subdirectory( tests )
endif()