forked from MaJerle/lwcell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
57 lines (47 loc) · 1.79 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
57
cmake_minimum_required(VERSION 3.22)
# Setup project
project(LwLibPROJECT)
# -------------------------------------------------
# This CMakeLists.txt is used only if it is a top-level file.
# Purpose of it is to be able to compile project in standalone way only
#
# When library sources are to be included in another project
# user shall use /lwgsm/CMakeLists.txt instead
if (NOT PROJECT_IS_TOP_LEVEL)
message(FATAL_ERROR "This CMakeLists.txt can only be used as top-level. Use /lwgsm/CMakeLists.txt for library include purpose")
endif()
# Set as executable
add_executable(${PROJECT_NAME})
# Add key executable block
target_sources(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/dev/main.c
# Development additional files
${CMAKE_CURRENT_LIST_DIR}/lwgsm/src/system/lwgsm_mem_lwmem.c
${CMAKE_CURRENT_LIST_DIR}/../lwmem/lwmem/src/lwmem/lwmem.c
${CMAKE_CURRENT_LIST_DIR}/../lwmem/lwmem/src/system/lwmem_sys_win32.c
# Port specific
${CMAKE_CURRENT_LIST_DIR}/lwgsm/src/system/lwgsm_sys_win32.c
${CMAKE_CURRENT_LIST_DIR}/lwgsm/src/system/lwgsm_ll_win32.c
)
# Add key include paths
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/dev
${CMAKE_CURRENT_LIST_DIR}/../lwmem/lwmem/src/include
# Port specific
${CMAKE_CURRENT_LIST_DIR}/lwgsm/src/include/system/port/win32
)
# Compilation definition information
target_compile_definitions(${PROJECT_NAME} PUBLIC
WIN32
_DEBUG
CONSOLE
LWGSM_DEV
)
# Add subdir with lwgsm and link to the project
add_subdirectory("lwgsm")
target_link_libraries(${PROJECT_NAME} lwgsm)
target_link_libraries(${PROJECT_NAME} lwgsm_api)
target_link_libraries(${PROJECT_NAME} lwgsm_apps)
add_subdirectory("snippets")
target_link_libraries(${PROJECT_NAME} lwgsm_snippets)