Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
MPIR: use correctly packaged version
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Apr 19, 2017
1 parent 05511d8 commit ca82e42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions cmake/ProjectMPIR.cmake
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
ExternalProject_Add(mpir
PREFIX ${CMAKE_SOURCE_DIR}/deps
DOWNLOAD_NAME mpir-master.tar.gz
DOWNLOAD_NAME mpir-cmake.tar.gz
DOWNLOAD_NO_PROGRESS TRUE
URL https://github.com/chfast/mpir/archive/master.tar.gz
URL_HASH SHA256=ed52442ab345c9dbb463d9c4bee4436785dd6a3ab6d24e461302dd3f93bedbb4
URL https://github.com/chfast/mpir/archive/cmake.tar.gz
URL_HASH SHA256=2bf35ad7aa2b61bf4c2dcdab9aab48b2b4f9d6db8b937be4b0b5fe3b5efbdfa6
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=Debug
-DMPIR_GMP=On
)

ExternalProject_Get_Property(mpir INSTALL_DIR)
add_library(MPIR::mpz STATIC IMPORTED)
set(MPIR_LIBRARY ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}mpz${CMAKE_STATIC_LIBRARY_SUFFIX})
add_library(MPIR::mpir STATIC IMPORTED)
set(MPIR_LIBRARY ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}mpir${CMAKE_STATIC_LIBRARY_SUFFIX})
set(MPIR_INCLUDE_DIR ${INSTALL_DIR}/include)
set_property(TARGET MPIR::mpz PROPERTY IMPORTED_LOCATION ${MPIR_LIBRARY})
set_property(TARGET MPIR::mpz PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MPIR_INCLUDE_DIR})
add_dependencies(MPIR::mpz mpir)
set_property(TARGET MPIR::mpir PROPERTY IMPORTED_LOCATION ${MPIR_LIBRARY})
set_property(TARGET MPIR::mpir PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MPIR_INCLUDE_DIR})
add_dependencies(MPIR::mpir mpir)
unset(INSTALL_DIR)
2 changes: 1 addition & 1 deletion cmake/ProjectSnark.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ set(SNARK_INCLUDE_DIR ${INSTALL_DIR}/include/libff)
file(MAKE_DIRECTORY ${SNARK_INCLUDE_DIR})
set_property(TARGET Snark PROPERTY IMPORTED_LOCATION ${SNARK_LIBRARY})
set_property(TARGET Snark PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SNARK_INCLUDE_DIR})
set_property(TARGET Snark PROPERTY INTERFACE_LINK_LIBRARIES MPIR::mpz)
set_property(TARGET Snark PROPERTY INTERFACE_LINK_LIBRARIES MPIR::mpir)
add_dependencies(Snark snark)
unset(INSTALL_DIR)

0 comments on commit ca82e42

Please sign in to comment.