File tree 5 files changed +854
-0
lines changed
5 files changed +854
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ project(OpenGX VERSION 0.1)
3
3
4
4
option (BUILD_OPENGX "Build the opengx library" ON )
5
5
option (BUILD_DOCS "Build the documentation" OFF )
6
+ option (BUILD_EXAMPLES "Build the examples" OFF )
6
7
7
8
set (CMAKE_C_STANDARD 11)
8
9
set (CMAKE_CXX_STANDARD 17)
@@ -95,3 +96,7 @@ if(BUILD_DOCS)
95
96
include (UseLATEX)
96
97
add_subdirectory (doc /src)
97
98
endif ()
99
+
100
+ if (BUILD_EXAMPLES)
101
+ add_subdirectory (examples)
102
+ endif ()
Original file line number Diff line number Diff line change
1
+ find_package (PkgConfig REQUIRED)
2
+ pkg_check_modules(SDL2 IMPORTED_TARGET sdl2)
3
+ pkg_check_modules(OPENGL IMPORTED_TARGET opengl)
4
+ if (SDL2_FOUND)
5
+ add_subdirectory (sdl2)
6
+ endif ()
Original file line number Diff line number Diff line change
1
+ add_subdirectory (opengl20)
Original file line number Diff line number Diff line change
1
+ set (EXTRA_FILES)
2
+ set (EXTRA_LIBS)
3
+ if (CMAKE_SYSTEM_NAME MATCHES "NintendoWii|NintendoGameCube" )
4
+ list (APPEND EXTRA_LIBS opengx)
5
+ else ()
6
+ list (APPEND EXTRA_LIBS PkgConfig::OPENGL)
7
+ endif ()
8
+
9
+ macro (add_example name )
10
+ add_executable (${name} ${EXTRA_FILES} ${ARGN} )
11
+ target_link_libraries (${name} ${EXTRA_LIBS} m PkgConfig::SDL2)
12
+ endmacro ()
13
+
14
+ add_example(gl2gears gl2gears.c)
You can’t perform that action at this time.
0 commit comments