diff --git a/CMakeLists.txt b/CMakeLists.txt index 8aaefa06..f07abd07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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. @@ -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("")