Switch to CMake

This commit is contained in:
marcelb 2025-01-31 19:14:55 +01:00
parent f6f7853062
commit cef9c64e86
3 changed files with 35 additions and 1 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
.vscode
example
test/*.o
test/*.o
build

30
CMakeLists.txt Normal file
View File

@ -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)
#

3
test/CMakeLists.txt Normal file
View File

@ -0,0 +1,3 @@
add_executable(log_test test.cpp)
target_link_libraries(log_test log)