Skip to content

Commit

Permalink
Merge pull request #47 from rest-for-physics/jgalan_mpfr_fix
Browse files Browse the repository at this point in the history
Encapsulating mpfr libraries when using REST_MPFR
  • Loading branch information
jgalan authored Jan 21, 2023
2 parents 0b2704a + adc2f56 commit 95d8d54
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ set(CMAKE_MACOSX_RPATH 1)
set( LibraryVersion "1.1" )
add_definitions(-DLIBRARY_VERSION="${LibraryVersion}")

find_path( MPFR_FOUND mpfr.h )
if( MPFR_FOUND MATCHES "MPFR_FOUND-NOTFOUND" )
if( EXISTS ${MPFR_PATH}/include/mpfr.h )
set( MPFR_FOUND FOUND )
if (${REST_MPFR} MATCHES "ON")
find_path( MPFR_FOUND mpfr.h )
if( MPFR_FOUND MATCHES "MPFR_FOUND-NOTFOUND" )
if( EXISTS ${MPFR_PATH}/include/mpfr.h )
set( MPFR_FOUND FOUND )
endif()
endif()
endif()

if( MPFR_FOUND MATCHES "MPFR_FOUND-NOTFOUND" )
message( FATAL_ERROR "MPFR library was not found. Adding the location to the installation path may solve this problem.\n Use -DMPFR_PATH=/path/to/mpfr/" )
else()
set( external_include_dirs ${external_include_dirs} ${MPFR_PATH}/include )
link_directories( ${MPFR_PATH}/lib )
endif()
if( MPFR_FOUND MATCHES "MPFR_FOUND-NOTFOUND" )
message( FATAL_ERROR "MPFR library was not found. Adding the location to the installation path may solve this problem.\n Use -DMPFR_PATH=/path/to/mpfr/" )
else()
set( external_include_dirs ${external_include_dirs} ${MPFR_PATH}/include )
link_directories( ${MPFR_PATH}/lib )
endif()
endif (${REST_MPFR} MATCHES "ON")

#-------------------------------------------------------------------------------------------------------
# Add the SolarAxionFlux library submodule as an external project.
Expand Down Expand Up @@ -48,7 +50,11 @@ if (${REST_SOLAXFLUX} MATCHES "ON")
set( external_libs ${external_libs} -laxionflux)
endif (${REST_SOLAXFLUX} MATCHES "ON")

set( external_libs ${external_libs} -lmpfr )
if (${REST_MPFR} MATCHES "ON")
set( external_libs ${external_libs} -lmpfr )
else()
set( external_libs ${external_libs} )
endif (${REST_MPFR} MATCHES "ON")

COMPILELIB("")

Expand Down

0 comments on commit 95d8d54

Please sign in to comment.