-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
42 lines (32 loc) · 1.12 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
41
42
cmake_minimum_required(VERSION 3.9)
project(cstlmp C)
set(CMAKE_C_STANDARD 11)
############################################################
# Create a library
############################################################
#Generate the static library from the library sources
add_library(cstlmp STATIC
src/linked_list/singly_linked_list.c src/linked_list/singly_linked_list.h)
target_include_directories(cstlmp
PUBLIC
${PROJECT_SOURCE_DIR}/src
)
############################################################
# Create an executable
############################################################
# Add an executable with the above sources
add_executable(cstlmp_tests
tests/linked_list/test_linked_list.c)
# link the new hello_library target with the hello_binary target
target_link_libraries(cstlmp_tests
PRIVATE
cstlmp
)
############################################################
# Enable testing
############################################################
include(CTest)
enable_testing()
# add executable to test
add_test(NAME "cstlmp_tests"
COMMAND cstlmp_tests)