From e0c212617784172a2bd73a456e43b53b1828ced5 Mon Sep 17 00:00:00 2001 From: rimio Date: Tue, 27 Feb 2018 22:21:06 +0200 Subject: Describe stub; small fix in array fetch --- CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 957588a..db2b684 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required (VERSION 3.1) project (ecbor LANGUAGES C) +# Options +option (BUILD_DESCRIBE_TOOL "build ecbor-describe" ON) + # Compiler setup set (CMAKE_C_STANDARD 99) @@ -29,8 +32,8 @@ set (LIB_SOURCES "${SRC_DIR}/ecbor_decoder.c" ) -set (TOOL_SOURCES - # TODO +set (DESCRIBE_TOOL_SOURCES + "${SRC_DIR}/ecbor_describe.c" ) # Targets @@ -40,4 +43,10 @@ add_library (${PROJECT_NAME}_static STATIC ${LIB_SOURCES}) set_target_properties (${PROJECT_NAME}_shared PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) set_target_properties (${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) -target_compile_options (${PROJECT_NAME}_static PRIVATE -nostdlib) \ No newline at end of file +target_compile_options (${PROJECT_NAME}_static PRIVATE -nostdlib) + +# Tool Targets +if (BUILD_DESCRIBE_TOOL) + add_executable (${PROJECT_NAME}-describe ${DESCRIBE_TOOL_SOURCES}) + target_link_libraries (${PROJECT_NAME}-describe ${PROJECT_NAME}_shared) +endif (BUILD_DESCRIBE_TOOL) \ No newline at end of file -- cgit v1.2.3