-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (43 loc) · 2.52 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(algorithms VERSION 0.3.0 LANGUAGES C)
include(${CMAKE_CURRENT_SOURCE_DIR}/submodules/cmake-helpers/cmake-helpers/cpp_coverage.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/submodules/cmake-helpers/cmake-helpers/cpp_warnings.cmake)
add_library(${PROJECT_NAME} STATIC)
target_sources(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include/helper/array.h
${CMAKE_CURRENT_SOURCE_DIR}/src/helper/array.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/bits/bits.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/bytes/endianness.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/number/prime.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/number/swap.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/searching/binary_search.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/sorting/mergesort.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/sorting/quicksort.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/sorting/radix.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/string/permutation.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/string/reverse.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/string/strlen.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/string/unique.c
${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/threading/lock.c
${CMAKE_CURRENT_SOURCE_DIR}/src/structures/bit_array.c)
target_include_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)
target_compile_features(${PROJECT_NAME}
PUBLIC
c_std_11)
if (COVERAGE)
message(STATUS "Building algorithms with code coverage")
burda_cmake_helpers_cpp_coverage_add_build_options(${PROJECT_NAME} PRIVATE C)
endif()
burda_cmake_helpers_cpp_warnings_add_pedantic_level(${PROJECT_NAME} PUBLIC C)
install(TARGETS ${PROJECT_NAME}
DESTINATION lib
EXPORT _targets)
export(EXPORT _targets
NAMESPACE burda::
FILE "${PROJECT_NAME}-config.cmake")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
COMPATIBILITY ExactVersion)