From 626e0736d23df44b591c08edc7c77268292c3b0e Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Tue, 26 Apr 2016 08:47:52 +0100 Subject: [PATCH] [CMake] Implement installation of ".NET" bindings on Windows. We don't install Z3_DOTNET_ASSEMBLY_DLL into the gac. Instead we just copy into installation directory. There are several reasons for this: * We can't install the Z3_DOTNET_ASSEMBLY_DLL into the gac in a portable way like we can with mono (i.e. the ``-root`` flag). * It isn't best practice to use ``gacutil.exe`` on Windows to install into the GAC, see https://msdn.microsoft.com/en-us/library/yf1d93sz(v=vs.110).aspx . Taking this approach should be sufficient because we can now do something like this ``` mkdir build cmake -G Ninja -DCMAKE_INSTALL_PREFIX= ../ ninja mkdir ninja install ``` and then put the contents of into a zip file which creates a redistributable zip file for Windows. --- contrib/cmake/src/api/dotnet/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/cmake/src/api/dotnet/CMakeLists.txt b/contrib/cmake/src/api/dotnet/CMakeLists.txt index e8fa12292..7440f021b 100644 --- a/contrib/cmake/src/api/dotnet/CMakeLists.txt +++ b/contrib/cmake/src/api/dotnet/CMakeLists.txt @@ -282,9 +282,10 @@ if (DOTNET_TOOLCHAIN_IS_MONO) add_dependencies(uninstall remove_dotnet_dll_from_gac) elseif(DOTNET_TOOLCHAIN_IS_WINDOWS) - # FIXME: This isn't implemented because I'm not sure how/if the assembly should - # be installed to the GAC. - message(WARNING "Install of .NET bindings is not implemented for Windows") + # Don't install Z3_DOTNET_ASSEMBLY_DLL into the gac. Instead just copy into + # installation directory. + install(FILES "${Z3_DOTNET_ASSEMBLY_DLL}" DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(FILES "${Z3_DOTNET_ASSEMBLY_DLL_DOC}" DESTINATION "${CMAKE_INSTALL_LIBDIR}") else() message(FATAL_ERROR "Unknown .NET toolchain") endif()