Add CMake header install config
Closes #172
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 486946c..e4aa83f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,25 @@
)
endif()
+set(HEADERS
+ inc/qcbor/qcbor.h
+ inc/qcbor/qcbor_common.h
+ inc/qcbor/qcbor_private.h
+ inc/qcbor/qcbor_encode.h
+ inc/qcbor/qcbor_decode.h
+ inc/qcbor/qcbor_spiffy_decode.h
+ inc/qcbor/UsefulBuf.h
+)
+set_target_properties(
+ qcbor PROPERTIES
+ PUBLIC_HEADER "${HEADERS}"
+)
+include(GNUInstallDirs)
+install(
+ TARGETS qcbor
+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/qcbor"
+)
+
if (NOT BUILD_QCBOR_TEST STREQUAL "OFF")
add_subdirectory(test)
endif()