From 050c89c3d8909b4d86e3665c75789ed0b6bce986 Mon Sep 17 00:00:00 2001 From: Matchman Green Date: Fri, 25 May 2012 00:56:19 +0800 Subject: [PATCH] trying to make libiberty optional --- cmake/Modules/FindIberty.cmake | 4 +++- libgrive/CMakeLists.txt | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/FindIberty.cmake b/cmake/Modules/FindIberty.cmake index c6ea8f2..90544fb 100644 --- a/cmake/Modules/FindIberty.cmake +++ b/cmake/Modules/FindIberty.cmake @@ -10,11 +10,13 @@ IF (IBERTY_LIBRARY) # show which JSON-C was found only if not quiet MESSAGE( STATUS "Found libiberty: ${IBERTY_LIBRARY}") + + SET(IBERTY_FOUND TRUE) ELSE (IBERTY_LIBRARY) IF ( IBERTY_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find libiberty") - ENDIF (JSONC_FIND_REQUIRED) + ENDIF (IBERTY_FIND_REQUIRED) ENDIF (IBERTY_LIBRARY) diff --git a/libgrive/CMakeLists.txt b/libgrive/CMakeLists.txt index 01c792d..ba17ce9 100644 --- a/libgrive/CMakeLists.txt +++ b/libgrive/CMakeLists.txt @@ -7,10 +7,9 @@ find_package(JSONC REQUIRED) find_package(CURL REQUIRED) find_package(EXPAT REQUIRED) find_package(Boost COMPONENTS filesystem system REQUIRED) -find_package(GDBM REQUIRED) find_package(BFD) find_package(CppUnit) -find_package(Iberty REQUIRED) +find_package(Iberty) # additional headers if build unit tests IF ( CPPUNIT_FOUND ) @@ -27,6 +26,10 @@ if ( BFD_FOUND ) endif ( BFD_FOUND ) +if ( IBERTY_FOUND ) + set( OPT_LIBS ${OPT_LIBS} ${IBERTY_LIBRARY} ) +endif ( IBERTY_FOUND ) + include_directories( ${libgrive_SOURCE_DIR}/src ${libgrive_SOURCE_DIR}/test