* Protobuf module mode import for Windows build
Windows native build only can import with legacy 'module' mode import.
This commit is to give a Windows build a way to import Protobuf. Note
that this will not affect existing default behavior.
Signed-off-by: Cheongyo Bahk <ch.bahk@samsung.com>
* Move option to top
* USE_PROTOBUF_LEGACY_IMPORT
Change-Id: I8963f857a9b5be23fa7e958e25d1003a81444e28
Signed-off-by: Chunseok Lee <chunseok.lee@samsung.com>
-# NOTE This function is unused, but remains for future reference
function(_Protobuf_module_import)
# Let's use find_package here not to export unnecessary definitions
find_package(Protobuf MODULE QUIET)
endfunction(_Protobuf_build)
_Protobuf_build()
-_Protobuf_import()
+
+if(USE_PROTOBUF_LEGACY_IMPORT)
+ _Protobuf_module_import()
+else(USE_PROTOBUF_LEGACY_IMPORT)
+ _Protobuf_import()
+endif(USE_PROTOBUF_LEGACY_IMPORT)
if(Protobuf_FOUND)
function(Protobuf_Generate PREFIX OUTPUT_DIR PROTO_DIR)
option(ENABLE_STRICT_BUILD "Treat warning as error" OFF)
+# This option might be turned ON for Windows native build.
+# Check our ProtobufConfig.cmake for its usage.
+option(USE_PROTOBUF_LEGACY_IMPORT "Use legacy MODULE mode import rather than CONFIG mode" OFF)
+
###
### Target
###