aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..22bcd7e
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,25 @@
+cmake_minimum_required(VERSION 3.22)
+project(cgeditor)
+
+# Includes
+set(CGEDITOR_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/includes) # For conveniance
+set(CGEDITOR_INCLUDE_DIR ${CGEDITOR_INCLUDE_DIR} PARENT_SCOPE) # To be used by other projects with add_subdirectory()
+file(MAKE_DIRECTORY ${CGEDITOR_INCLUDE_DIR})
+# Copy all includes
+file(GLOB_RECURSE HEADER_FILES src/*.hpp)
+file(MAKE_DIRECTORY ${CGEDITOR_INCLUDE_DIR}/components)
+foreach(FILE ${HEADER_FILES})
+file(RELATIVE_PATH FILE_SUBDIR ${CMAKE_CURRENT_SOURCE_DIR}/src ${FILE})
+configure_file(${FILE} ${CGEDITOR_INCLUDE_DIR}/${FILE_SUBDIR} COPYONLY)
+endforeach(FILE ${HEADER_FILES})
+
+# Compile cgeditor
+include_directories(src)
+file(GLOB_RECURSE SRC_CPP_FILES src/*.cpp)
+add_library(cgeditor SHARED ${SRC_CPP_FILES})
+
+# Examples
+set(COMPILE_EXAMPLES FALSE CACHE BOOL "Compiling included examples")
+if(COMPILE_EXAMPLES)
+ add_subdirectory("examples/wxWidgets/")
+endif() \ No newline at end of file