From cef9c64e86c4f4ada4b41611b1176d09fd13412d Mon Sep 17 00:00:00 2001 From: marcelb Date: Fri, 31 Jan 2025 19:14:55 +0100 Subject: [PATCH] Switch to CMake --- .gitignore | 3 ++- CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ test/CMakeLists.txt | 3 +++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt create mode 100644 test/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 109689c..10d4854 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vscode example -test/*.o \ No newline at end of file +test/*.o +build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4fcb594 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.10) + +project(log) + +# Postavi verziju projekta +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Pronađi Boost biblioteku (ako nije uobičajeni direktorijum, postavi put) +# find_package(Boost REQUIRED COMPONENTS system) + +# Dodaj direktorijume sa zaglavljima +include_directories(lib) + +# Dodaj biblioteku +add_library(log STATIC + src/log.cpp +) + +# # Linkaj log biblioteku sa Boost-om +# target_link_libraries(log Boost::system) + +# Dodaj testove +add_subdirectory(test) + + +# Instaliraj biblioteku +# install(TARGETS log DESTINATION lib) +# install(FILES lib/log.hpp lib/define.hpp lib/engine.hpp lib/filesystem.hpp lib/timers.hpp lib/trigger.hpp DESTINATION include/log) +# \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..9180100 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(log_test test.cpp) + +target_link_libraries(log_test log)