-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (40 loc) · 1.29 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
# 1: Set the minimum required version of CMake to be 3.10
cmake_minimum_required(VERSION 3.10)
project(mikelibc
VERSION 1.0.5
DESCRIPTION "Mike's personal C library"
HOMEPAGE_URL https://github.com/msoulier/mikelibc
LANGUAGES C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
add_library(mike STATIC
madt.c mbase64.c mdebug.c mikelib.c mlog.c mnet.c mstr.c mutil.c)
target_link_libraries(mike PUBLIC ssl crypto curl pthread)
target_include_directories(mike
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR})
add_compile_definitions(MIKELIBC_THREADS=1)
target_compile_definitions(mike PUBLIC
$<$<CONFIG:Debug>:
MDEBUG=1
>)
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
add_executable(mb64
mb64.c)
target_link_libraries(mb64 mike)
add_executable(sha1
sha1.c)
target_link_libraries(sha1 mike)
add_executable(muri
muri.c)
target_link_libraries(muri mike)
add_executable(bins
bins.c)
target_link_libraries(bins mike)
add_executable(flink
flink.c)
target_link_libraries(flink mike)
message("mikelibc CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/t ${CMAKE_CURRENT_BINARY_DIR}/t)