-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
56 lines (42 loc) · 1.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 2.6)
project (sdk-core)
# set the version number.
set (SDK_VERSION_MAJOR 0)
set (SDK_VERSION_MINOR 1)
# bring in the headers
include_directories(src/include)
include_directories(src/WolfSSL)
#find_package(PkgConfig REQUIRED)
#pkg_search_module(OPENSSL REQUIRED openssl)
find_package (Threads REQUIRED)
file(GLOB_RECURSE SOURCES "src/*.c")
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
include_directories("${PROJECT_BINARY_DIR}")
set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_BUILD_TYPE Release)
#find_program(iwyu_path NAMES iwyu-tool iwyu-fix-includes)
#if(NOT iwyu_path)
# message(FATAL_ERROR "Could not find the program include-what-you-use")
#endif()
# add options for warnings
if(UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Weverything -fsanitize=address -fsanitize=leak -Wno-padded -Wno-zero-length-array -Wno-unused-parameter -ferror-limit=50")
endif()
endif()
# add the executable
# add_executable(sdk-xyo ${SOURCES})
ADD_LIBRARY(sdk-xyo STATIC ${SOURCES})
target_link_libraries(sdk-xyo ${OPENSSL_LIBRARIES})
target_link_libraries (sdk-xyo ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (sdk-xyo wolfssl)
set_property(TARGET sdk-xyo PROPERTY C_INCLUDE_WHAT_YOU_USE ${iwyu_path})
INSTALL(TARGETS sdk-xyo
DESTINATION "lib"
)
INSTALL (
DIRECTORY ${CMAKE_SOURCE_DIR}/src/
DESTINATION "include/xyo"
FILES_MATCHING PATTERN "*.h*")