-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
34 lines (26 loc) · 918 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
cmake_minimum_required(VERSION 3.20)
project(editorconfig-core-qt
VERSION 0.1
DESCRIPTION "EditorConfig Qt5/6 core bindings"
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 COMPONENTS Core)
if (NOT Qt6_FOUND)
find_package(Qt5 5.15 REQUIRED COMPONENTS Core)
endif()
add_library(editorconfig-core-qt
EditorConfig.cpp
EditorConfig.h
)
target_link_libraries(editorconfig-core-qt PRIVATE Qt::Core)
target_include_directories(editorconfig-core-qt PUBLIC .)
option(EDITORCONFIG_QT_BUILD_CMD "Build executable to run EditorConfig tests" OFF)
if (EDITORCONFIG_QT_BUILD_CMD)
add_executable(editorconfig-app src/editorconfig-app/main.cpp)
target_link_libraries(editorconfig-app PRIVATE editorconfig-core-qt Qt::Core)
enable_testing()
set(EDITORCONFIG_CMD ${CMAKE_BINARY_DIR}/editorconfig-app.exe)
add_subdirectory(tests)
endif()