From 5790d9b6f5ae0b5bb8b0f2e4ec630a690b4b0301 Mon Sep 17 00:00:00 2001 From: Konstantin Sinitsyn Date: Fri, 29 Jul 2016 20:10:04 -0700 Subject: [PATCH] FindProtobuf: Restore support for PROTOBUF_IMPORT_DIRS Support was accidentally dropped by commit v3.6.0-rc1~273^2 (FindProtobuf: Rename variables to match case of module name, 2016-03-01). --- Modules/FindProtobuf.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 80420735c..2807bb9f6 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -129,6 +129,10 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS) set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) endif() + if(DEFINED PROTOBUF_IMPORT_DIRS AND NOT DEFINED Protobuf_IMPORT_DIRS) + set(Protobuf_IMPORT_DIRS "${PROTOBUF_IMPORT_DIRS}") + endif() + if(DEFINED Protobuf_IMPORT_DIRS) foreach(DIR ${Protobuf_IMPORT_DIRS}) get_filename_component(ABS_PATH ${DIR} ABSOLUTE) @@ -183,6 +187,10 @@ function(PROTOBUF_GENERATE_PYTHON SRCS) set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) endif() + if(DEFINED PROTOBUF_IMPORT_DIRS AND NOT DEFINED Protobuf_IMPORT_DIRS) + set(Protobuf_IMPORT_DIRS "${PROTOBUF_IMPORT_DIRS}") + endif() + if(DEFINED Protobuf_IMPORT_DIRS) foreach(DIR ${Protobuf_IMPORT_DIRS}) get_filename_component(ABS_PATH ${DIR} ABSOLUTE)