async library for manda (adaptive backend manager protocol)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

57 lines
2.1 KiB

  1. CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
  2. cmake_policy(VERSION 2.6.0)
  3. SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
  4. INCLUDE(CheckIncludeFiles)
  5. INCLUDE(CheckLibraryExists)
  6. INCLUDE(FindPkgConfig)
  7. MACRO(ADD_TARGET_PROPERTIES _target _name _properties)
  8. SET(_properties ${ARGV})
  9. LIST(REMOVE_AT _properties 0)
  10. LIST(REMOVE_AT _properties 0)
  11. GET_TARGET_PROPERTY(_old_properties ${_target} ${_name})
  12. #MESSAGE("adding property to ${_target} ${_name}: ${_properties}")
  13. IF(NOT _old_properties)
  14. # in case it's NOTFOUND
  15. SET(_old_properties)
  16. ELSE(NOT _old_properties)
  17. SET(_old_properties "${_old_properties} ")
  18. ENDIF(NOT _old_properties)
  19. SET_TARGET_PROPERTIES(${_target} PROPERTIES ${_name} "${_old_properties}${_properties}")
  20. ENDMACRO(ADD_TARGET_PROPERTIES)
  21. PROJECT(libmanda)
  22. SET(PACKAGE_VERSION 0.1.0)
  23. IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
  24. SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
  25. ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
  26. # GLIB 2
  27. pkg_check_modules (GLIB2 REQUIRED glib-2.0)
  28. SET(GLIB_INCLUDES ${GLIB2_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS}/glib-2.0/ ${GLIB2_INCLUDE_DIRS}/glib-2.0/include/)
  29. INCLUDE_DIRECTORIES(${GLIB_INCLUDES})
  30. SET(MAIN_SOURCE libmanda.c idlist.c)
  31. SET(PACKAGE_NAME ${CMAKE_PROJECT_NAME})
  32. SET(PACKAGE_VERSION ${PACKAGE_VERSION})
  33. CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libmanda-config.h.cmake ${CMAKE_BINARY_DIR}/libmanda-config.h ESCAPE_QUOTES)
  34. ADD_DEFINITIONS(-DHAVE_CONFIG_H)
  35. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
  36. add_library(manda SHARED ${MAIN_SOURCE})
  37. ADD_TARGET_PROPERTIES(manda COMPILE_FLAGS "-std=gnu99 -Wall -g -Wshadow -W -pedantic -fPIC -D_GNU_SOURCE")
  38. # GLIB 2
  39. ADD_TARGET_PROPERTIES(manda LINK_FLAGS "${GLIB2_LDFLAGS}")
  40. ADD_TARGET_PROPERTIES(manda COMPILE_FLAGS "${GLIB2_CFLAGS_OTHER}")
  41. INSTALL(TARGETS manda DESTINATION lib EXPORT libmanda)
  42. INSTALL(FILES manda.h ${CMAKE_CURRENT_BINARY_DIR}/libmanda-config.h DESTINATION include)
  43. INSTALL(EXPORT libmanda DESTINATION lib/libmanda)