cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 2bd1e80f6c72667b5cc7b8603d38cd0f96249ad6
parent 7632993ebe6343a92166375f5b7d86541b96e558
Author: Kevin Branigan <kbranigan@gmail.com>
Date:   Wed, 15 Jul 2015 10:34:08 -0400

Merge pull request #8 from anton-sergeev/master

Add CMakeLists.txt

Diffstat:
ACMakeLists.txt | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 2.8) + +set(PROJECT cJSON) + +project(${PROJECT} C) + +file(GLOB HEADERS cJSON.h) +set(SOURCES cJSON.c) + +add_library(${PROJECT} STATIC ${HEADERS} ${SOURCES}) +target_link_libraries(${PROJECT} m) + +add_library(${PROJECT}.shared SHARED ${HEADERS} ${SOURCES}) +set_target_properties(${PROJECT}.shared PROPERTIES OUTPUT_NAME cJSON) +target_link_libraries(${PROJECT}.shared m) + + +option(ENABLE_CJSON_TEST "Enable building cJSON test" OFF) +if(ENABLE_CJSON_TEST) + set(TEST_NAME cJSON_test) + add_executable(${TEST_NAME} test.c) + target_link_libraries(${TEST_NAME} ${PROJECT}) +endif()