diff --git a/.gitignore b/.gitignore index 2e02ecf..dc9abb7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,8 @@ *.coverage *.coveragexml main -compile_commands.json \ No newline at end of file +LittleWeatherApp +LittleWeatherApp_debug +compile_commands.json + +build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d6c9479 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.16) + +project(LittleWeatherApp VERSION 1.0.0 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 23) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +include(CheckCXXCompilerFlag) + +add_executable(${PROJECT_NAME} + src/atlas.h + src/client.cpp + src/main.cpp + src/parser.cpp + src/settings.cpp + src/ui.cpp + src/wallpaper.cpp +) + +target_include_directories(${PROJECT_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/third-party +) + +target_link_libraries(${PROJECT_NAME} + PRIVATE + -lraylib + -lGL + -lm + -lpthread + -ldl + -lrt + -lX11 +) \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..21505ad --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +BUILD_DIR ?= build +BUILD_TYPE ?= Release +JOBS ?= $(shell nproc) + +APP_NAME = LittleWeatherApp + +help: + @echo "Usage: make [target]" + @echo "Targets:" + @echo " build-release Build the project in Release mode" + @echo " build-debug Build the project in Debug mode" + @echo " clean Remove the build directory" + + +.PHONY: all clean +clean: + rm -rf $(BUILD_DIR) + +configure: + @echo "Configuring the project with CMake..." + @echo "Build directory: $(BUILD_DIR)/$(BUILD_TYPE)" + @echo "Build type: $(BUILD_TYPE)" + @cmake -S . -B $(BUILD_DIR)/$(BUILD_TYPE) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) + + +.PHONY: build-release +build-release: BUILD_TYPE = Release +build-release: configure + cmake --build $(BUILD_DIR)/$(BUILD_TYPE) --config Release -- -j$(JOBS) + cp $(BUILD_DIR)/$(BUILD_TYPE)/$(APP_NAME) ./$(APP_NAME) + +.PHONY: build-debug +build-debug: BUILD_TYPE = Debug +build-debug: configure + cmake --build $(BUILD_DIR)/$(BUILD_TYPE) --config Debug -- -j$(JOBS) + cp $(BUILD_DIR)/$(BUILD_TYPE)/$(APP_NAME) ./$(APP_NAME)_debug diff --git a/dev_update.sh b/dev_update.sh index ba03857..3845778 100755 --- a/dev_update.sh +++ b/dev_update.sh @@ -1,3 +1,7 @@ #!/bin/bash -bear -- clang++ src/*.cpp -std=c++17 -I/usr/local/include -g -o main \ - -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 +bear -- clang++ src/*.cpp \ + -std=c++17 \ + -I/usr/local/include \ + -Ithird-party \ + -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 \ + -g -o main diff --git a/src/httplib.h b/third-party/httplib.h similarity index 100% rename from src/httplib.h rename to third-party/httplib.h diff --git a/src/json.hpp b/third-party/json.hpp similarity index 100% rename from src/json.hpp rename to third-party/json.hpp