-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
29 lines (25 loc) · 1.18 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This software is distributed under the terms of the MIT License.
# Copyright (C) OpenCyphal Development Team <opencyphal.org>
# Copyright Amazon.com Inc. or its affiliates.
# SPDX-License-Identifier: MIT
# Author: Pavel Kirienko <[email protected]>
#
# This file is only needed for library development and testing. It is not needed to use the library in your project;
# instead, users should integrate the library by copying its source files.
cmake_minimum_required(VERSION 3.20)
project(udpard)
enable_testing()
# Shared Clang-Format target for all subprojects.
find_program(clang_format NAMES clang-format)
if (NOT clang_format)
message(STATUS "Could not locate clang-format")
else ()
file(GLOB_RECURSE format_files
${CMAKE_CURRENT_SOURCE_DIR}/demo/*.[ch]
${CMAKE_CURRENT_SOURCE_DIR}/libudpard/*.[ch]
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.[ch]
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.[ch]pp)
message(STATUS "Using clang-format: ${clang_format}; files: ${format_files}")
add_custom_target(format COMMAND ${clang_format} -i -fallback-style=none -style=file --verbose ${format_files})
endif ()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)