1 cmake_minimum_required(VERSION 2.6)
2 PROJECT(print-service C CXX)
5 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
6 SET(EXEC_PREFIX "\${prefix}")
7 SET(LIBDIR "\${prefix}/lib")
8 SET(INCLUDEDIR "\${prefix}/include")
10 SET(VERSION "${VERSION_MAJOR}.0.1")
14 message(cmake install prefix : ${CMAKE_INSTALL_PREFIX})
17 FILE(GLOB SRCS src/*.c)
19 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
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)
25 FOREACH(flag ${utils_pkgs_CFLAGS})
26 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
29 LINK_DIRECTORIES(/usr/lib)
32 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functions")
33 #SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DEXPORT_API=\"\" ")
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}")
39 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
40 ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
41 ADD_DEFINITIONS("-DDATAFS=\"$ENV{DATAFS}\"")
42 ADD_DEFINITIONS("-Wall") #enable all warnings
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})
48 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lcups)
50 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
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")
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}")
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/)
68 ADD_SUBDIRECTORY(getppd)