Skip to content

Commit

Permalink
OpenFHE: fix library install directory in CMake (#7880)
Browse files Browse the repository at this point in the history
* OpenFHE: fix library path in CMakeTargets file

* Properly fix the library install dir in upstream sources
  • Loading branch information
sloede authored Dec 31, 2023
1 parent 9c06977 commit 1210bc5
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions O/OpenFHE/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ sources = [
script = raw"""
cd $WORKSPACE/srcdir/openfhe-development/
# Add missing `<cmath>` header to avoid disambiguities in macOS builds
if [[ "${target}" == *-apple* ]]; then
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/macos-include-cmath.patch"
fi
# Set proper install directories for libraries on Windows
if [[ "${target}" == *-mingw* ]]; then
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/windows-fix-cmake-libdir.patch"
fi
mkdir build && cd build
cmake .. \
Expand Down
39 changes: 39 additions & 0 deletions O/OpenFHE/bundled/patches/windows-fix-cmake-libdir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--- a/src/binfhe/CMakeLists.txt
+++ b/src/binfhe/CMakeLists.txt
@@ -26,7 +26,9 @@ if ( BUILD_SHARED )
set_property(TARGET OPENFHEbinfhe PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
install(TARGETS OPENFHEbinfhe
EXPORT OpenFHETargets
- DESTINATION lib)
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
endif()

if( BUILD_STATIC )
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -28,7 +28,9 @@ if ( BUILD_SHARED )
set_property(TARGET OPENFHEcore PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
install(TARGETS OPENFHEcore
EXPORT OpenFHETargets
- DESTINATION lib)
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
endif()


--- a/src/pke/CMakeLists.txt
+++ b/src/pke/CMakeLists.txt
@@ -26,7 +26,9 @@ if( BUILD_SHARED )
set_property(TARGET OPENFHEpke PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
install(TARGETS OPENFHEpke
EXPORT OpenFHETargets
- DESTINATION lib)
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
endif()

if( BUILD_STATIC )

0 comments on commit 1210bc5

Please sign in to comment.