Skip to content

Commit 1210bc5

Browse files
authored
OpenFHE: fix library install directory in CMake (#7880)
* OpenFHE: fix library path in CMakeTargets file * Properly fix the library install dir in upstream sources
1 parent 9c06977 commit 1210bc5

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

O/OpenFHE/build_tarballs.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ sources = [
1616
script = raw"""
1717
cd $WORKSPACE/srcdir/openfhe-development/
1818
19+
# Add missing `<cmath>` header to avoid disambiguities in macOS builds
1920
if [[ "${target}" == *-apple* ]]; then
2021
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/macos-include-cmath.patch"
2122
fi
2223
24+
# Set proper install directories for libraries on Windows
25+
if [[ "${target}" == *-mingw* ]]; then
26+
atomic_patch -p1 "${WORKSPACE}/srcdir/patches/windows-fix-cmake-libdir.patch"
27+
fi
28+
2329
mkdir build && cd build
2430
2531
cmake .. \
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
--- a/src/binfhe/CMakeLists.txt
2+
+++ b/src/binfhe/CMakeLists.txt
3+
@@ -26,7 +26,9 @@ if ( BUILD_SHARED )
4+
set_property(TARGET OPENFHEbinfhe PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
5+
install(TARGETS OPENFHEbinfhe
6+
EXPORT OpenFHETargets
7+
- DESTINATION lib)
8+
+ RUNTIME DESTINATION bin
9+
+ LIBRARY DESTINATION lib
10+
+ ARCHIVE DESTINATION lib)
11+
endif()
12+
13+
if( BUILD_STATIC )
14+
--- a/src/core/CMakeLists.txt
15+
+++ b/src/core/CMakeLists.txt
16+
@@ -28,7 +28,9 @@ if ( BUILD_SHARED )
17+
set_property(TARGET OPENFHEcore PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
18+
install(TARGETS OPENFHEcore
19+
EXPORT OpenFHETargets
20+
- DESTINATION lib)
21+
+ RUNTIME DESTINATION bin
22+
+ LIBRARY DESTINATION lib
23+
+ ARCHIVE DESTINATION lib)
24+
endif()
25+
26+
27+
--- a/src/pke/CMakeLists.txt
28+
+++ b/src/pke/CMakeLists.txt
29+
@@ -26,7 +26,9 @@ if( BUILD_SHARED )
30+
set_property(TARGET OPENFHEpke PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
31+
install(TARGETS OPENFHEpke
32+
EXPORT OpenFHETargets
33+
- DESTINATION lib)
34+
+ RUNTIME DESTINATION bin
35+
+ LIBRARY DESTINATION lib
36+
+ ARCHIVE DESTINATION lib)
37+
endif()
38+
39+
if( BUILD_STATIC )

0 commit comments

Comments
 (0)