base with spdlog
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "external/spdlog"]
|
||||||
|
path = external/spdlog
|
||||||
|
url = https://github.com/gabime/spdlog.git
|
||||||
74
CMakeLists.txt
Normal file
74
CMakeLists.txt
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# Project
|
||||||
|
# --------------------------------------------------
|
||||||
|
project(wolfram-engine-wrapper-client LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
# Default to Release if not specified
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# External dependency: spdlog
|
||||||
|
# --------------------------------------------------
|
||||||
|
add_subdirectory(external/spdlog)
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# Executable
|
||||||
|
# --------------------------------------------------
|
||||||
|
add_executable(${PROJECT_NAME} src/main.cpp)
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# Auto-discover include dirs under src/
|
||||||
|
# --------------------------------------------------
|
||||||
|
file(GLOB_RECURSE SRC_SUBDIRS LIST_DIRECTORIES true
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/*"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(SRC_INCLUDES "")
|
||||||
|
foreach(dir ${SRC_SUBDIRS})
|
||||||
|
if(IS_DIRECTORY ${dir})
|
||||||
|
list(APPEND SRC_INCLUDES ${dir})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${SRC_INCLUDES})
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# Auto-discover all .cpp except main.cpp
|
||||||
|
# --------------------------------------------------
|
||||||
|
file(GLOB_RECURSE ALL_CPP
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
|
||||||
|
)
|
||||||
|
|
||||||
|
list(REMOVE_ITEM ALL_CPP
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_sources(${PROJECT_NAME} PRIVATE ${ALL_CPP})
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# Link dependencies
|
||||||
|
# --------------------------------------------------
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
spdlog::spdlog
|
||||||
|
)
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# Compiler warnings
|
||||||
|
# --------------------------------------------------
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
-Wall -Wextra -Wpedantic
|
||||||
|
-Wconversion -Wshadow
|
||||||
|
-Wnull-dereference
|
||||||
|
-Wdouble-promotion
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
1
external/spdlog
vendored
Submodule
1
external/spdlog
vendored
Submodule
Submodule external/spdlog added at fc7e9c8721
Reference in New Issue
Block a user