summaryrefslogtreecommitdiff
path: root/support/CMakeLists.txt
diff options
context:
space:
mode:
author童宗振 <[email protected]>2024-04-15 11:13:08 +0000
committer童宗振 <[email protected]>2024-04-15 11:13:08 +0000
commit8232dd5a3da45c324f898abf1ef609cf0cda668b (patch)
tree7d6e4055bbdd3caf3536fe6e2ffff07be62960a4 /support/CMakeLists.txt
parent8842fa8bdfcb3a96b5b1074e4d4ceefdb4199dfc (diff)
Add maat test
Diffstat (limited to 'support/CMakeLists.txt')
-rw-r--r--support/CMakeLists.txt18
1 files changed, 17 insertions, 1 deletions
diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt
index 7f46d52..c26370f 100644
--- a/support/CMakeLists.txt
+++ b/support/CMakeLists.txt
@@ -100,4 +100,20 @@ set_target_properties(libzlog PROPERTIES
INTERFACE_LINK_DIRECTORIES ${INSTALL_DIR}/lib
INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include
INTERFACE_LINK_LIBRARIES pthread
-) \ No newline at end of file
+)
+
+### cJSON
+ExternalProject_Add(cJSON PREFIX cJSON
+ URL ${CMAKE_CURRENT_SOURCE_DIR}/cJSON-1.7.7.tar.gz
+ URL_MD5 715009c99728bf81d6c97352718650ff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
+ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+ -DBUILD_SHARED_AND_STATIC_LIBS=1)
+
+ExternalProject_Get_Property(cJSON INSTALL_DIR)
+file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
+
+add_library(libcjson SHARED IMPORTED GLOBAL)
+add_dependencies(libcjson cJSON)
+set_property(TARGET libcjson PROPERTY IMPORTED_LOCATION ${INSTALL_DIR}/lib64/libcjson.a)
+set_property(TARGET libcjson PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include) \ No newline at end of file