2018-07-23 15:21:31 +00:00
|
|
|
|
|
|
|
# Copyright (C) 2016, Canonical Ltd.
|
|
|
|
# All rights reserved.
|
|
|
|
|
|
|
|
# This source code is licensed under the BSD-style license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.8.11)
|
|
|
|
|
|
|
|
set(APP_NAME StatusIm)
|
|
|
|
set(REACT_BUILD_STATIC_LIB ON)
|
|
|
|
|
2018-08-12 21:29:55 +00:00
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
|
|
|
|
|
2018-07-23 15:21:31 +00:00
|
|
|
message(STATUS "EXTERNAL_MODULES_DIR: ${EXTERNAL_MODULES_DIR}")
|
|
|
|
|
2018-09-05 08:54:11 +00:00
|
|
|
string(REGEX MATCH "BUILD_FOR_BUNDLE" BUILD_FOR_BUNDLE "${CMAKE_CXX_FLAGS}")
|
2018-09-27 15:10:43 +00:00
|
|
|
if(${BUILD_FOR_BUNDLE} MATCHES "BUILD_FOR_BUNDLE")
|
|
|
|
set(ENVFILE "/.env")
|
|
|
|
else()
|
|
|
|
set(ENVFILE "/../../.env")
|
|
|
|
endif()
|
2018-09-05 08:54:11 +00:00
|
|
|
|
2018-07-23 15:21:31 +00:00
|
|
|
foreach(external_module ${EXTERNAL_MODULES_DIR})
|
|
|
|
message(STATUS "external_module: ${external_module}")
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../${external_module} ${CMAKE_CURRENT_BINARY_DIR}/${external_module})
|
|
|
|
endforeach(external_module)
|
|
|
|
|
2018-08-29 22:45:19 +00:00
|
|
|
add_subdirectory(reportApp)
|
|
|
|
|
2018-07-23 15:21:31 +00:00
|
|
|
# APPLICATION_MAIN_CPP_PATH contains absolute path to generated template copy of main.cpp for application executable
|
|
|
|
get_filename_component(APPLICATION_MAIN_CPP_PATH main.cpp ABSOLUTE)
|
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../node_modules/react-native/React/Layout)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../node_modules/react-native/ReactQt/runtime/src ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../node_modules/react-native/ReactQt/application/src ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
set(RUN_SCRIPT_FILE_NAME "run-app.bat")
|
|
|
|
else()
|
|
|
|
set(RUN_SCRIPT_FILE_NAME "run-app.sh")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
${RUN_SCRIPT_FILE_NAME}.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${RUN_SCRIPT_FILE_NAME}
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|