# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # @file CMakeLists.txt # @author Kyungwook Tak (k.tak@samsung.com) # @brief csr-framework project cmake file on the top # CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(${SERVICE_NAME}) INCLUDE(FindPkgConfig) SET(CMAKE_C_FLAGS_PROFILING "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE") SET(CMAKE_CXX_FLAGS_PROFILING "-g -std=c++0x -O0 -pg -Wp,-U_FORTIFY_SOURCE") SET(CMAKE_C_FLAGS_DEBUG "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE") SET(CMAKE_CXX_FLAGS_DEBUG "-g -std=c++0x -O0 -ggdb -Wp,-U_FORTIFY_SOURCE") SET(CMAKE_C_FLAGS_RELEASE "-g -O2 -DNDEBUG") SET(CMAKE_CXX_FLAGS_RELEASE "-g -std=c++0x -O2 -DNDEBUG") SET(CMAKE_C_FLAGS_CCOV "-g -O2 --coverage") SET(CMAKE_CXX_FLAGS_CCOV "-g -std=c++0x -O2 --coverage") ADD_DEFINITIONS("-fPIC") ADD_DEFINITIONS("-Werror") ADD_DEFINITIONS("-Wall") ADD_DEFINITIONS("-Wextra") STRING(REGEX MATCH "([^.]*)" API_VERSION "${VERSION}") ADD_DEFINITIONS("-DSERVICE_NAME=\"${SERVICE_NAME}\"") ADD_DEFINITIONS("-DSMACK_DOMAIN_NAME=\"${SMACK_DOMAIN_NAME}\"") ADD_DEFINITIONS("-DINCLUDE_INSTALL_DIR=\"${INCLUDE_INSTALL_DIR}\"") ADD_DEFINITIONS("-DBIN_DIR=\"${BIN_DIR}\"") ADD_DEFINITIONS("-DRO_DBSPACE=\"${RO_DBSPACE}\"") ADD_DEFINITIONS("-DRW_DBSPACE=\"${RW_DBSPACE}\"") ADD_DEFINITIONS("-DSERVICE_IDLE_TIMEOUT_TIME=${SERVICE_IDLE_TIMEOUT_TIME}") ADD_DEFINITIONS("-DPOPUP_SERVICE_IDLE_TIMEOUT_TIME=${POPUP_SERVICE_IDLE_TIMEOUT_TIME}") ADD_DEFINITIONS("-DPOPUP_SERVICE_ENV_FILE_PATH=\"${POPUP_SERVICE_ENV_FILE_PATH}\"") ADD_DEFINITIONS("-DENGINE_RW_WORKING_DIR=\"${ENGINE_RW_WORKING_DIR}\"") ADD_DEFINITIONS("-DENGINE_DIR=\"${ENGINE_DIR}\"") ADD_DEFINITIONS("-DTEST_DIR=\"${TEST_DIR}\"") ADD_DEFINITIONS("-DTEST_RES_DIR=\"${TEST_RES_DIR}\"") ADD_DEFINITIONS("-DDEFAULT_ICON_PATH=\"${RO_RES_DIR}/default-icon.png\"") IF (CMAKE_BUILD_TYPE MATCHES "DEBUG") ADD_DEFINITIONS("-DTIZEN_DEBUG_ENABLE") ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG") ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG") SET(TARGET_CSR_SERVER ${SERVICE_NAME}-server) SET(TARGET_CSR_CLIENT ${SERVICE_NAME}-client) SET(TARGET_CSR_COMMON ${SERVICE_NAME}-common) SET(TARGET_CSR_POPUP ${SERVICE_NAME}-popup) SET(TARGET_CSR_TEST ${SERVICE_NAME}-test) SET(TARGET_CSR_TEST_COMMON ${SERVICE_NAME}-test-common) SET(TARGET_CSR_INTERNAL_TEST ${SERVICE_NAME}-internal-test) SET(TARGET_CSR_POPUP_TEST ${SERVICE_NAME}-popup-test) SET(TARGET_CSR_THREADPOOL_TEST ${SERVICE_NAME}-threadpool-test) SET(TARGET_CSR_CS_ENGINE ${SERVICE_NAME}-cs-engine) SET(TARGET_CSR_WP_ENGINE ${SERVICE_NAME}-wp-engine) ADD_DEFINITIONS("-DCS_ENGINE_PATH=\"${ENGINE_DIR}/lib${TARGET_CSR_CS_ENGINE}.so\"") ADD_DEFINITIONS("-DWP_ENGINE_PATH=\"${ENGINE_DIR}/lib${TARGET_CSR_WP_ENGINE}.so\"") SET(LOCALEDIR "${RO_DATA_DIR}/locale") CONFIGURE_FILE(packaging/${SERVICE_NAME}-client.manifest.in ${SERVICE_NAME}-client.manifest @ONLY) CONFIGURE_FILE(packaging/${SERVICE_NAME}-common.manifest.in ${SERVICE_NAME}-common.manifest @ONLY) IF (PLATFORM_VERSION_3) ADD_DEFINITIONS("-DPLATFORM_VERSION_3") ADD_DEFINITIONS("-DTZ_SYS_STORAGE=\"${TZ_SYS_STORAGE}\"") ADD_DEFINITIONS("-DTZ_SYS_RW_APP=\"${TZ_SYS_RW_APP}\"") ADD_DEFINITIONS("-DTZ_SYS_RO_APP=\"${TZ_SYS_RO_APP}\"") CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.in ${SERVICE_NAME}.manifest @ONLY) CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.in ${SERVICE_NAME}-test.manifest @ONLY) CONFIGURE_FILE(data/scripts/${SERVICE_NAME}-upgrade.sh.in data/scripts/${SERVICE_NAME}-upgrade.sh @ONLY) ELSE (PLATFORM_VERSION_3) CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.smack.in ${SERVICE_NAME}.manifest @ONLY) CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.smack.in ${SERVICE_NAME}-test.manifest @ONLY) ENDIF (PLATFORM_VERSION_3) IF (DEFINED DETAILED_URL_BASE) MESSAGE("Use base of detailed url: ${DETAILED_URL_BASE}") ADD_DEFINITIONS("-DDETAILED_URL_BASE=\"${DETAILED_URL_BASE}\"") ENDIF (DEFINED DETAILED_URL_BASE) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(pkgconfig) ADD_SUBDIRECTORY(systemd) ADD_SUBDIRECTORY(test)