-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
40 lines (31 loc) · 1.05 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 3.10)
project(example_project VERSION 1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Include the FetchContent module
include(FetchContent)
# Declare the dependency using FetchContent
FetchContent_Declare(
logtard
GIT_REPOSITORY https://github.com/araujo88/logtard.git
GIT_TAG main
)
# Make the content available
FetchContent_MakeAvailable(logtard)
file(GLOB SOURCES "src/*.cpp" )
# Generate an executable from specified sources
add_executable(example_project ${SOURCES})
target_include_directories(example_project PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include )
# Optional: Install rules
install(TARGETS example_project
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin # For Windows DLLs
)
install(DIRECTORY include/ DESTINATION include)
# Link the external library targets to your project
target_link_libraries(example_project PRIVATE logtard)
# Enable testing with CMake
enable_testing()
# Include the directory where the test code is located
add_subdirectory(tests)