3 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
6 SET(LIBNAME "lib${PROJECT_NAME}")
7 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
8 SET(BINDIR "${PREFIX}/bin")
9 SET(LIBDIR "${PREFIX}/lib")
10 SET(INCLUDEDIR "${PREFIX}/include")
12 SET(VERSION "${VERSION_MAJOR}.1.0")
15 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
16 ADD_DEFINITIONS("-DPKGTYPE=\"${BUILD_PKGTYPE}\"")
18 EXECUTE_PROCESS(COMMAND ../build_util/code_gen.sh)
29 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
31 INCLUDE(FindPkgConfig)
33 pkg_check_modules(LPKGS REQUIRED glib-2.0 sqlite3 dlog db-util xdgmime vconf)
34 STRING(REPLACE ";" " " EXTRA_CFLAGS "${LPKGS_CFLAGS}")
35 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
38 ADD_LIBRARY(${LIBNAME} SHARED ${SRCS})
39 TARGET_LINK_LIBRARIES(${LIBNAME} ${LPKGS_LIBRARIES})
40 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES COMPILE_FLAGS "${EXTRA_CFLAGS}")
41 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "")
42 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${VERSION})
43 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
46 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY)
49 INSTALL(TARGETS ${LIBNAME} DESTINATION ${LIB_INSTALL_DIR})
50 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
51 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/ail.h DESTINATION include)
52 INSTALL(FILES ${CMAKE_SOURCE_DIR}/desktop.conf DESTINATION share/install-info)
55 ADD_SUBDIRECTORY(initdb)