aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-04-11 00:50:38 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-04-11 00:50:38 +0800
commit44ad3c8b36540c6b0b3144a21ac40310e163bb19 (patch)
treeec2b75f68771fcbed8ba7450d30da1f05ebfc52c /CMakeLists.txt
downloadrwebbrowser-44ad3c8b36540c6b0b3144a21ac40310e163bb19.tar.gz
rwebbrowser-44ad3c8b36540c6b0b3144a21ac40310e163bb19.tar.xz
feat: initialize project structure with CMake build system, C++23 support, and core browser scaffolding
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..560341c
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 3.24.2)
+
+project(
+ Ricochet
+ VERSION 0.1.0
+ DESCRIPTION "A minimalist CLI web browser for fast, distraction-free navigation."
+ LANGUAGES CXX
+)
+
+if(${PROJECT_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+ message(FATAL_ERROR "Ricochet must be built outside its source directory, e.g. `cmake -B build`.")
+endif()
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+
+foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
+ string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
+endforeach()
+
+include(etc/build_type.cmake)
+include(etc/cflags.cmake)
+include(etc/scanners.cmake)
+include(etc/tests.cmake)
+
+add_subdirectory(src)
+add_subdirectory(tests)
+
+install(TARGETS ricochet
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+) \ No newline at end of file