From kde-commits Fri Dec 07 04:32:26 2007 From: Michael Pyne Date: Fri, 07 Dec 2007 04:32:26 +0000 To: kde-commits Subject: playground/utils/abakus Message-Id: <1197001946.140142.12504.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=119700195317214 SVN commit 745805 by mpyne: Add in proper configure check for mpfr. M +18 -0 CMakeLists.txt M +1 -1 src/CMakeLists.txt M +1 -1 src/numerictypes.h --- trunk/playground/utils/abakus/CMakeLists.txt #745804:745805 @@ -4,7 +4,25 @@ FIND_PACKAGE(KDE4 REQUIRED) include(KDE4Defaults) +include(CheckCXXSourceCompiles) +# Check for libmpfr and libgmp, and verify existence of _mpfr_struct +set(CMAKE_REQUIRED_LIBRARIES gmp mpfr) +check_cxx_source_compiles( + "#include + + int main() { + mpfr_t a; + mpfr_ptr ptr; + __mpfr_struct debug; + + mpfr_init(a); + return 0; + } + " + HAVE_MPFR + ) + INCLUDE_DIRECTORIES(${KDE4_INCLUDES} ${QT4_INCLUDES}) ADD_DEFINITIONS(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) --- trunk/playground/utils/abakus/src/CMakeLists.txt #745804:745805 @@ -123,8 +123,8 @@ ) set(MPFR_LIBS) -set(HAVE_MPFR 0) IF(HAVE_MPFR) + MESSAGE("Using the MPFR high-precision mathematics library") SET(MPFR_LIBS mpfr gmp) ELSE(HAVE_MPFR) SET(abakus_SRCS ${abakus_SRCS} hmath.cpp number.c) --- trunk/playground/utils/abakus/src/numerictypes.h #745804:745805 @@ -260,7 +260,7 @@ explicit number(const QByteArray &str) { m_t = (mpfr_ptr) new __mpfr_struct; - mpfr_init_set_str (m_tr, str.constData(), 10, RoundDirection); + mpfr_init_set_str (m_t, str.constData(), 10, RoundDirection); } explicit number(int i)