2017-11-30 21:00:47 +01:00
|
|
|
cmake_minimum_required (VERSION 3.2.0)
|
|
|
|
|
|
|
|
SET(CMAKE_COLOR_MAKEFILE ON)
|
|
|
|
|
2017-12-13 12:09:04 +01:00
|
|
|
include("../cmake/FindCheck.cmake")
|
|
|
|
|
2017-11-30 21:00:47 +01:00
|
|
|
project(linkedlist C)
|
|
|
|
|
|
|
|
add_definitions("-Wall")
|
|
|
|
|
|
|
|
add_library(linkedlist linkedlist.c)
|
|
|
|
|
2017-12-13 12:09:04 +01:00
|
|
|
include_directories(${CHECK_INCLUDE_DIR})
|
|
|
|
|
|
|
|
if (CHECK_FOUND)
|
2017-12-13 12:18:20 +01:00
|
|
|
find_package(Threads REQUIRED)
|
2017-12-13 12:09:04 +01:00
|
|
|
enable_testing()
|
|
|
|
add_executable(test_list check_linkedlist linkedlist)
|
|
|
|
target_compile_options(test_list PRIVATE -pthread)
|
2017-12-13 12:18:20 +01:00
|
|
|
target_link_libraries(test_list ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
2017-12-13 12:09:04 +01:00
|
|
|
add_test(test_list test_list)
|
|
|
|
endif (CHECK_FOUND)
|