diff options
-rw-r--r-- | Modules/FindProtobuf.cmake | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 008b537..a7ee0c4 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -299,6 +299,8 @@ function(protobuf_generate) list(APPEND _protobuf_include_path -I ${_abs_dir}) endif() endforeach() + else() + set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) endif() foreach(DIR ${protobuf_generate_IMPORT_DIRS}) @@ -309,10 +311,6 @@ function(protobuf_generate) endif() endforeach() - if(NOT _protobuf_include_path) - set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) - endif() - set(_generated_srcs_all) foreach(_proto ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_proto} ABSOLUTE) |