Merge topic 'FindProtobuf-restore-PROTOBUF_IMPORT_DIRS'

5790d9b6 FindProtobuf: Restore support for PROTOBUF_IMPORT_DIRS
This commit is contained in:
Brad King 2016-08-03 09:20:50 -04:00 committed by CMake Topic Stage
commit a85e2a89de
1 changed files with 8 additions and 0 deletions

View File

@ -129,6 +129,10 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif() 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) if(DEFINED Protobuf_IMPORT_DIRS)
foreach(DIR ${Protobuf_IMPORT_DIRS}) foreach(DIR ${Protobuf_IMPORT_DIRS})
get_filename_component(ABS_PATH ${DIR} ABSOLUTE) get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
@ -187,6 +191,10 @@ function(PROTOBUF_GENERATE_PYTHON SRCS)
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif() 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) if(DEFINED Protobuf_IMPORT_DIRS)
foreach(DIR ${Protobuf_IMPORT_DIRS}) foreach(DIR ${Protobuf_IMPORT_DIRS})
get_filename_component(ABS_PATH ${DIR} ABSOLUTE) get_filename_component(ABS_PATH ${DIR} ABSOLUTE)