-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-system-system-settings")
-
-PROJECT(${fw_name})
-
-SET(CMAKE_INSTALL_PREFIX /usr)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-
-SET(LIBDIR "${CMAKE_LIBDIR}")
-SET(INC_DIR include)
-INCLUDE_DIRECTORIES(${INC_DIR})
-
-SET(requires "elementary ecore ecore-file dlog vconf appcore-efl capi-base-common glib-2.0 gobject-2.0 fontconfig libxml-2.0 bundle capi-appfw-application pkgmgr pkgmgr-info")
-
-SET(pc_requires "capi-base-common")
-
-IF(TIZEN_WEARABLE)
- ADD_DEFINITIONS(-DTIZEN_WEARABLE)
-ENDIF(TIZEN_WEARABLE)
-IF(TIZEN_MOBILE)
- ADD_DEFINITIONS(-DTIZEN_MOBILE)
-ENDIF(TIZEN_MOBILE)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
+PROJECT(capi-system-system-settings)
INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${requires})
-FOREACH(flag ${${fw_name}_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-IF("${ARCH}" STREQUAL "arm")
- ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
-
-aux_source_directory(src SOURCES)
-ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
-
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${fw_name}
- PROPERTIES
- VERSION ${FULLVER}
- SOVERSION ${MAJORVER}
- CLEAN_DIRECT_OUTPUT 1
-)
-
-# Test application - TC
-#ADD_EXECUTABLE(test TC/test.c)
-#TARGET_LINK_LIBRARIES(test ${fw_name})
-
-#SET_TARGET_PROPERTIES(test PROPERTIES OUTPUT_NAME test_system_settings)
-#INSTALL(TARGETS test DESTINATION /usr/local/bin)
-#---------------------------------------------------------------------
-
-# Test application - TC_gui
-#ADD_EXECUTABLE(test_gui TC_gui/main.c)
-#
-#INCLUDE(FindPkgConfig)
-#pkg_check_modules(test_gui REQUIRED "elementary appcore-efl ecore-imf eina ecore ecore-evas ecore-input")
-#FOREACH(flag ${test_gui_CFLAGS})
-# SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-#ENDFOREACH(flag)
-#
-#TARGET_LINK_LIBRARIES(test_gui ${fw_name})
-#SET_TARGET_PROPERTIES(test_gui PROPERTIES OUTPUT_NAME test_system_settings_gui)
-#INSTALL(TARGETS test_gui DESTINATION /usr/local/bin)
-#---------------------------------------------------------------------
-
-
-
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIBDIR})
-INSTALL(
- DIRECTORY ${INC_DIR}/ DESTINATION include/system
- FILES_MATCHING
- PATTERN "*_private.h" EXCLUDE
- PATTERN "${INC_DIR}/*.h"
- )
-
-SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${pc_requires})
-SET(PC_LDFLAGS -l${fw_name})
-SET(PC_CFLAGS -I\${includedir}/system)
-
-CONFIGURE_FILE(
- capi-system-system-settings.pc.in
- ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
- @ONLY
-)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIBDIR}/pkgconfig)
-
-# INSTALL (TARGETS test DESTINATION bin)
-
-IF(UNIX)
-
-ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
-ADD_CUSTOM_COMMAND(
- DEPENDS clean
- COMMENT "distribution clean"
- COMMAND find
- ARGS .
- -not -name config.cmake -and \(
- -name tester.c -or
- -name Testing -or
- -name CMakeFiles -or
- -name cmake.depends -or
- -name cmake.check_depends -or
- -name CMakeCache.txt -or
- -name cmake.check_cache -or
- -name *.cmake -or
- -name Makefile -or
- -name core -or
- -name core.* -or
- -name gmon.out -or
- -name install_manifest.txt -or
- -name *.pc -or
- -name *~ \)
- | grep -v TC | xargs rm -rf
- TARGET distclean
- VERBATIM
-)
-
-ENDIF(UNIX)
-
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
+
+SET(SETTING_TZONE_SYMLINK_PATH "\"/opt/etc/localtime\"")
+
+SET(EXTRA_FLAGS "-Wall -Werror -fvisibility=hidden")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS} -std=c++14")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+
+PKG_CHECK_MODULES(pkgs REQUIRED dlog vconf fontconfig libxml-2.0 pkgmgr-info
+ alarm-service capi-media-metadata-extractor aul json-glib-1.0 capi-appfw-app-manager
+ capi-appfw-package-manager capi-system-info glib-2.0)
+INCLUDE_DIRECTORIES(${pkgs_INCLUDE_DIRS})
+LINK_DIRECTORIES(${pkgs_LIBRARY_DIRS})
+
+ADD_DEFINITIONS("-D_TZ_SYS_DATA=\"${TZ_SYS_DATA}\"")
+ADD_DEFINITIONS("-D_TZ_SYS_ETC=\"${TZ_SYS_ETC}\"")
+ADD_DEFINITIONS("-D_TZ_SYS_RO_SHARE=\"${TZ_SYS_RO_SHARE}\"")
+ADD_DEFINITIONS("-D_TZ_SYS_SHARE=\"${TZ_SYS_SHARE}\"")
+ADD_DEFINITIONS("-DSST_RES_DIR=\"${SST_RES_DIR}\"")
+
+IF(STDOUT_LOG)
+ ADD_DEFINITIONS("-DSST_STDOUT")
+ENDIF(STDOUT_LOG)
+
+FILE(GLOB SRCS src/*.c)
+SET(COMMON_OBJ "SST_COMMON")
+ADD_LIBRARY(${COMMON_OBJ} OBJECT ${SRCS})
+SET_TARGET_PROPERTIES(${COMMON_OBJ} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
+FILE(GLOB STD_SRCS src/standard_excl/*.c)
+ADD_LIBRARY(${PROJECT_NAME} ${STD_SRCS} $<TARGET_OBJECTS:${COMMON_OBJ}>)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LIBRARIES})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
+
+#FILE(GLOB WEARABLE_SRCS src/wearable_excl/*.c)
+#SET(WEARABLE_LIB "${PROJECT_NAME}-wearable")
+#ADD_LIBRARY(${WEARABLE_LIB} ${WEARABLE_SRCS} $<TARGET_OBJECTS:${COMMON_OBJ}>)
+#TARGET_LINK_LIBRARIES(${WEARABLE_LIB} ${pkgs_LIBRARIES})
+#SET_TARGET_PROPERTIES(${WEARABLE_LIB} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
+#INSTALL(TARGETS ${WEARABLE_LIB} DESTINATION ${LIB_INSTALL_DIR})
+
+FILE(GLOB HEADERS include/*.h)
+INSTALL(FILES ${HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/system)
+
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+INSTALL(FILES ${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+ADD_SUBDIRECTORY(libutil)
+ADD_SUBDIRECTORY(tests)