|
|
@@ -14,12 +14,6 @@ if(NOT CMAKE_BUILD_TYPE)
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
endif()
|
|
|
|
|
|
-# Compiler warnings
|
|
|
-if(MSVC)
|
|
|
- add_compile_options(/W4 /WX)
|
|
|
-else()
|
|
|
- add_compile_options(-Wall -Wextra -Wpedantic -Werror)
|
|
|
-endif()
|
|
|
|
|
|
# Dependencies
|
|
|
include(FetchContent)
|
|
|
@@ -43,13 +37,20 @@ FetchContent_Declare(
|
|
|
)
|
|
|
FetchContent_MakeAvailable(sol2)
|
|
|
|
|
|
-# spdlog
|
|
|
-FetchContent_Declare(
|
|
|
- spdlog
|
|
|
- GIT_REPOSITORY https://github.com/gabime/spdlog.git
|
|
|
- GIT_TAG v1.12.0
|
|
|
-)
|
|
|
-FetchContent_MakeAvailable(spdlog)
|
|
|
+# spdlog - try system package first (from Nix), fallback to FetchContent
|
|
|
+find_package(spdlog)
|
|
|
+
|
|
|
+if(NOT spdlog_FOUND)
|
|
|
+ message(STATUS "System spdlog not found. Fetching via Git...")
|
|
|
+ FetchContent_Declare(
|
|
|
+ spdlog
|
|
|
+ GIT_REPOSITORY https://github.com/gabime/spdlog.git
|
|
|
+ GIT_TAG v1.14.1
|
|
|
+ )
|
|
|
+ FetchContent_MakeAvailable(spdlog)
|
|
|
+else()
|
|
|
+ message(STATUS "Found system spdlog: ${spdlog_VERSION}")
|
|
|
+endif()
|
|
|
|
|
|
# Try to find system GoogleTest first (Nix-shell provided)
|
|
|
find_package(GTest)
|
|
|
@@ -105,6 +106,7 @@ target_link_libraries(lumacs_core PUBLIC
|
|
|
${CURSES_LIBRARIES}
|
|
|
)
|
|
|
|
|
|
+
|
|
|
# Main Executable (Single binary)
|
|
|
add_executable(lumacs
|
|
|
src/main.cpp
|
|
|
@@ -124,6 +126,21 @@ target_include_directories(lumacs PRIVATE
|
|
|
${CURSES_INCLUDE_DIR}
|
|
|
)
|
|
|
|
|
|
+
|
|
|
+# Helper variable for your flags
|
|
|
+if(MSVC)
|
|
|
+ set(LUMACS_WARNINGS /W4 /WX)
|
|
|
+else()
|
|
|
+ set(LUMACS_WARNINGS -Wall -Wextra -Wpedantic -Werror)
|
|
|
+endif()
|
|
|
+
|
|
|
+# Apply ONLY to your core library
|
|
|
+target_compile_options(lumacs_core PRIVATE ${LUMACS_WARNINGS})
|
|
|
+
|
|
|
+# Apply ONLY to your executable
|
|
|
+target_compile_options(lumacs PRIVATE ${LUMACS_WARNINGS})
|
|
|
+
|
|
|
+
|
|
|
# Configure GTK if available
|
|
|
if(GTKMM_FOUND)
|
|
|
message(STATUS "GTKMM 4.0 found - Building with GUI support")
|