SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(UNITDIR ${UNIT_INSTALL_DIR})
SET(INCLUDEDIR "\${prefix}/include")
# Set required packages
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/)
-SET(ADDITIONAL_CFLAGS "-Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wcast-qual")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ADDITIONAL_CFLAGS}")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wcast-qual -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+
+##Address-Space Layout Randomization
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
ADD_DEFINITIONS("-DFEATURE_TLOG_DEBUG")
ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"DAEMON\"")
ADD_DEFINITIONS ("-DTIZEN_DEBUG_ENABLE")
ENDIF (TIZEN_DEBUG_ENABLE)
+IF (TIZEN_PROFILE_TV)
+ ADD_DEFINITIONS ("-DTIZEN_PROFILE_TV")
+ENDIF (TIZEN_PROFILE_TV)
+
+IF (TIZEN_PROFILE_IVI)
+ ADD_DEFINITIONS ("-DTIZEN_PROFILE_IVI")
+ENDIF (TIZEN_PROFILE_IVI)
MESSAGE(${CMAKE_C_FLAGS})
MESSAGE(${pkgs_LDFLAGS})
# install
INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME telephony-daemon)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/packaging/telephony-daemon.service DESTINATION ${LIBDIR}/systemd/system)
+IF (TIZEN_PROFILE_TV OR TIZEN_PROFILE_IVI)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/packaging/telephony-daemon-on-demand.service DESTINATION ${UNITDIR} RENAME telephony-daemon.service)
+ELSE (TIZEN_PROFILE_TV OR TIZEN_PROFILE_IVI)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/packaging/telephony-daemon.service DESTINATION ${UNITDIR})
+ENDIF (TIZEN_PROFILE_TV OR TIZEN_PROFILE_IVI)