From 8e6cf6460c8c8959d5a89c4c7fe02145698c4e91 Mon Sep 17 00:00:00 2001 From: Martin Marmsoler Date: Tue, 31 Jan 2023 17:32:05 +0100 Subject: [PATCH 1/7] do not change install destination, because dlls are stored then also in libdir instead in the default runtime dir "bin" --- src/Vector/BLF/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Vector/BLF/CMakeLists.txt b/src/Vector/BLF/CMakeLists.txt index b028ea11..590715a1 100644 --- a/src/Vector/BLF/CMakeLists.txt +++ b/src/Vector/BLF/CMakeLists.txt @@ -341,8 +341,7 @@ endif() # install install( - TARGETS ${PROJECT_NAME} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) + TARGETS ${PROJECT_NAME}) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) From b7a419c4d8edbf495ab309b57a380a2444ee2730 Mon Sep 17 00:00:00 2001 From: Martin Marmsoler Date: Thu, 2 Mar 2023 19:34:58 +0100 Subject: [PATCH 2/7] Install files only if not FETCH_CONTENT_INCLUSION, because when including the project into another project with FecthContent the headers are only needed during build but not after installation --- CMakeLists.txt | 2 ++ src/Vector/BLF/CMakeLists.txt | 21 ++++++++++++--------- src/Vector/CMakeLists.txt | 8 +++++--- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bb50c75..16a7920f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/Vector/BLF/CMakeLists.txt b/src/Vector/BLF/CMakeLists.txt index 590715a1..71cd1d71 100644 --- a/src/Vector/BLF/CMakeLists.txt +++ b/src/Vector/BLF/CMakeLists.txt @@ -342,15 +342,18 @@ endif() # install install( TARGETS ${PROJECT_NAME}) -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 - $ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Vector/BLF) + +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 + $ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Vector/BLF) +endif() # sub directories add_subdirectory(docs) diff --git a/src/Vector/CMakeLists.txt b/src/Vector/CMakeLists.txt index d321b47d..e3cca81e 100644 --- a/src/Vector/CMakeLists.txt +++ b/src/Vector/CMakeLists.txt @@ -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() From 4f2069c9fa0a47397959af0c0a6109eb2b14acad Mon Sep 17 00:00:00 2001 From: Martin Marmsoler Date: Sun, 16 Apr 2023 10:36:44 +0200 Subject: [PATCH 3/7] include cstdint, because on tumbleweed with gcc13 it does not compile anymore because all std ints are not recognized anymore --- src/Vector/BLF/ObjectHeaderBase.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Vector/BLF/ObjectHeaderBase.h b/src/Vector/BLF/ObjectHeaderBase.h index 4fb9407e..4d666b05 100644 --- a/src/Vector/BLF/ObjectHeaderBase.h +++ b/src/Vector/BLF/ObjectHeaderBase.h @@ -6,6 +6,8 @@ #include +#include + #include #include From c1c6844525888ccb4ef6a1181a504de7f99759ff Mon Sep 17 00:00:00 2001 From: Stefan Gerlach Date: Thu, 2 Nov 2023 12:34:42 +0100 Subject: [PATCH 4/7] fix compilation with newer gcc and clang versions --- src/Vector/BLF/platform.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Vector/BLF/platform.h b/src/Vector/BLF/platform.h index 3b07b24d..c5844c05 100644 --- a/src/Vector/BLF/platform.h +++ b/src/Vector/BLF/platform.h @@ -9,6 +9,7 @@ #pragma once #include +#include /* GCC */ #ifdef __GNUC__ From fa6d02c6fce5d866ecae0cf9e31ce937735f3c62 Mon Sep 17 00:00:00 2001 From: Murmele Date: Mon, 27 Jan 2025 09:03:15 +0000 Subject: [PATCH 5/7] make library static --- src/Vector/BLF/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Vector/BLF/CMakeLists.txt b/src/Vector/BLF/CMakeLists.txt index 71cd1d71..ad874ad4 100644 --- a/src/Vector/BLF/CMakeLists.txt +++ b/src/Vector/BLF/CMakeLists.txt @@ -6,7 +6,7 @@ include(GenerateExportHeader) # targets -add_library(${PROJECT_NAME} SHARED "") +add_library(${PROJECT_NAME} STATIC "") # search paths include_directories( From d102543858a11908e13245849785722140fa79b7 Mon Sep 17 00:00:00 2001 From: Israel Galadima <59661679+israelsgalaxy@users.noreply.github.com> Date: Thu, 30 Jan 2025 09:04:54 +0100 Subject: [PATCH 6/7] Use docs and tests options to control addition of subdirs to cmake --- src/Vector/BLF/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Vector/BLF/CMakeLists.txt b/src/Vector/BLF/CMakeLists.txt index ad874ad4..98b70acd 100644 --- a/src/Vector/BLF/CMakeLists.txt +++ b/src/Vector/BLF/CMakeLists.txt @@ -356,5 +356,10 @@ if (NOT FETCH_CONTENT_INCLUSION) 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() From d7dbfd8bb38506dcb3c2b191809cea1737fd5b56 Mon Sep 17 00:00:00 2001 From: Israel Galadima <59661679+israelsgalaxy@users.noreply.github.com> Date: Thu, 30 Jan 2025 09:05:34 +0100 Subject: [PATCH 7/7] Turn OFF docs generation --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d406a94..cc80c309 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)