-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
82 lines (70 loc) · 2.68 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
cmake_minimum_required(VERSION 3.10)
project(librxui VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
function(configure target)
set_target_properties(${target} PROPERTIES LINKER_LANGUAGE CXX)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU")
target_compile_options(${target} PRIVATE -Werror)
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic)
target_compile_features(${target} PRIVATE cxx_std_11)
endif ()
endfunction()
add_library(rxui src/rxui.h)
configure(rxui)
add_library(rxui-efl src/rxui-efl.h)
configure(rxui-efl)
target_compile_definitions(rxui-efl PUBLIC RXUI_BACKEND_EFL)
find_package(Elementary REQUIRED)
if (ELEMENTARY_FOUND AND NOT TARGET Elementary::efl)
add_library(Elementary::efl INTERFACE IMPORTED)
set_target_properties(Elementary::efl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
"${ELEMENTARY_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES
"${ELEMENTARY_LIBRARIES}"
INTERFACE_COMPILE_DEFINITIONS
"${ELEMENTARY_DEFINITIONS_STR}"
)
endif ()
target_link_libraries(rxui-efl
PUBLIC
Elementary::efl
)
add_library(rxui-gtk src/rxui-gtk.h)
configure(rxui-gtk)
target_compile_definitions(rxui-gtk PUBLIC RXUI_BACKEND_GTK)
find_package(GTK3 REQUIRED)
target_link_libraries(rxui-gtk
PUBLIC
GTK3::gtk
)
add_library(rxui-qt src/rxui-qt.h)
configure(rxui-qt)
target_compile_definitions(rxui-qt PUBLIC RXUI_BACKEND_QT)
find_package(Qt5 REQUIRED COMPONENTS Widgets)
target_link_libraries(rxui-qt
PUBLIC
Qt5::Widgets
)
function(test name files)
add_executable(${name}-efl test/7guis/00-common.h test/7guis/00-common-efl.h ${files})
configure(${name}-efl)
target_link_libraries(${name}-efl rxui-efl)
add_executable(${name}-gtk test/7guis/00-common.h test/7guis/00-common-gtk.h ${files})
configure(${name}-gtk)
target_link_libraries(${name}-gtk rxui-gtk)
add_executable(${name}-qt test/7guis/00-common.h test/7guis/00-common-qt.h ${files})
configure(${name}-qt)
target_link_libraries(${name}-qt rxui-qt)
endfunction()
test(rxui-7guis-01-counter test/7guis/01-counter.cpp)
test(rxui-7guis-02-tempconv test/7guis/02-tempconv.cpp)
test(rxui-7guis-03-flight test/7guis/03-flight.cpp)
#test(rxui-7guis-04-timer test/7guis/04-timer.cpp)
test(rxui-7guis-05-crud test/7guis/05-crud.cpp)
#test(rxui-7guis-06-circles test/7guis/06-circles.cpp)
#test(rxui-7guis-07-cells. test/7guis/07-cells.cpp)