Skip to content

Commit f96b0a6

Browse files
committed
Safeguard proto features when not present
1 parent 87d7287 commit f96b0a6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

projects/biogears/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ endif()
3939
verify_package(Threads REQUIRED)
4040
verify_package(Eigen3 REQUIRED)
4141
verify_package(CodeSynthesis REQUIRED)
42-
verify_package(Protobuf REQUIRED)
42+
verify_package(Protobuf QUIET)
4343

4444
if(Biogears_BUILD_PYTHON_BINDINGS)
4545
verify_package(pybind11 REQUIRED)
@@ -77,6 +77,9 @@ set_source_files_properties(${XSD_FILES} PROPERTIES
7777
TRUE FOLDER schema
7878
)
7979

80+
81+
option(Biogears_USE_PROTO "Enable very experimental PROTOBUFF Support [DEVELOPER ONLY]" OFF)
82+
if (Biogears_USE_PROTO)
8083
# Proto Buffs
8184
file(GLOB_RECURSE PROTO_FILES CMAKE_CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/share/proto/*.proto)
8285

@@ -103,6 +106,7 @@ set_source_files_properties(${PROTO_FILES} PROPERTIES
103106
HEADER_FILE_ONLY
104107
TRUE FOLDER schema)
105108

109+
endif()
106110
# Version Source Code
107111
set_target_properties(xsd_bindings PROPERTIES FOLDER "Code Generators")
108112

projects/biogears/libCDM/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ set(LIBBIO_CDM_SOURCES ${CDM_PUBLIC_SRCS} ${CDM_XSD_SRCS} ${CDM_PROTO_SRCS})
4343
CXX_STANDARD 20
4444
)
4545
set_target_properties(libbiogears_cdm PROPERTIES SOVERSION "${Biogears_LIB_VERSION}")
46-
add_dependencies(libbiogears_cdm xsd_bindings proto_bindings)
47-
46+
add_dependencies(libbiogears_cdm xsd_bindings )
47+
if (Biogears_USE_PROTO)
48+
add_dependencies(libbiogears_cdm proto_bindings>)
49+
endif()
4850
###############################################################################
4951
# libBiogears_cdm COMPILATION & LINKAGE MODIFICATIONS
5052
###############################################################################
@@ -62,7 +64,7 @@ set(LIBBIO_CDM_SOURCES ${CDM_PUBLIC_SRCS} ${CDM_XSD_SRCS} ${CDM_PROTO_SRCS})
6264

6365
set(BIO_cdm_LIBS
6466
CodeSynthesis::XSD
65-
protobuf::libprotobuf
67+
$<$<BOOL:${Biogears_USE_PROTO}>:protobuf::libprotobuf>
6668
Eigen3::Eigen
6769
)
6870
target_link_libraries(libbiogears_cdm PUBLIC ${BIO_cdm_LIBS} )

0 commit comments

Comments
 (0)