-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,32 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
# Debug message | ||
message("LWOW: Entering lib source CMakeLists.txt") | ||
message("Entering ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt") | ||
|
||
# Set library name | ||
set(LWOW_LIB_NAME "lwow") | ||
|
||
# Check definitions of some key things | ||
option(LWOW_SYS_ADD_FILES "Include system architecture files coming with the library" ON) | ||
option(LWOW_SYS_ARCH "Architecture to use for file include" "win32") | ||
option(LWOW_LL_ADD_FILES "Include low-level driver files coming with the library" ON) | ||
option(LWOW_LL_ARCH "Architecture to use for file include" "win32") | ||
option(LWOW_DEV_ADD_DS18X20 "Include DS18x20 device driver to build" ON) | ||
message("LWOW: LWOW_SYS_ADD_FILES set to: " ${LWOW_SYS_ADD_FILES}) | ||
message("LWOW: LWOW_SYS_ARCH set to: " ${LWOW_SYS_ARCH}) | ||
message("LWOW: LWOW_LL_ADD_FILES set to: " ${LWOW_LL_ADD_FILES}) | ||
message("LWOW: LWOW_LL_ARCH set to: " ${LWOW_LL_ARCH}) | ||
message("LWOW: LWOW_DEV_ADD_DS18X20 set to: " ${LWOW_DEV_ADD_DS18X20}) | ||
|
||
# Register library to the system | ||
add_library(${LWOW_LIB_NAME} INTERFACE) | ||
|
||
# Setup generic source files | ||
target_sources(${LWOW_LIB_NAME} PUBLIC | ||
# Library core sources | ||
set(lwow_core_SRCS | ||
${CMAKE_CURRENT_LIST_DIR}/src/lwow/lwow.c | ||
) | ||
|
||
# Devices | ||
set(lwow_devices_SRCS | ||
${CMAKE_CURRENT_LIST_DIR}/src/devices/lwow_device_ds18x20.c | ||
) | ||
|
||
# Setup include directories | ||
target_include_directories(${LWOW_LIB_NAME} INTERFACE | ||
set(lwow_include_DIRS | ||
${CMAKE_CURRENT_LIST_DIR}/src/include | ||
) | ||
|
||
# Add optional sources | ||
if (LWOW_SYS_ADD_FILES) | ||
target_sources(${LWOW_LIB_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/src/system/lwow_sys_${LWOW_SYS_ARCH}.c | ||
) | ||
endif() | ||
if (LWOW_LL_ADD_FILES) | ||
target_sources(${LWOW_LIB_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/src/system/lwow_ll_${LWOW_LL_ARCH}.c | ||
) | ||
endif() | ||
if (LWOW_DEV_ADD_DS18X20) | ||
target_sources(${LWOW_LIB_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/src/devices/lwow_device_ds18x20.c | ||
) | ||
endif() | ||
# Register core library to the system | ||
add_library(lwow INTERFACE) | ||
target_sources(lwow PUBLIC ${lwow_core_SRCS}) | ||
target_include_directories(lwow INTERFACE ${lwow_include_DIRS}) | ||
|
||
# Register API to the system | ||
add_library(lwow_devices INTERFACE) | ||
target_sources(lwow_devices PUBLIC ${lwow_devices_SRCS}) | ||
target_include_directories(lwow_devices INTERFACE ${lwow_include_DIRS}) | ||
|
||
# Debug message | ||
message("Exiting ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt") |