-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
56 lines (47 loc) · 1.38 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
set(MY_CMAKE_VERSION 3.5.1)
cmake_minimum_required(VERSION ${MY_CMAKE_VERSION})
project(cmsis-posix-project
VERSION 1.0.0
DESCRIPTION "cmsis-posix"
LANGUAGES C CXX
)
enable_testing()
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
add_compile_definitions(OS_POSIX)
set(CMSIS_INTERFACE_DIR "${PROJECT_SOURCE_DIR}/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2")
set(CMSIS_IMPL_INTERFACE_DIR "${PROJECT_SOURCE_DIR}/src/include")
if (DEFINED CMSIS_POSIX_OPTION_FILEPATH)
include(${CMSIS_POSIX_OPTION_FILEPATH})
else()
message(STATUS "CMSIS_POSIX_OPTION_FILEPATH is not defined")
include(default-cmake-options.cmake)
endif()
message(STATUS "BUILD_TYPE " ${BUILD_TYPE})
message(STATUS "GCOV " ${GCOV})
add_subdirectory(src)
if (test)
add_subdirectory(test)
endif()
set(INSTALL_CMAKE_DIR ${PROJECT_SOURCE_DIR}/public)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/src/include/
DESTINATION ${INSTALL_CMAKE_DIR}/include
)
install(
DIRECTORY ${CMSIS_INTERFACE_DIR}/
DESTINATION ${INSTALL_CMAKE_DIR}/include
)
install(
TARGETS cmsis
DESTINATION ${INSTALL_CMAKE_DIR}
EXPORT cmsis-export
LIBRARY DESTINATION lib
INCLUDES DESTINATION include
PUBLIC_HEADER DESTINATION include
)
install(
EXPORT cmsis-export
FILE cmsis-config.cmake
DESTINATION ${INSTALL_CMAKE_DIR}
EXPORT_LINK_INTERFACE_LIBRARIES
)