From ade83c6d709686a6a5974c35dd1285363274d635 Mon Sep 17 00:00:00 2001 From: Matchman Green Date: Thu, 24 May 2012 23:25:49 +0800 Subject: [PATCH] added libiberty. now can be built in OpenSUSE 12.1. Thanks Arif Widi Nugroho for the help! --- cmake/Modules/FindIberty.cmake | 20 ++++++++++++++++++++ libgrive/CMakeLists.txt | 7 +++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 cmake/Modules/FindIberty.cmake diff --git a/cmake/Modules/FindIberty.cmake b/cmake/Modules/FindIberty.cmake new file mode 100644 index 0000000..c6ea8f2 --- /dev/null +++ b/cmake/Modules/FindIberty.cmake @@ -0,0 +1,20 @@ +# - Find Iberty +# This module finds libiberty. +# +# It sets the following variables: +# IBERTY_LIBRARY - The JSON-C library to link against. + +FIND_LIBRARY( IBERTY_LIBRARY NAMES iberty ) + +IF (IBERTY_LIBRARY) + + # show which JSON-C was found only if not quiet + MESSAGE( STATUS "Found libiberty: ${IBERTY_LIBRARY}") + +ELSE (IBERTY_LIBRARY) + + IF ( IBERTY_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find libiberty") + ENDIF (JSONC_FIND_REQUIRED) + +ENDIF (IBERTY_LIBRARY) diff --git a/libgrive/CMakeLists.txt b/libgrive/CMakeLists.txt index 65323c7..01c792d 100644 --- a/libgrive/CMakeLists.txt +++ b/libgrive/CMakeLists.txt @@ -10,11 +10,14 @@ find_package(Boost COMPONENTS filesystem system REQUIRED) find_package(GDBM REQUIRED) find_package(BFD) find_package(CppUnit) +find_package(Iberty REQUIRED) +# additional headers if build unit tests IF ( CPPUNIT_FOUND ) set( OPT_INCS ${CPPUNIT_INCLUDE_DIR} ) ENDIF ( CPPUNIT_FOUND ) +# build bfd classes if libbfd is found if ( BFD_FOUND ) set( OPT_LIBS ${DL_LIBRARY} ${BFD_LIBRARY} ) file( GLOB OPT_SRC @@ -69,9 +72,9 @@ target_link_libraries( grive ${OPENSSL_LIBRARIES} ${GDBM_LIBRARIES} ${Boost_LIBRARIES} + ${IBERTY_LIBRARY} + ${EXPAT_LIBRARY} ${OPT_LIBS} - expat - stdc++ ) set_target_properties(grive PROPERTIES