Skip to content
Open
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project(Vector_BLF
DESCRIPTION "Vector Binary Log File support library")

# source code documentation
option(OPTION_RUN_DOXYGEN "Run Doxygen" ON)
option(OPTION_RUN_DOXYGEN "Run Doxygen" OFF)

# static code analysis
option(OPTION_RUN_CCCC "Run CCCC" OFF)
Expand All @@ -21,6 +21,8 @@ option(OPTION_BUILD_TESTS "Build tests" OFF)
option(OPTION_USE_GCOV "Build with gcov to generate coverage data on execution" OFF)
option(OPTION_USE_GPROF "Build with gprof" OFF)
option(OPTION_ADD_LCOV "Add lcov targets to generate HTML coverage report" OFF)
# Turn OFF, if you are using FetchContent to include it to your project
option(FETCH_CONTENT_INCLUSION "Include project with FetchContent_Declare in another project. In this case the headers and the cmake files are not needed, only the library" OFF)

# directories
include(GNUInstallDirs)
Expand Down
35 changes: 21 additions & 14 deletions src/Vector/BLF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include(GenerateExportHeader)

# targets
add_library(${PROJECT_NAME} SHARED "")
add_library(${PROJECT_NAME} STATIC "")

# search paths
include_directories(
Expand Down Expand Up @@ -341,18 +341,25 @@ endif()

# install
install(
TARGETS ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/vector_blf_export.h
${CMAKE_CURRENT_BINARY_DIR}/config.h
$<TARGET_PROPERTY:${PROJECT_NAME},INTERFACE_SOURCES>
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Vector/BLF)
TARGETS ${PROJECT_NAME})

if (NOT FETCH_CONTENT_INCLUSION)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/vector_blf_export.h
${CMAKE_CURRENT_BINARY_DIR}/config.h
$<TARGET_PROPERTY:${PROJECT_NAME},INTERFACE_SOURCES>
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Vector/BLF)
endif()

# sub directories
add_subdirectory(docs)
add_subdirectory(tests)
if (OPTION_RUN_DOXYGEN)
add_subdirectory(docs)
endif()

if (OPTION_BUILD_TESTS)
add_subdirectory(tests)
endif()
2 changes: 2 additions & 0 deletions src/Vector/BLF/ObjectHeaderBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <Vector/BLF/platform.h>

#include <cstdint>

#include <Vector/BLF/AbstractFile.h>

#include <Vector/BLF/vector_blf_export.h>
Expand Down
1 change: 1 addition & 0 deletions src/Vector/BLF/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma once

#include <Vector/BLF/config.h>
#include <cstdint>

/* GCC */
#ifdef __GNUC__
Expand Down
8 changes: 5 additions & 3 deletions src/Vector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

add_subdirectory(BLF)

install(
FILES BLF.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Vector)
if (NOT FETCH_CONTENT_INCLUSION)
install(
FILES BLF.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Vector)
endif()