forked from includeos/IncludeOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (53 loc) · 1.96 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
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.6.0)
#we are only creating libraries for ELF
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
project (includeos C CXX)
option(PROFILE "Compile with startup profilers" OFF)
#Are we executing cmake from conan or locally
#if locally then pull the deps from conanfile.py
#if buiding from conan expect the conanbuildinfo.cmake to already be present
if(CONAN_EXPORTED OR EXISTS ${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) # in conan local cache
# standard conan installation, deps will be defined in conanfile.py
# and not necessary to call conan again, conan is already running
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CONAN_SETTINGS_BUILD_TYPE})
endif()
else() # in user space
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
#Sets the includeos default profile to clang-5.0
if (DEFINED CONAN_PROFILE)
set(CONANPROFILE PROFILE ${CONAN_PROFILE})
endif()
#ordering matters we create opts here
if (PLATFORM)
if (OPTS)
list(APPEND OPTS platform=${PLATFORM})
else()
set(OPTS OPTIONS platform=${PLATFORM})
endif()
endif()
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/develop/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_check(VERSION 1.8.4 REQUIRED)
conan_cmake_run(
CONANFILE conanfile.py
${OPTS}
BASIC_SETUP
${CONANPROFILE}
)
endif()
include(cmake/includeos.cmake)
add_subdirectory(src)
# Install cmake files
install(FILES cmake/linux.service.cmake DESTINATION cmake)
install(FILES cmake/os.cmake DESTINATION cmake)
install(FILES cmake/includeos.cmake DESTINATION cmake)
install(DIRECTORY api/ DESTINATION include/os)