-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
56 lines (45 loc) · 1.67 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
# Global config ---------------------------------------------------------------
cmake_minimum_required (VERSION 3.5)
project (ca821x-api-lib)
# Set configuration variables -------------------------------------------------
set(CASCODA_CA_VERS 8210 8211)
set(CASCODA_CA_VER 8211 CACHE STRING "The CAxxxx chip number of the target part")
set_property(CACHE CASCODA_CA_VER PROPERTY STRINGS ${CASCODA_CA_VERS})
if(NOT CASCODA_CA_VER IN_LIST CASCODA_CA_VERS)
message(FATAL_ERROR "CASCODA_CA_VER must be one of ${CASCODA_CA_VERS}")
endif()
# Config file generation ------------------------------------------------------
configure_file(
"${PROJECT_SOURCE_DIR}/include/ca821x_config.h.in"
"${PROJECT_BINARY_DIR}/include/ca821x_config.h"
)
# Main library config ---------------------------------------------------------
add_library(ca821x-api
${PROJECT_SOURCE_DIR}/source/ca821x_api.c
)
target_include_directories(ca821x-api
PUBLIC
${PROJECT_SOURCE_DIR}/include
${PROJECT_BINARY_DIR}/include
)
# Test15-4 library ------------------------------------------------------------
add_library(test15-4-api
${PROJECT_SOURCE_DIR}/test15_4/source/test15_4_phy_tests.c
${PROJECT_SOURCE_DIR}/test15_4/source/test15_4_phy_tests_mac.c
)
target_include_directories(test15-4-api
PUBLIC
${PROJECT_SOURCE_DIR}/test15_4/include
)
target_link_libraries(test15-4-api
PUBLIC
ca821x-api
)
# Test app config -------------------------------------------------------------
add_executable(test_app
${PROJECT_SOURCE_DIR}/test/test.c
)
target_link_libraries(test_app ca821x-api)
# Run tests -------------------------------------------------------------------
include(CTest)
add_test(TestAppPasses test_app)