From b43ee5a174ab17cc51aa599c4b177e6ff0903c41 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 14 Dec 2025 09:27:18 +0100 Subject: [PATCH 1/6] Use STATIC instead of OBJECT to improve debug information in visual studio --- ApplicationExeCode/CMakeLists.txt | 9 +++++++++ ApplicationLibCode/CMakeLists.txt | 2 +- ApplicationLibCode/Commands/CMakeLists.txt | 2 +- Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt | 14 ++++++-------- .../cafTests/cafTestApplication/CMakeLists.txt | 5 +---- GrpcInterface/CMakeLists.txt | 2 +- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ApplicationExeCode/CMakeLists.txt b/ApplicationExeCode/CMakeLists.txt index 490eaf92f3c..4071276349d 100644 --- a/ApplicationExeCode/CMakeLists.txt +++ b/ApplicationExeCode/CMakeLists.txt @@ -231,6 +231,15 @@ endif() target_link_libraries(ResInsight PRIVATE ${LINK_LIBRARIES}) +# Link ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface with WHOLE_ARCHIVE +# to ensure static initialization is not optimized away by the linker +target_link_libraries(ResInsight PRIVATE + $ + $ + $ + $<$:$> +) + if(UNIX AND NOT APPLE) target_link_libraries(ResInsight PRIVATE xcb) endif() diff --git a/ApplicationLibCode/CMakeLists.txt b/ApplicationLibCode/CMakeLists.txt index 37997cc2564..1a744b9b0b4 100644 --- a/ApplicationLibCode/CMakeLists.txt +++ b/ApplicationLibCode/CMakeLists.txt @@ -220,7 +220,7 @@ list(APPEND ALL_SOURCE_FILES ${CPP_SOURCES} ${MOC_SOURCE_FILES} ${FORM_FILES_CPP} ${QRC_FILES} ) -add_library(${PROJECT_NAME} OBJECT ${ALL_SOURCE_FILES}) +add_library(${PROJECT_NAME} STATIC ${ALL_SOURCE_FILES}) option(RESINSIGHT_ENABLE_DYNAMIC_DEOPTIMALIZATION "Ensable Dynamic Deoptimalization" OFF diff --git a/ApplicationLibCode/Commands/CMakeLists.txt b/ApplicationLibCode/Commands/CMakeLists.txt index 0ecee04926b..7ba7a0ac2ea 100644 --- a/ApplicationLibCode/Commands/CMakeLists.txt +++ b/ApplicationLibCode/Commands/CMakeLists.txt @@ -74,7 +74,7 @@ endforeach(referencedfile) find_package(Eigen3 REQUIRED) add_library( - ${PROJECT_NAME} OBJECT + ${PROJECT_NAME} STATIC ${COMMAND_CODE_SOURCE_FILES} ${COMMAND_CODE_HEADER_FILES} ${COMMAND_MOC_SOURCE_FILES} ) diff --git a/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt b/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt index de9b8c8c392..3b56d1f81ac 100644 --- a/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt +++ b/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt @@ -53,15 +53,13 @@ set(QRC_FILES PARENT_SCOPE ) -# NOTE! Adding the library as a cmake "OBJECT" library to make sure the linker -# is not pruning the seemingly unused features, and to make sure that the static -# initialization based registration of the features into the factory is done -# properly see -# https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/Object-Library -# and -# https://cmake.org/cmake/help/v3.15/command/add_library.html?highlight=add_library#object-libraries +# NOTE! Adding the library as a cmake "STATIC" library. +# To ensure the linker doesn't prune seemingly unused features and that static +# initialization based registration of features into the factory is done properly, +# MSVC uses /WHOLEARCHIVE and GCC/Clang use --whole-archive linker flags. +# See https://cmake.org/cmake/help/latest/command/add_library.html -add_library(${PROJECT_NAME} OBJECT ${PROJECT_FILES} ${MOC_SOURCE_FILES}) +add_library(${PROJECT_NAME} STATIC ${PROJECT_FILES} ${MOC_SOURCE_FILES}) target_link_libraries( ${PROJECT_NAME} cafCommand cafUserInterface ${QT_LIBRARIES} diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt b/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt index 1ab7147d7a1..c78f95ed88c 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt +++ b/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt @@ -52,8 +52,6 @@ set(PROJECT_FILES qt_add_executable( ${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES} ${QRC_FILES} - $ # Needed for cmake version < 3.12. Remove - # when we can use target_link_libraries with OBJECT libraries ) set(TAP_LINK_LIBRARIES cafUserInterface) @@ -61,8 +59,7 @@ set(TAP_LINK_LIBRARIES cafUserInterface) if(USE_COMMAND_FRAMEWORK) set(TAP_LINK_LIBRARIES ${TAP_LINK_LIBRARIES} cafCommand - # cafCommandFeatures # Not possible using cmake version < 3.12. Use when - # we can use target_link_libraries with OBJECT libraries + $ ) endif(USE_COMMAND_FRAMEWORK) diff --git a/GrpcInterface/CMakeLists.txt b/GrpcInterface/CMakeLists.txt index 703bc9ca7cd..054be900328 100644 --- a/GrpcInterface/CMakeLists.txt +++ b/GrpcInterface/CMakeLists.txt @@ -219,7 +219,7 @@ list( list(APPEND GRPC_PYTHON_SOURCES ${GRPC_PYTHON_GENERATED_SOURCES}) add_library( - ${PROJECT_NAME} OBJECT + ${PROJECT_NAME} STATIC ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${GRPC_HEADER_FILES} ${GRPC_CPP_SOURCES}) From 6afa20ce74cf7af81f0aad3a30ef67fcb02bbb7c Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 14 Dec 2025 09:29:11 +0100 Subject: [PATCH 2/6] fix unit test --- ApplicationLibCode/UnitTests/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ApplicationLibCode/UnitTests/CMakeLists.txt b/ApplicationLibCode/UnitTests/CMakeLists.txt index e9ebcf2d1d2..fc5016e4090 100644 --- a/ApplicationLibCode/UnitTests/CMakeLists.txt +++ b/ApplicationLibCode/UnitTests/CMakeLists.txt @@ -235,6 +235,15 @@ endif() target_link_libraries(ResInsight-tests PUBLIC ${LINK_LIBRARIES} GTest::gtest) +# Link ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface with WHOLE_ARCHIVE +# to ensure static initialization is not optimized away by the linker +target_link_libraries(ResInsight-tests PUBLIC + $ + $ + $ + $<$:$> +) + if(MSVC) add_custom_command( TARGET ResInsight-tests From c7b34e090c4a6ec45bb3679a0ecdf1f728c96966 Mon Sep 17 00:00:00 2001 From: magnesj <1793152+magnesj@users.noreply.github.com> Date: Sun, 14 Dec 2025 08:30:57 +0000 Subject: [PATCH 3/6] Fixes by cmake-format --- ApplicationExeCode/CMakeLists.txt | 17 ++++++++++------- ApplicationLibCode/UnitTests/CMakeLists.txt | 17 ++++++++++------- Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt | 10 +++++----- .../cafTests/cafTestApplication/CMakeLists.txt | 5 ++--- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/ApplicationExeCode/CMakeLists.txt b/ApplicationExeCode/CMakeLists.txt index 4071276349d..7c1df3e85fb 100644 --- a/ApplicationExeCode/CMakeLists.txt +++ b/ApplicationExeCode/CMakeLists.txt @@ -231,13 +231,16 @@ endif() target_link_libraries(ResInsight PRIVATE ${LINK_LIBRARIES}) -# Link ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface with WHOLE_ARCHIVE -# to ensure static initialization is not optimized away by the linker -target_link_libraries(ResInsight PRIVATE - $ - $ - $ - $<$:$> +# Link ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface with +# WHOLE_ARCHIVE to ensure static initialization is not optimized away by the +# linker +target_link_libraries( + ResInsight + PRIVATE + $ + $ + $ + $<$:$> ) if(UNIX AND NOT APPLE) diff --git a/ApplicationLibCode/UnitTests/CMakeLists.txt b/ApplicationLibCode/UnitTests/CMakeLists.txt index fc5016e4090..5305ae82b03 100644 --- a/ApplicationLibCode/UnitTests/CMakeLists.txt +++ b/ApplicationLibCode/UnitTests/CMakeLists.txt @@ -235,13 +235,16 @@ endif() target_link_libraries(ResInsight-tests PUBLIC ${LINK_LIBRARIES} GTest::gtest) -# Link ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface with WHOLE_ARCHIVE -# to ensure static initialization is not optimized away by the linker -target_link_libraries(ResInsight-tests PUBLIC - $ - $ - $ - $<$:$> +# Link ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface with +# WHOLE_ARCHIVE to ensure static initialization is not optimized away by the +# linker +target_link_libraries( + ResInsight-tests + PUBLIC + $ + $ + $ + $<$:$> ) if(MSVC) diff --git a/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt b/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt index 3b56d1f81ac..363946b2b78 100644 --- a/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt +++ b/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt @@ -53,11 +53,11 @@ set(QRC_FILES PARENT_SCOPE ) -# NOTE! Adding the library as a cmake "STATIC" library. -# To ensure the linker doesn't prune seemingly unused features and that static -# initialization based registration of features into the factory is done properly, -# MSVC uses /WHOLEARCHIVE and GCC/Clang use --whole-archive linker flags. -# See https://cmake.org/cmake/help/latest/command/add_library.html +# NOTE! Adding the library as a cmake "STATIC" library. To ensure the linker +# doesn't prune seemingly unused features and that static initialization based +# registration of features into the factory is done properly, MSVC uses +# /WHOLEARCHIVE and GCC/Clang use --whole-archive linker flags. See +# https://cmake.org/cmake/help/latest/command/add_library.html add_library(${PROJECT_NAME} STATIC ${PROJECT_FILES} ${MOC_SOURCE_FILES}) diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt b/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt index c78f95ed88c..e1bc4a1e056 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt +++ b/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt @@ -57,9 +57,8 @@ qt_add_executable( set(TAP_LINK_LIBRARIES cafUserInterface) if(USE_COMMAND_FRAMEWORK) - set(TAP_LINK_LIBRARIES - ${TAP_LINK_LIBRARIES} cafCommand - $ + set(TAP_LINK_LIBRARIES ${TAP_LINK_LIBRARIES} cafCommand + $ ) endif(USE_COMMAND_FRAMEWORK) From b4d31701c98032161b7986095d8f02147573e2cc Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sun, 14 Dec 2025 10:49:31 +0100 Subject: [PATCH 4/6] Update submodule --- ThirdParty/openzgy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThirdParty/openzgy b/ThirdParty/openzgy index 5babbb8937b..0b7a2dd6365 160000 --- a/ThirdParty/openzgy +++ b/ThirdParty/openzgy @@ -1 +1 @@ -Subproject commit 5babbb8937bb9914a846951ada561714d021952a +Subproject commit 0b7a2dd6365805ec1b984d0aa93fd17516de76dd From 3986d8e65a72973749a70bc94f2f809a817b345a Mon Sep 17 00:00:00 2001 From: Magne Date: Sun, 14 Dec 2025 14:16:26 +0100 Subject: [PATCH 5/6] Simplify fault collection assertion in RivReservoirFaultsPartMgr --- .../ModelVisualization/Faults/RivReservoirFaultsPartMgr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ApplicationLibCode/ModelVisualization/Faults/RivReservoirFaultsPartMgr.cpp b/ApplicationLibCode/ModelVisualization/Faults/RivReservoirFaultsPartMgr.cpp index a529abf3f16..0bda63b9234 100644 --- a/ApplicationLibCode/ModelVisualization/Faults/RivReservoirFaultsPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/Faults/RivReservoirFaultsPartMgr.cpp @@ -245,8 +245,7 @@ void RivReservoirFaultsPartMgr::updateColors( size_t timeStepIndex, RimEclipseCe { if ( !m_reservoirView ) return; - RimFaultInViewCollection* faultCollection = m_reservoirView->faultCollection(); - CVF_ASSERT( faultCollection ); + CVF_ASSERT( m_reservoirView->faultCollection() ); for ( auto& faultPart : m_faultParts ) { From e6d6ded798ce894deab9ad1e36d66ecc5c587fc9 Mon Sep 17 00:00:00 2001 From: Magne Date: Mon, 15 Dec 2025 08:00:15 +0100 Subject: [PATCH 6/6] Refactor CMakeLists.txt files for improved organization and consistency --- ApplicationExeCode/CMakeLists.txt | 19 +++++++++++++++---- ApplicationLibCode/Commands/CMakeLists.txt | 5 ++++- .../GeoMech/GeoMechDataModel/CMakeLists.txt | 3 ++- .../GeoMechFileInterface/CMakeLists.txt | 3 ++- .../ResultStatisticsCache/CMakeLists.txt | 6 ++++-- ApplicationLibCode/UnitTests/CMakeLists.txt | 11 +++++++---- CMakeLists.txt | 2 +- Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt | 4 +++- GrpcInterface/CMakeLists.txt | 5 +++-- 9 files changed, 41 insertions(+), 17 deletions(-) diff --git a/ApplicationExeCode/CMakeLists.txt b/ApplicationExeCode/CMakeLists.txt index 7c1df3e85fb..9a2412a379b 100644 --- a/ApplicationExeCode/CMakeLists.txt +++ b/ApplicationExeCode/CMakeLists.txt @@ -229,20 +229,31 @@ if(RESINSIGHT_ENABLE_OPENVDS) add_definitions(-DUSE_OPENVDS) endif() -target_link_libraries(ResInsight PRIVATE ${LINK_LIBRARIES}) +# Link libraries with WHOLE_ARCHIVE for ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface +# to ensure static initialization is not optimized away by the linker. +# Other libraries are linked normally. +set(FILTERED_LINK_LIBRARIES ${LINK_LIBRARIES}) +list(REMOVE_ITEM FILTERED_LINK_LIBRARIES ApplicationLibCode cafCommandFeatures Commands GrpcInterface) -# Link ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface with -# WHOLE_ARCHIVE to ensure static initialization is not optimized away by the -# linker target_link_libraries( ResInsight PRIVATE + ${FILTERED_LINK_LIBRARIES} $ $ $ $<$:$> ) +# Add RifGeoMechFileInterface after WHOLE_ARCHIVE to resolve link order issues +if(UNIX AND NOT APPLE) + target_link_options(ResInsight PRIVATE "LINKER:--start-group") + target_link_libraries(ResInsight PRIVATE RifGeoMechFileInterface RigGeoMechDataModel) + target_link_options(ResInsight PRIVATE "LINKER:--end-group") +else() + target_link_libraries(ResInsight PRIVATE RifGeoMechFileInterface) +endif() + if(UNIX AND NOT APPLE) target_link_libraries(ResInsight PRIVATE xcb) endif() diff --git a/ApplicationLibCode/Commands/CMakeLists.txt b/ApplicationLibCode/Commands/CMakeLists.txt index 7ba7a0ac2ea..21fa44bbbaf 100644 --- a/ApplicationLibCode/Commands/CMakeLists.txt +++ b/ApplicationLibCode/Commands/CMakeLists.txt @@ -91,6 +91,8 @@ endif() target_include_directories( ${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/EclipseCommands + $ + $ ) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") @@ -135,7 +137,8 @@ if(MSVC) endif() -set(LINK_LIBRARIES ApplicationLibCode ResultStatisticsCache +set(LINK_LIBRARIES # ApplicationLibCode removed - linked with WHOLE_ARCHIVE in executables + ResultStatisticsCache ResInsightCommonSettings ) target_link_libraries(Commands PRIVATE ${LINK_LIBRARIES}) diff --git a/ApplicationLibCode/GeoMech/GeoMechDataModel/CMakeLists.txt b/ApplicationLibCode/GeoMech/GeoMechDataModel/CMakeLists.txt index aac48d14e59..2b5f0d29159 100644 --- a/ApplicationLibCode/GeoMech/GeoMechDataModel/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/GeoMechDataModel/CMakeLists.txt @@ -110,7 +110,8 @@ add_library( RigFemAddressDefines.cpp ) -target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE $) target_link_libraries( RigGeoMechDataModel PUBLIC LibCore cafPdmCvf cafTensor cafUserInterface diff --git a/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt b/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt index 62346d4090d..f42956d252e 100644 --- a/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt @@ -18,7 +18,8 @@ add_library( RifVtkReader.cpp ) -target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE $) target_link_libraries( RifGeoMechFileInterface PUBLIC RigGeoMechDataModel LibCore diff --git a/ApplicationLibCode/ResultStatisticsCache/CMakeLists.txt b/ApplicationLibCode/ResultStatisticsCache/CMakeLists.txt index 121aae877b4..2f544cced15 100644 --- a/ApplicationLibCode/ResultStatisticsCache/CMakeLists.txt +++ b/ApplicationLibCode/ResultStatisticsCache/CMakeLists.txt @@ -7,6 +7,8 @@ add_library( RigStatisticsMath.cpp ) -target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE $) -target_link_libraries(${PROJECT_NAME} LibCore ApplicationLibCode) +target_link_libraries(${PROJECT_NAME} PRIVATE LibCore) +# ApplicationLibCode removed - linked with WHOLE_ARCHIVE in executables diff --git a/ApplicationLibCode/UnitTests/CMakeLists.txt b/ApplicationLibCode/UnitTests/CMakeLists.txt index 5305ae82b03..2b3889960bc 100644 --- a/ApplicationLibCode/UnitTests/CMakeLists.txt +++ b/ApplicationLibCode/UnitTests/CMakeLists.txt @@ -233,14 +233,17 @@ if(RESINSIGHT_USE_ODB_API) list(APPEND LINK_LIBRARIES RifOdbReader) endif() -target_link_libraries(ResInsight-tests PUBLIC ${LINK_LIBRARIES} GTest::gtest) +# Link libraries with WHOLE_ARCHIVE for ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface +# to ensure static initialization is not optimized away by the linker. +# Other libraries are linked normally. +set(FILTERED_LINK_LIBRARIES ${LINK_LIBRARIES}) +list(REMOVE_ITEM FILTERED_LINK_LIBRARIES ApplicationLibCode cafCommandFeatures Commands GrpcInterface) -# Link ApplicationLibCode, cafCommandFeatures, Commands, and GrpcInterface with -# WHOLE_ARCHIVE to ensure static initialization is not optimized away by the -# linker target_link_libraries( ResInsight-tests PUBLIC + ${FILTERED_LINK_LIBRARIES} + GTest::gtest $ $ $ diff --git a/CMakeLists.txt b/CMakeLists.txt index 434f3532e7b..0646ea6a072 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -977,7 +977,7 @@ list( CommonCode cafVizExtensions cafPdmScripting - cafCommandFeatures + # cafCommandFeatures removed - linked with WHOLE_ARCHIVE in executables ) set_property(TARGET ${APP_FWK_LIBRARIES} PROPERTY FOLDER "AppFwk") diff --git a/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt b/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt index 363946b2b78..9b8e1eba85e 100644 --- a/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt +++ b/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt @@ -61,8 +61,10 @@ set(QRC_FILES add_library(${PROJECT_NAME} STATIC ${PROJECT_FILES} ${MOC_SOURCE_FILES}) +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries( - ${PROJECT_NAME} cafCommand cafUserInterface ${QT_LIBRARIES} + ${PROJECT_NAME} PRIVATE cafCommand cafUserInterface ${QT_LIBRARIES} ) if(MSVC) diff --git a/GrpcInterface/CMakeLists.txt b/GrpcInterface/CMakeLists.txt index 054be900328..2c82586d604 100644 --- a/GrpcInterface/CMakeLists.txt +++ b/GrpcInterface/CMakeLists.txt @@ -124,10 +124,10 @@ set(_LINK_LIBRARIES LibCore CommonCode cafCommand - cafCommandFeatures + # cafCommandFeatures and ApplicationLibCode removed - linked with WHOLE_ARCHIVE in executables cafProjectDataModel cafPdmScripting - ApplicationLibCode) + ) # Proto files file(GLOB GRPC_PROTO_FILES GrpcProtos/*.proto) @@ -228,6 +228,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC PRIVATE ${GRPC_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/Generated + $ ) target_link_libraries(${PROJECT_NAME} PRIVATE ${_LINK_LIBRARIES})