-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
59 lines (44 loc) · 1.51 KB
/
CMakeLists.txt
File metadata and controls
59 lines (44 loc) · 1.51 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required(VERSION 3.28)
project( QLiteHtmlBrowser VERSION 2.3.1 )
include(GNUInstallDirs)
if(PROJECT_IS_TOP_LEVEL)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed.")
endif()
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_INSTALL_MESSAGE "LAZY" ) # one of NEVER, LAZY, ALWAYS
set( CMAKE_INSTALL_PREFIX "" )
option( WITH_ASAN "Build with sanitizer" OFF)
option( WTIH_DOCS "Build documentation of the library" OFF)
if( NOT MSVC AND WITH_ASAN)
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address,undefined")
endif()
set( CMAKE_POSITION_INDEPENDENT_CODE TRUE )
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set( AUTOMOC OFF)
set( AUTOUIC OFF)
set( AUTORCC OFF)
find_package(Qt6 COMPONENTS Core Gui Widgets)
if(Qt6_FOUND)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
find_package(Qt5 5.15 COMPONENTS Core Gui Widgets REQUIRED)
endif()
if( WITH_DOCS )
find_package(Doxygen REQUIRED)
endif()
include( CTest )
enable_testing()
endif()
add_subdirectory( foreign )
add_subdirectory( include )
add_subdirectory( src )
add_subdirectory( dist )
if (BUILD_TESTING)
add_subdirectory( test )
endif()
if(PROJECT_IS_TOP_LEVEL AND EXISTS "${CMAKE_SOURCE_DIR}/CPackSettings.cmake")
include (CPackSettings.cmake)
add_custom_target(dist-source COMMAND cpack --config ${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake )
endif()