-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
53 lines (44 loc) · 1.38 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
cmake_minimum_required(VERSION 3.5)
cmake_policy(VERSION 3.5)
project(elastos-hive
VERSION 1.0.0
LANGUAGES C)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(HiveDefaults)
include(HivePackages)
include(AddSubModule)
if(WIN32)
set(ENABLE_SHARED_DEFAULT TRUE)
set(ENABLE_STATIC_DEFAULT FALSE)
else()
set(ENABLE_SHARED_DEFAULT TRUE)
set(ENABLE_STATIC_DEFAULT TRUE)
endif()
if(CMAKE_CROSSCOMPILING)
set(ENABLE_APPS_DEFAULT FALSE)
set(ENABLE_TESTS_DEFAULT FALSE)
else()
set(ENABLE_APPS_DEFAULT TRUE)
set(ENABLE_TESTS_DEFAULT TRUE)
endif()
set(ENABLE_SHARED ${ENABLE_SHARED_DEFAULT} CACHE BOOL "Build shared library")
set(ENABLE_STATIC ${ENABLE_STATIC_DEFAULT} CACHE BOOL "Build static library")
set(ENABLE_APPS ${ENABLE_APPS_DEFAULT} CACHE BOOL "Build demo applications")
set(ENABLE_TESTS ${ENABLE_TESTS_DEFAULT} CACHE BOOL "Build test cases")
set(ENABLE_DOCS FALSE CACHE BOOL "Build APIs documentation")
add_subdirectory(deps)
add_subdirectory(src)
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()
if(ENABLE_APPS)
add_subdirectory(apps)
endif()
if(ENABLE_DOCS AND (${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
add_subdirectory(docs)
endif()
# Alias target for package. But it fix issue about making package
# inrelevant to udpatation of cmake scripts.
add_custom_target(dist
COMMAND ${CMAKE_MAKE_PROGRAM} package
COMMENT "Package Hive Distrubtion")