1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(notification-ex CXX)
4 SET(PREFIX "${CMAKE_INSTALL_PREFIX}")
5 SET(EXEC_PREFIX "\${prefix}")
6 SET(PROJECT_NAME "${PROJECT_NAME}")
7 SET(LIBDIR ${LIB_INSTALL_DIR})
8 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
10 SET(VERSION "${VERSION_MAJOR}.0.0")
12 INCLUDE(FindPkgConfig)
13 pkg_check_modules(notification-ex REQUIRED
17 capi-appfw-app-control
19 capi-appfw-package-manager
28 FOREACH(flag ${notification-ex_CFLAGS})
29 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
31 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline -std=c++11")
33 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
34 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
35 SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
37 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
38 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/api)
40 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCES)
41 ADD_LIBRARY (${PROJECT_NAME} SHARED ${SOURCES})
42 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
43 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
45 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${notification-ex_LDFLAGS} "-lpthread")
47 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
48 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
50 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
51 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
52 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION include/${PROJECT_NAME}
53 FILES_MATCHING PATTERN "*.h")
54 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/api DESTINATION include/${PROJECT_NAME}
55 FILES_MATCHING PATTERN "*.h")