diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | extensions/CMakeLists.txt | 10 | ||||
-rw-r--r-- | smelt/glfw/CMakeLists.txt | 30 |
4 files changed, 56 insertions, 0 deletions
@@ -1,3 +1,6 @@ +# Build dirs +build/ + *.o *.a .directory diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..44cd5b6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +project (smelt) + +cmake_minimum_required(VERSION 3.11) + +option (BUILD_DUMB "Disable sound support" OFF) +option (BUILD_EXTENSIONS "Build extensions" ON) + +add_subdirectory(smelt/glfw) + +if (BUILD_EXTENSIONS) + add_subdirectory(extensions) +endif () + diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt new file mode 100644 index 0000000..2c265ad --- /dev/null +++ b/extensions/CMakeLists.txt @@ -0,0 +1,10 @@ +find_package(Freetype REQUIRED) + +file (GLOB SMELTTEXT_CPP_FILES "*.cpp") + +include_directories( + ${FREETYPE_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/../include +) + +add_library(smelttext STATIC ${SMELTTEXT_CPP_FILES}) diff --git a/smelt/glfw/CMakeLists.txt b/smelt/glfw/CMakeLists.txt new file mode 100644 index 0000000..6785ca1 --- /dev/null +++ b/smelt/glfw/CMakeLists.txt @@ -0,0 +1,30 @@ +option(BUILD_DUMB "Disable sound support" OFF) + +find_package(PkgConfig REQUIRED) +find_package(GLEW REQUIRED) +find_package(OpenAL REQUIRED) + +pkg_search_module(GLFW REQUIRED glfw3) + +set (SMELT_GLFW_CPP_FILES + gfx_glfw.cpp + sfx_oal.cpp + inp_glfw.cpp + sys_glfw.cpp +) + +include_directories( + ${GLFW_INCLUDE_DIRS} + ${GLEW_INCLUDE_DIRS} +) + +add_library(smelt STATIC ${SMELT_GLFW_CPP_FILES}) + +if (BUILD_DUMB) + message (STATUS "") + message (STATUS "BUILD_DUMB build option enabled") + message (STATUS "") + target_compile_definitions(smelt PRIVATE + ENABLE_DUMB + ) +endif () |