Skip to content

set public header include dir for fixing header prefix #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ add_library(tinycbor
src/cborparser.c
src/cborpretty.c
src/cborvalidation.c
src/cbor.h
)
if(WITH_FREESTANDING)
target_compile_options(tinycbor PUBLIC
Expand Down Expand Up @@ -141,13 +140,13 @@ if(NOT HAVE_OPEN_MEMSTREAM)
endif()

target_include_directories(tinycbor
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

install(FILES
${PROJECT_SOURCE_DIR}/src/cbor.h
${PROJECT_SOURCE_DIR}/include/tinycbor/cbor.h
${PROJECT_BINARY_DIR}/tinycbor-version.h
${PROJECT_BINARY_DIR}/tinycbor-export.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tinycbor
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cborencoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"
#include "cborinternal_p.h"
#include "compilersupport_p.h"

Expand Down
2 changes: 1 addition & 1 deletion src/cborencoder_close_container_checked.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"

/**
* \addtogroup CborEncoding
Expand Down
2 changes: 1 addition & 1 deletion src/cborencoder_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"

#include "cborinternal_p.h"

Expand Down
2 changes: 1 addition & 1 deletion src/cborerrorstrings.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
**
****************************************************************************/

#include "cbor.h"
#include "tinycbor/cbor.h"

#ifndef _
# define _(msg) msg
Expand Down
2 changes: 1 addition & 1 deletion src/cborjson.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifndef CBORJSON_H
#define CBORJSON_H

#include "cbor.h"
#include "tinycbor/cbor.h"

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/cborparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"
#include "cborinternal_p.h"
#include "compilersupport_p.h"

Expand Down
2 changes: 1 addition & 1 deletion src/cborparser_dup_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"
#include "compilersupport_p.h"
#include "memory.h"

Expand Down
2 changes: 1 addition & 1 deletion src/cborparser_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"

#include "cborinternal_p.h"

Expand Down
2 changes: 1 addition & 1 deletion src/cborpretty.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"
#include "cborinternal_p.h"
#include "compilersupport_p.h"
#include "utf8_p.h"
Expand Down
2 changes: 1 addition & 1 deletion src/cborpretty_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
**
****************************************************************************/

#include "cbor.h"
#include "tinycbor/cbor.h"
#include <stdarg.h>
#include <stdio.h>

Expand Down
4 changes: 2 additions & 2 deletions src/cbortojson.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"
#include "cborjson.h"
#include "cborinternal_p.h"
#include "compilersupport_p.h"
#include "cborinternal_p.h"
#include <memory.h>
#include "memory.h"

#include <inttypes.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion src/cborvalidation.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "cborinternalmacros_p.h"

#include "cbor.h"
#include "tinycbor/cbor.h"
#include "cborinternal_p.h"
#include "compilersupport_p.h"
#include "utf8_p.h"
Expand Down
2 changes: 1 addition & 1 deletion src/compilersupport_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifndef COMPILERSUPPORT_H
#define COMPILERSUPPORT_H

#include "cbor.h"
#include "tinycbor/cbor.h"

#ifndef _BSD_SOURCE
# define _BSD_SOURCE
Expand Down
2 changes: 1 addition & 1 deletion tests/c90/tst_c90.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
**
****************************************************************************/

#include "cbor.h"
#include "tinycbor/cbor.h"

int main()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/encoder/tst_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
****************************************************************************/

#include <QtTest>
#include "cbor.h"
#include "tinycbor/cbor.h"

#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
#include <qfloat16.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/parser/tst_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define _XOPEN_SOURCE 700
#define _DARWIN_C_SOURCE 1 /* need MAP_ANON */
#include <QtTest>
#include "cbor.h"
#include "tinycbor/cbor.h"
#include <stdio.h>
#include <stdarg.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/tojson/tst_tojson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define __STDC_WANT_IEC_60559_TYPES_EXT__
#include <QtTest>
#include "cbor.h"
#include "tinycbor/cbor.h"
#include "cborinternal_p.h"
#include "cborjson.h"
#include <locale.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/cbordump/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
# SPDX-License-Identifier: MIT
if(NOT WIN32)
tinycbor_add_executable(cbordump cbordump.c)
target_include_directories(cbordump PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../src)
target_link_libraries(cbordump tinycbor)
install(TARGETS cbordump)
endif()
2 changes: 1 addition & 1 deletion tools/cbordump/cbordump.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
****************************************************************************/

#define _POSIX_C_SOURCE 200809L
#include "cbor.h"
#include "tinycbor/cbor.h"
#include "cborjson.h"
#include <errno.h>
#include <stdio.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/json2cbor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ include(FindPkgConfig)
pkg_check_modules(LIBCJSON libcjson)
if(LIBCJSON_FOUND)
tinycbor_add_executable(json2cbor json2cbor.c)
target_include_directories(json2cbor PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../src)
target_include_directories(json2cbor SYSTEM PUBLIC ${LIBCJSON_INCLUDE_DIRS})
target_link_directories(json2cbor PUBLIC ${LIBCJSON_LIBRARY_DIRS})
target_link_libraries(json2cbor ${LIBCJSON_LIBRARIES})
endif()
2 changes: 1 addition & 1 deletion tools/json2cbor/json2cbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define _GNU_SOURCE
#define __STDC_WANT_IEC_60559_TYPES_EXT__
#include "cbor.h"
#include "tinycbor/cbor.h"
#include "cborinternal_p.h"
#include "compilersupport_p.h"

Expand Down