1 # Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 cmake_minimum_required(VERSION 2.8)
19 set(IOTJS_VERSION_MAJOR 0)
20 set(IOTJS_VERSION_MINOR 1)
22 # Do a few default checks
23 if(NOT DEFINED PLATFORM_DESCRIPTOR)
24 message(FATAL_ERROR "No PLATFORM_DESCRIPTOR specified (format: <arch>-<os>)")
27 string(REPLACE "-" ";" PLATFORM_ARGS ${PLATFORM_DESCRIPTOR})
28 if(NOT DEFINED TARGET_OS)
29 list(GET PLATFORM_ARGS 1 TARGET_OS)
31 "TARGET_OS not specified, using '${TARGET_OS}' from PLATFORM_DESCRIPTOR")
33 string(TOUPPER "${TARGET_OS}" TARGET_OS)
35 if(NOT CMAKE_BUILD_TYPE)
36 message("CMAKE_BUILD_TYPE was not set! Configuring for Debug build!")
37 set(CMAKE_BUILD_TYPE Debug)
40 if(NOT DEFINED BUILD_LIB_ONLY)
41 set(BUILD_LIB_ONLY OFF)
44 if(NOT DEFINED ENABLE_SNAPSHOT)
45 message("Snapshot mode force enabled")
46 set(ENABLE_SNAPSHOT ON)
49 if(NOT DEFINED ENABLE_LTO)
50 message("LTO force disabled")
54 set(ROOT_DIR ${CMAKE_SOURCE_DIR})
56 # Common compile flags
65 include(ExternalProject)
67 # Include external projects
68 include(cmake/jerry.cmake)
69 include(cmake/http-parser.cmake)
70 include(cmake/libtuv.cmake)
72 include(cmake/iotjs.cmake)