1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5 SET(EXEC_PREFIX "${PREFIX}/bin")
6 SET(LIBDIR ${LIB_INSTALL_DIR})
7 SET(INCLUDEDIR "${PREFIX}/include")
18 INCLUDE(FindPkgConfig)
19 pkg_check_modules(gdbus REQUIRED
24 FOREACH(flag ${gdbus_CFLAGS})
25 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
28 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
31 ADD_LIBRARY(${PROJECT_NAME} SHARED ${libgdbus_SRCS})
32 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${gdbus_LDFLAGS} "-ldl" pthread)
33 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
34 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION})
35 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME gdbus)
38 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
41 FOREACH(flag ${gdbus_INCLUDE_DIRS})
42 SET(GDBUS_INCLUDEDIR "${GDBUS_INCLUDEDIR} -I${flag}")
45 FOREACH(flag ${gdbus_LIBRARIES})
46 SET(GDBUS_LIBS "${GDBUS_LIBS} -l${flag}")
49 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
50 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
53 FOREACH(hfile ${HEADERS})
54 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})