blob: 19866126da08f5841406cfa82e7ceec855707677 (
plain)
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
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..0ba23fe
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.16)
+project(opencsg VERSION 1.6.0 LANGUAGES CXX)
+
+option(BUILD_EXAMPLE "Build example program" ON)
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+include(GNUInstallDirs)
+
+add_subdirectory(src)
+if(BUILD_EXAMPLE)
+ add_subdirectory(example)
+endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..323a491
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,37 @@
+add_library(opencsg
+ area.cpp area.h
+ batch.cpp batch.h
+ channelManager.cpp channelManager.h
+ context.cpp context.h
+ frameBufferObject.cpp frameBufferObject.h
+ frameBufferObjectExt.cpp frameBufferObjectExt.h
+ glad/include/KHR/khrplatform.h
+ glad/include/glad/gl.h
+ glad/src/gl.cpp
+ occlusionQuery.cpp occlusionQuery.h
+ offscreenBuffer.h
+ opencsgConfig.h
+ opencsgRender.cpp opencsgRender.h
+ openglExt.h
+ openglHelper.cpp openglHelper.h
+ primitive.cpp
+ primitiveHelper.cpp primitiveHelper.h
+ renderGoldfeather.cpp
+ renderSCS.cpp
+ scissorMemo.cpp scissorMemo.h
+ settings.cpp settings.h
+)
+target_include_directories(opencsg PUBLIC
+ ${CMAKE_SOURCE_DIR}/include
+)
+
+set_target_properties(opencsg PROPERTIES
+ VERSION ${PROJECT_VERSION}
+ SOVERSION ${PROJECT_VERSION_MAJOR}
+ PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/include/opencsg.h
+)
+
+install(TARGETS opencsg
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
|