-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
44 lines (39 loc) · 1.88 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
#------------------------------------------------------------------------------
# Top-level CMake file for libuzmtp
#------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.20)
project(libuzmtp)
#------------------------------------------------------------------------------
# Helpful SETS
#------------------------------------------------------------------------------
set(FIXTURE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/test/integration/fixture")
set(EXTERNAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external")
set(DOWNLOAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dl")
set(CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
set(CMAKE_EXTERNAL "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT EXISTS EXTERNAL_DIR)
FILE(MAKE_DIRECTORY ${EXTERNAL_DIR})
endif()
#------------------------------------------------------------------------------
# helper modules
#------------------------------------------------------------------------------
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
include(${CMAKE_MODULES_DIR}/MakeAbsolute.cmake)
include(${CMAKE_MODULES_DIR}/ExtractChecked.cmake)
include(${CMAKE_DIR}/supported_platforms.cmake)
#------------------------------------------------------------------------------
# Package options
#------------------------------------------------------------------------------
option(UZMTP_ENABLE_TESTING "build libuzmtp tests" OFF)
#------------------------------------------------------------------------------
# Platform detection
#------------------------------------------------------------------------------
if(DEFINED ZEPHYR_BASE)
message(STATUS "Detected Zephyr platform")
include(${CMAKE_DIR}/build_zephyr.cmake)
else()
message(STATUS "Assuming Linux platform")
include(${CMAKE_DIR}/build_linux.cmake)
endif()