1
1
cmake_minimum_required (VERSION 3.22)
2
2
project (cesium VERSION 0.1.0 LANGUAGES C CXX)
3
3
4
- # Set C standard to C17
5
4
set (CMAKE_C_STANDARD 17)
6
5
set (CMAKE_C_STANDARD_REQUIRED ON )
7
6
@@ -10,52 +9,25 @@ set(CMAKE_CXX_STANDARD 20)
10
9
set (CMAKE_CXX_STANDARD_REQUIRED ON )
11
10
set (CMAKE_CXX_EXTENSIONS OFF )
12
11
13
- # Set default build type to Release if not specified
14
- if (NOT CMAKE_BUILD_TYPE )
15
- set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
16
- set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
17
- endif ()
18
-
19
- # include(FetchContent)
20
- # set(FETCHCONTENT_QUIET FALSE CACHE BOOL "Suppress output from FetchContent" FORCE)
21
-
22
- # Define the executable with modular source files
23
- add_executable (cesium src/main.cpp)
24
-
25
- # Compiler warnings (all platforms)
26
- target_compile_options (cesium PRIVATE -Wall -Wextra -Wpedantic)
27
-
28
- # Platform-specific settings
29
- if (WIN32 )
30
- target_compile_definitions (cesium PRIVATE
31
- _WIN32_WINNT=0x0601
32
- WIN32_LEAN_AND_MEAN
33
- )
34
- # no gui
35
- set_target_properties (cesium PROPERTIES WIN32_EXECUTABLE FALSE )
36
- # Force console subsystem for MSVC or MinGW, but not for Clang/lld-link
37
- if (MSVC OR MINGW)
38
- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--subsystem,console" )
39
- endif ()
40
- # Optionally add Windows-specific libraries here if needed
41
- elseif (APPLE )
42
- # macOS-specific settings (if any)
43
- elseif (UNIX )
44
- # Linux-specific settings (if any)
45
- endif ()
46
-
47
- # Clang-specific flags
48
- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
49
- target_compile_options (cesium PRIVATE -Wno-unused-parameter)
50
- endif ()
51
-
52
- # Set output directory for all platforms
53
- set_target_properties (cesium PROPERTIES
54
- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin
55
- )
56
-
57
- # Installation rules
58
- install (TARGETS cesium RUNTIME DESTINATION bin)
12
+ ## configure CMake module search paths that depend on the project
13
+ ## proj src dir is location of this file
14
+ list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /cmake)
15
+
16
+ include (CompileCommands)
17
+ include (DefaultBuildType)
18
+ include (DefaultInstallPath)
19
+ include (ForceUnicode)
20
+ include (HideVSCodeVars)
21
+ include (ConfigFetchContent)
22
+
23
+ # include dependencies
24
+ include (qt)
25
+ include (yyjson)
26
+ include (tree -sitter-core)
27
+ include (tree -sitter-cpp)
28
+
29
+ # Add cesium subdirectory
30
+ add_subdirectory (cesium)
59
31
60
32
include (CTest)
61
33
enable_testing ()
0 commit comments