... | ... |
@@ -31,6 +31,25 @@ if(SDL2_FOUND) |
31 | 31 |
list(APPEND GLBACKEND_DEFINITIONS GLBACKEND_SDL) |
32 | 32 |
endif() |
33 | 33 |
|
34 |
+## wxwidgets |
|
35 |
+# https://cmake.org/cmake/help/v3.14/module/FindwxWidgets.html |
|
36 |
+# https://cmake.org/cmake/help/v3.14/module/UsewxWidgets.html |
|
37 |
+find_package(wxWidgets COMPONENTS gl core base) |
|
38 |
+if(wxWidgets_FOUND) |
|
39 |
+ add_library(wxWidgets INTERFACE) |
|
40 |
+ set_target_properties(wxWidgets PROPERTIES |
|
41 |
+ INTERFACE_INCLUDE_DIRECTORIES "${wxWidgets_INCLUDE_DIRS}" |
|
42 |
+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${wxWidgets_INCLUDE_DIRS}" |
|
43 |
+ INTERFACE_LINK_DIRECTORIES "${wxWidgets_LIBRARY_DIRS}" |
|
44 |
+ INTERFACE_COMPILE_DEFINITIONS "${wxWidgets_DEFINITIONS}" |
|
45 |
+ INTERFACE_COMPILE_DEFINITIONS_DEBUG "${wxWidgets_DEFINITIONS_DEBUG}" |
|
46 |
+ INTERFACE_COMPILE_OPTIONS "${wxWidgets_CXX_FLAGS}" |
|
47 |
+ INTERFACE_LINK_LIBRARIES "${wxWidgets_LIBRARIES}" |
|
48 |
+ ) |
|
49 |
+ list(APPEND GLBACKEND_DEPENDENCIES wxWidgets) |
|
50 |
+ list(APPEND GLBACKEND_DEFINITIONS GLBACKEND_WXWIDGETS) |
|
51 |
+endif() |
|
52 |
+ |
|
34 | 53 |
## Common |
35 | 54 |
include(common.cmake) |
36 | 55 |
common( |
... | ... |
@@ -24,8 +24,12 @@ if(glfw3_FOUND) |
24 | 24 |
list(APPEND GLBACKEND_DEFINITIONS GLBACKEND_GLFW) |
25 | 25 |
endif() |
26 | 26 |
|
27 |
-## Cache |
|
28 |
-set(GLBACKEND_DEFINITIONS "${GLBACKEND_DEFINITIONS}" CACHE INTERNAL "") |
|
27 |
+## sdl |
|
28 |
+find_package(SDL2) |
|
29 |
+if(SDL2_FOUND) |
|
30 |
+ list(APPEND GLBACKEND_DEPENDENCIES SDL2) |
|
31 |
+ list(APPEND GLBACKEND_DEFINITIONS GLBACKEND_SDL) |
|
32 |
+endif() |
|
29 | 33 |
|
30 | 34 |
## Common |
31 | 35 |
include(common.cmake) |
... | ... |
@@ -17,6 +17,16 @@ add_library(${PROJECT_NAME}) |
17 | 17 |
set(GLBACKEND_DEPENDENCIES) |
18 | 18 |
set(GLBACKEND_DEFINITIONS) |
19 | 19 |
|
20 |
+## glfw |
|
21 |
+find_package(glfw3) |
|
22 |
+if(glfw3_FOUND) |
|
23 |
+ list(APPEND GLBACKEND_DEPENDENCIES glfw) |
|
24 |
+ list(APPEND GLBACKEND_DEFINITIONS GLBACKEND_GLFW) |
|
25 |
+endif() |
|
26 |
+ |
|
27 |
+## Cache |
|
28 |
+set(GLBACKEND_DEFINITIONS "${GLBACKEND_DEFINITIONS}" CACHE INTERNAL "") |
|
29 |
+ |
|
20 | 30 |
## Common |
21 | 31 |
include(common.cmake) |
22 | 32 |
common( |
... | ... |
@@ -13,8 +13,25 @@ project(glbackend |
13 | 13 |
## Main target |
14 | 14 |
add_library(${PROJECT_NAME}) |
15 | 15 |
|
16 |
+## Variables |
|
17 |
+set(GLBACKEND_DEPENDENCIES) |
|
18 |
+set(GLBACKEND_DEFINITIONS) |
|
19 |
+ |
|
16 | 20 |
## Common |
17 | 21 |
include(common.cmake) |
18 | 22 |
common( |
19 | 23 |
CXX_STANDARD 11 |
24 |
+ FETCHCONTENT |
|
25 |
+ https://git.rcrnstn.net/rcrnstn/glbase |
|
26 |
+ https://git.rcrnstn.net/rcrnstn/cxx-str |
|
27 |
+ DEPENDENCIES_PRIVATE |
|
28 |
+ glbase |
|
29 |
+ cxx-str |
|
30 |
+ ${GLBACKEND_DEPENDENCIES} |
|
31 |
+ DEPENDENCIES_TESTS |
|
32 |
+ glbase |
|
33 |
+ cxx-str |
|
34 |
+ ${GLBACKEND_DEPENDENCIES} |
|
35 |
+ DEFINITIONS |
|
36 |
+ ${GLBACKEND_DEFINITIONS} |
|
20 | 37 |
) |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,20 @@ |
1 |
+## CMake |
|
2 |
+cmake_minimum_required(VERSION 3.14) |
|
3 |
+if(NOT CMAKE_BUILD_TYPE) |
|
4 |
+ set(CMAKE_BUILD_TYPE Debug) |
|
5 |
+endif() |
|
6 |
+ |
|
7 |
+## Project |
|
8 |
+project(glbackend |
|
9 |
+ VERSION 1.0.0 |
|
10 |
+ LANGUAGES CXX |
|
11 |
+) |
|
12 |
+ |
|
13 |
+## Main target |
|
14 |
+add_library(${PROJECT_NAME}) |
|
15 |
+ |
|
16 |
+## Common |
|
17 |
+include(common.cmake) |
|
18 |
+common( |
|
19 |
+ CXX_STANDARD 11 |
|
20 |
+) |