vcpkg/ports/seal/no-source-writes.patch
Wei Dai 95638456fa
[seal] Fixed and updated ports/seal to 3.5.9. (#13598)
* Fixed and updated ports/seal to 3.5.9.

* Update ports/seal/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/seal/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* [seal] Disable vendored dependencies. Fix writes to source dir.

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
2020-09-26 05:09:15 -07:00

80 lines
3.9 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92404c5..9867974 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,20 +108,20 @@ endif()
# Required files and directories
include(GNUInstallDirs)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SEAL_SOURCE_DIR}/${OUTLIB_PATH})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SEAL_SOURCE_DIR}/${OUTLIB_PATH})
-set(CMAKE_LIBRARY_RUNTIME_DIRECTORY ${SEAL_SOURCE_DIR}/bin)
-set(SEAL_TARGETS_FILENAME ${SEAL_SOURCE_DIR}/cmake/SEALTargets.cmake)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${OUTLIB_PATH})
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${OUTLIB_PATH})
+set(CMAKE_LIBRARY_RUNTIME_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
+set(SEAL_TARGETS_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/cmake/SEALTargets.cmake)
set(SEAL_CONFIG_IN_FILENAME ${SEAL_SOURCE_DIR}/cmake/SEALConfig.cmake.in)
-set(SEAL_CONFIG_FILENAME ${SEAL_SOURCE_DIR}/cmake/SEALConfig.cmake)
+set(SEAL_CONFIG_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/cmake/SEALConfig.cmake)
set(SEAL_PKGCONFIG_IN_FILENAME ${SEAL_SOURCE_DIR}/seal.pc.in)
-set(SEAL_PKGCONFIG_FILENAME ${SEAL_SOURCE_DIR}/seal-${SEAL_VERSION_MAJOR}.${SEAL_VERSION_MINOR}.pc)
-set(SEAL_CONFIG_VERSION_FILENAME ${SEAL_SOURCE_DIR}/cmake/SEALConfigVersion.cmake)
+set(SEAL_PKGCONFIG_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/seal-${SEAL_VERSION_MAJOR}.${SEAL_VERSION_MINOR}.pc)
+set(SEAL_CONFIG_VERSION_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/cmake/SEALConfigVersion.cmake)
set(SEAL_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/SEAL-${SEAL_VERSION_MAJOR}.${SEAL_VERSION_MINOR})
set(SEAL_PKGCONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
set(SEAL_INCLUDES_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/SEAL-${SEAL_VERSION_MAJOR}.${SEAL_VERSION_MINOR})
set(SEAL_INCLUDES_BUILD_DIR ${SEAL_SOURCE_DIR}/native/src)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SEAL_SOURCE_DIR}/bin)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(SEAL_THIRDPARTY_DIR ${SEAL_SOURCE_DIR}/thirdparty)
# For extra modules we might have
@@ -830,7 +830,7 @@ unset(SEAL_MACOS_SEAL_C_PATH)
# Create SEALNet-multi.nuspec for a multi-platform NuGet package
configure_file(
${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet-multi.nuspec.in
- ${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet-multi.nuspec
+ ${CMAKE_CURRENT_BINARY_DIR}/dotnet/nuget/SEALNet-multi.nuspec
@ONLY)
set(SEAL_WINDOWS_SEAL_C_PATH "")
@@ -855,11 +855,11 @@ endif()
# Create SEALNet.nuspec for a local NuGet pack from SEALNet.nuspec.in
configure_file(
${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet.nuspec.in
- ${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet.nuspec
+ ${CMAKE_CURRENT_BINARY_DIR}/dotnet/nuget/SEALNet.nuspec
@ONLY)
# Create SEALNet.targets from SEALNet.targets.in
configure_file(
${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet.targets.in
- ${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet.targets
+ ${CMAKE_CURRENT_BINARY_DIR}/dotnet/nuget/SEALNet.targets
@ONLY)
diff --git a/native/src/seal/util/CMakeLists.txt b/native/src/seal/util/CMakeLists.txt
index 3f2c7ba..a15e634 100644
--- a/native/src/seal/util/CMakeLists.txt
+++ b/native/src/seal/util/CMakeLists.txt
@@ -28,7 +28,8 @@ target_sources(seal_obj PRIVATE
)
# Create the config file
-configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h.in ${CMAKE_CURRENT_LIST_DIR}/config.h)
+configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/seal/util/config.h)
+target_include_directories(seal_obj PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
# Add header files for installation
install(
@@ -38,7 +39,7 @@ install(
${CMAKE_CURRENT_LIST_DIR}/clang.h
${CMAKE_CURRENT_LIST_DIR}/clipnormal.h
${CMAKE_CURRENT_LIST_DIR}/common.h
- ${CMAKE_CURRENT_LIST_DIR}/config.h
+ ${CMAKE_CURRENT_BINARY_DIR}/seal/util/config.h
${CMAKE_CURRENT_LIST_DIR}/croots.h
${CMAKE_CURRENT_LIST_DIR}/defines.h
${CMAKE_CURRENT_LIST_DIR}/galois.h