mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-01 11:07:56 +00:00
auto-gen main header file (#59)
This commit is contained in:
committed by
Matias Fontanini
parent
8fc6a0f02d
commit
30b3652a94
@@ -1,3 +1,21 @@
|
||||
# Local function to auto-generate main cppkafka.h header file
|
||||
function(make_cppkafka_header)
|
||||
set(CPPKAFKA_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/cppkafka.h)
|
||||
file(GLOB INCLUDE_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h" "utils/*.h")
|
||||
foreach(header ${INCLUDE_HEADERS})
|
||||
if (NOT ${header} MATCHES "cppkafka.h")
|
||||
SET(CPPKAFKA_HEADERS "${CPPKAFKA_HEADERS}#include <cppkafka/${header}>\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
#create file from template
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cppkafka.h.in ${CPPKAFKA_HEADER})
|
||||
endfunction()
|
||||
|
||||
# Run file generation function
|
||||
make_cppkafka_header()
|
||||
|
||||
# Install headers including the auto-generated cppkafka.h
|
||||
file(GLOB INCLUDE_FILES "*.h")
|
||||
file(GLOB UTILS_INCLUDE_FILES "utils/*.h")
|
||||
install(
|
||||
@@ -9,4 +27,4 @@ install(
|
||||
FILES ${UTILS_INCLUDE_FILES}
|
||||
DESTINATION include/cppkafka/utils/
|
||||
COMPONENT Headers
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user