You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.5 kB

9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #Licensed under the MIT license. See LICENSE file in the project root for full license information.
  2. cmake_minimum_required(VERSION 2.8.11)
  3. project(json-c)
  4. if(MSVC)
  5. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4100 /wd4996 /wd4244 /wd4706 /wd4702 /wd4127 /wd4701")
  6. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4100 /wd4996 /wd4244 /wd4706 /wd4702 /wd4127 /wd4701")
  7. elseif(LINUX)
  8. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
  9. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
  10. endif()
  11. include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
  12. file(COPY ./config.h.win32 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/)
  13. file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/include/config.h.win32 ${CMAKE_CURRENT_BINARY_DIR}/include/config.h)
  14. file(COPY ./json_config.h.win32 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/)
  15. file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/include/json_config.h.win32 ${CMAKE_CURRENT_BINARY_DIR}/include/json_config.h)
  16. set(JSON_C_HEADERS
  17. ./json.h
  18. ${CMAKE_CURRENT_BINARY_DIR}/include/config.h
  19. ./json_config.h
  20. ./arraylist.h
  21. ./debug.h
  22. ./json_inttypes.h
  23. ./json_object.h
  24. ./json_object_private.h
  25. ./json_tokener.h
  26. ./json_util.h
  27. ./linkhash.h
  28. ./math_compat.h
  29. ./printbuf.h
  30. ./random_seed.h
  31. )
  32. set(JSON_C_SOURCES
  33. ./arraylist.c
  34. ./debug.c
  35. ./json_object.c
  36. ./json_tokener.c
  37. ./json_util.c
  38. ./linkhash.c
  39. ./printbuf.c
  40. ./random_seed.c
  41. )
  42. add_library(json-c
  43. ${JSON_C_SOURCES}
  44. ${JSON_C_HEADERS}
  45. )