e92d6e71a099bbfb5ba648a1331eec09ce13eff7
[apps/core/preloaded/print-service.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 PROJECT(print-service C CXX)
3
4
5 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
6 SET(EXEC_PREFIX "\${prefix}")
7 SET(LIBDIR "\${prefix}/lib")
8 SET(INCLUDEDIR "\${prefix}/include")
9 SET(VERSION_MAJOR 1)
10 SET(VERSION "${VERSION_MAJOR}.0.1")
11 #SET(VERSION 1.0)
12
13
14 message(cmake install prefix : ${CMAKE_INSTALL_PREFIX})
15
16
17 FILE(GLOB SRCS src/*.c)
18
19 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
20
21 INCLUDE(FindPkgConfig)
22 #pkg_check_modules(utils_pkgs REQUIRED ecore eina avahi cups dlog vconf capi-appfw-application)
23 pkg_check_modules(utils_pkgs REQUIRED ecore eina dlog vconf capi-appfw-application)
24
25 FOREACH(flag ${utils_pkgs_CFLAGS})
26         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
27 ENDFOREACH(flag)
28
29 LINK_DIRECTORIES(/usr/lib)
30
31
32 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functions")
33 #SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DEXPORT_API=\"\" ")
34
35 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -I/usr/include/cups/")
36 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
37 MESSAGE("FLAGS: ${CMAKE_C_FLAGS}")
38
39 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
40 ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
41 ADD_DEFINITIONS("-DDATAFS=\"$ENV{DATAFS}\"")
42 ADD_DEFINITIONS("-Wall") #enable all warnings
43
44 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})  
45 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
46 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) 
47
48 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lcups)
49
50 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
51
52 MESSAGE("destination: ${DESTINATION}")
53 INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib )
54 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
55 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/pt_api.h DESTINATION "include/print-service")
56
57 FILE(GLOB samsung_cms "${CMAKE_CURRENT_SOURCE_DIR}/data/samsung/cms/*.cts" )
58 INSTALL(FILES ${samsung_cms} DESTINATION /usr/share/cups/ppd/samsung/cms/)
59 MESSAGE("destination: ${DESTINATION}")
60
61 FILE(GLOB hp_ppds "${CMAKE_CURRENT_SOURCE_DIR}/data/hp/*.drv.gz" )
62 INSTALL(FILES ${hp_ppds} DESTINATION /usr/share/cups/ppd/hp/)
63 FILE(GLOB samsung_ppds "${CMAKE_CURRENT_SOURCE_DIR}/data/samsung/*.drv.gz" )
64 INSTALL(FILES ${samsung_ppds} DESTINATION /usr/share/cups/ppd/samsung/)
65 FILE(GLOB epson_ppds "${CMAKE_CURRENT_SOURCE_DIR}/data/epson/*.drv.gz" )
66 INSTALL(FILES ${epson_ppds} DESTINATION /usr/share/cups/ppd/epson/)
67
68 ADD_SUBDIRECTORY(getppd)
69 ADD_SUBDIRECTORY(TC)