-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
33 lines (33 loc) · 1.07 KB
/
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
cmake_minimum_required(VERSION 3.20)
project(QtMarkdown
VERSION 1.0.0
DESCRIPTION "A simple markdown editor"
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(QT ON)
add_subdirectory(3rd)
if (MSVC)
add_compile_options("/utf-8")
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_LIST_DIR})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
endif ()
endif ()
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Quick Qml Widgets Concurrent REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Quick Qml Widgets Concurrent REQUIRED)
option(BUILD_STATIC "build static library" OFF)
if (BUILD_STATIC)
add_definitions(-DBUILD_STATIC)
endif ()
include(MarkdownInstall.cmake)
add_subdirectory(src)
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_LIST_DIR})
add_subdirectory(example)
endif ()
option(BUILD_TEST "build unit test" OFF)
if (BUILD_TEST)
# add_subdirectory(deps/Catch2)
add_subdirectory(test)
endif ()