-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
24 lines (16 loc) · 950 Bytes
/
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
project(codal-mbedos)
include("${CODAL_UTILS_LOCATION}")
# find sources and headers
RECURSIVE_FIND_DIR(TOP_LEVEL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/inc" "*.h")
RECURSIVE_FIND_DIR(INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/${CODAL_OUTPUT_NAME}/inc" "*.h")
RECURSIVE_FIND_FILE(TOP_LEVEL_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/source" "*.c??")
RECURSIVE_FIND_FILE(OBJECT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${CODAL_OUTPUT_NAME}/lib" "*.o")
RECURSIVE_FIND_FILE(ARCHIVE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${CODAL_OUTPUT_NAME}/lib" "*.a")
# add them
include_directories(${TOP_LEVEL_INCLUDE_DIRS} ${INCLUDE_DIRS})
# create our target
add_library(codal-mbedos ${TOP_LEVEL_SOURCE})
target_link_libraries(codal-mbedos codal-core ${OBJECT_FILES} ${ARCHIVE_FILES})
#set_target_properties(codal-mbedos PROPERTIES LINKER_LANGUAGE CXX)
# expose it to parent cmake.
target_include_directories(codal-mbedos PUBLIC ${TOP_LEVEL_INCLUDE_DIRS} ${INCLUDE_DIRS})