aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-06-17 09:05:21 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-06-17 09:13:11 +0200
commit9c09097156dc70315364d27e61daef19b2844139 (patch)
tree6829c5a52dde09dab3447f39e9e754c208dbe3f4 /CMakeLists.txt
downloadttwhy-9c09097156dc70315364d27e61daef19b2844139.tar.xz
ttwhy-9c09097156dc70315364d27e61daef19b2844139.zip
initial commit
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt70
1 files changed, 70 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..4eb75c1
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,70 @@
+cmake_minimum_required(VERSION "4.2.0")
+
+project("ttwhy"
+ VERSION "1.0.0"
+ LANGUAGES CXX
+)
+
+### Fetch Dependencies
+
+include("FetchContent")
+
+FetchContent_Declare("asio"
+ GIT_REPOSITORY "https://github.com/chriskohlhoff/asio"
+ GIT_TAG "asio-1-38-0"
+)
+
+FetchContent_MakeAvailable("asio")
+
+### asio
+
+find_package("Threads")
+
+add_library("asio" INTERFACE)
+add_library("ext::asio" ALIAS "asio")
+
+target_include_directories("asio" INTERFACE
+ "${asio_SOURCE_DIR}/asio/include"
+)
+
+target_link_libraries("asio" INTERFACE
+ "Threads::Threads"
+)
+
+### Core Library
+
+add_library("ttwhy-core")
+add_library("ttwhy::lib" ALIAS "ttwhy-core")
+
+target_sources("ttwhy-core" PUBLIC
+ FILE_SET CXX_MODULES
+ FILES
+
+ "ttwhy/lib.cppm"
+)
+
+target_include_directories("ttwhy-core" PUBLIC
+ "${CMAKE_SOURCE_DIR}"
+)
+
+target_compile_features("ttwhy-core" PUBLIC
+ "cxx_std_23"
+)
+
+target_link_libraries("ttwhy-core" PUBLIC
+ "ext::asio"
+)
+
+### Main Executable
+
+add_executable("ttwhy")
+add_executable("ttwhy::app" ALIAS "ttwhy")
+
+target_sources("ttwhy" PRIVATE
+ "ttwhy/main.cpp"
+)
+
+target_link_libraries("ttwhy" PRIVATE
+ "ttwhy::lib"
+)
+