summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt40
1 files changed, 40 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..abe1087
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 3.10)
+project(literatelb LANGUAGES CXX CUDA)
+
+find_package(CUDAToolkit REQUIRED)
+find_package(SFML 2.5 COMPONENTS graphics window system REQUIRED)
+find_package(ImGui-SFML REQUIRED)
+
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Release)
+endif()
+
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr --default-stream per-thread --extended-lambda")
+set(CMAKE_CUDA_ARCHITECTURES 50)
+
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/tangle
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+include(assets.cmake)
+serialize_assets(${CMAKE_CURRENT_SOURCE_DIR}/tangle/asset
+ ${CMAKE_CURRENT_BINARY_DIR}/assets.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/assets.h)
+add_library(assets ${CMAKE_CURRENT_BINARY_DIR}/assets.cc)
+
+link_libraries(
+ sfml-graphics
+ sfml-window
+ sfml-system
+ ImGui-SFML::ImGui-SFML
+ CUDA::cuda_driver
+ assets)
+
+file(GLOB EXAMPLES ${CMAKE_CURRENT_SOURCE_DIR}/tangle/*.cu)
+foreach(examplefile ${EXAMPLES})
+ get_filename_component(examplename ${examplefile} NAME_WE)
+ add_executable(${examplename} ${examplefile})
+endforeach()