diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 12 insertions, 3 deletions
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 |
