CMakeLists.txt 773 B

123456789101112131415161718192021222324
  1. cmake_minimum_required(VERSION 2.6)
  2. set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
  3. project(libgluonutil C)
  4. set(LIBDIR "lib${LIB_SUFFIX}")
  5. find_package(JSON_C REQUIRED)
  6. set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
  7. add_library(gluonutil SHARED libgluonutil.c)
  8. set_property(TARGET gluonutil PROPERTY COMPILE_FLAGS "-Wall -std=c99 ${JSON_C_CFLAGS_OTHER}")
  9. set_property(TARGET gluonutil PROPERTY LINK_FLAGS "${JSON_C_LDFLAGS_OTHER}")
  10. set_property(TARGET gluonutil APPEND PROPERTY INCLUDE_DIRECTORIES ${JSON_C_INCLUDE_DIR})
  11. target_link_libraries(gluonutil ${JSON_C_LIBRARIES})
  12. install(TARGETS gluonutil
  13. ARCHIVE DESTINATION ${LIBDIR}
  14. LIBRARY DESTINATION ${LIBDIR}
  15. )
  16. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libgluonutil.h DESTINATION include)