From c9b1134417f7f9ca3467e846e5f9a3b48d5b6bf9 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 3 Apr 2024 10:41:14 -0700 Subject: [PATCH] Move FindProtobuf to default on for Linux --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fbfe55259..dbd4086833 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,17 @@ cmake_dependent_option( KICAD_APPLE_MAKE_RELOCATEABLE_BUNDLE "On macOS, post-process the build to make it relocateable (default ON)" ON "APPLE" OFF ) +# CMake's FindProtobuf module doesn't work correctly on MacOS or Windows but is +# required for Linux +if( UNIX_NOT_APPLE ) + set( KICAD_CMAKE_PROTOBUF_DEFAULT ON ) +else() + set( KICAD_CMAKE_PROTOBUF_DEFAULT OFF ) +endif() + +option( KICAD_USE_CMAKE_FINDPROTOBUF "Use FindProtobuf provided by CMake" ${KICAD_CMAKE_PROTOBUF_DEFAULT} ) +mark_as_advanced( KICAD_USE_CMAKE_FINDPROTOBUF ) + #################################### # Installation options #################################### @@ -850,9 +861,6 @@ if( OCC_VERSION_STRING VERSION_LESS 7.5.0 ) endif() include_directories( SYSTEM ${OCC_INCLUDE_DIR} ) -option( KICAD_USE_CMAKE_FINDPROTOBUF "Use FindProtobuf provided by CMake" OFF ) -mark_as_advanced( KICAD_USE_CMAKE_FINDPROTOBUF ) - if( KICAD_USE_CMAKE_FINDPROTOBUF ) include( FindProtobuf ) find_package( Protobuf REQUIRED )