-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
44 lines (34 loc) · 1.19 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
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.10.0)
project(zoomablechartwidget VERSION 0.1.0 LANGUAGES C CXX)
# Determine if zoomablechart is built as a subproject (using add_subdirectory)
# or if it is the master project.
if (NOT DEFINED ZOOMABLECHART_MASTER_PROJECT)
set(ZOOMABLECHART_MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(ZOOMABLECHART_MASTER_PROJECT ON)
message(STATUS "CMake version: ${CMAKE_VERSION}")
endif ()
endif ()
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Charts)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Charts)
add_library(zoomablechart
rangelimitedvalueaxis.cpp
rangelimitedvalueaxis.h
zoomablechart.cpp
zoomablechart.h
zoomablechartview.cpp
zoomablechartview.h
zoomablechartwidget.cpp
zoomablechartwidget.h
zoomablechartwidget.ui
)
set_target_properties(zoomablechart PROPERTIES
AUTOMOC ON
AUTOUIC ON
AUTORCC ON
)
target_link_libraries(zoomablechart PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Charts)
target_include_directories(zoomablechart PUBLIC ./)
if(ZOOMABLECHART_MASTER_PROJECT)
add_subdirectory(example)
endif()