From: Kornel Benko Date: Tue, 4 Aug 2009 20:56:14 +0000 (+0000) Subject: Add use of installed boost libraries X-Git-Tag: 2.0.0~5847 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ad8a353281babd0096503462a0b0b6fa4213027d;p=features.git Add use of installed boost libraries git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30861 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index 8f8d0eaed4..c6b995170f 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -195,19 +195,19 @@ if(use_external_libintl) endif() if(WIN32) - find_library(HUNSPELL_LIBRARY "libhunspell") + find_library(HUNSPELL_LIBRARY "libhunspell") else() - find_library(HUNSPELL_LIBRARY "hunspell") + find_library(HUNSPELL_LIBRARY "hunspell") endif() if (HUNSPELL_LIBRARY) - find_file(HUNSPELL_FOUND "hunspell/hunspell.hxx") + find_file(HUNSPELL_FOUND "hunspell/hunspell.hxx") endif() if (HUNSPELL_FOUND) - add_definitions(-DUSE_HUNSPELL=1) - message(STATUS "----- Building with USE_HUNSPELL") + add_definitions(-DUSE_HUNSPELL=1) + message(STATUS "----- Building with USE_HUNSPELL") else() - message(STATUS "----- Hunspell not found, building without hunspell support") + message(STATUS "----- Hunspell not found, building without hunspell support") endif() message(STATUS "") @@ -259,8 +259,6 @@ endforeach(_v) message(STATUS "") -add_definitions(-DBOOST_USER_CONFIG="") - if(MSVC AND NOT disable-pch AND NOT MERGE_FILES) message(STATUS "-----") message(STATUS "----- using precompiled headers, disable with -Ddisable-pch=1") @@ -394,12 +392,28 @@ configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h) find_package(ICONV REQUIRED) add_definitions(-DHAVE_ICONV=1) + include_directories( - ${CMAKE_BINARY_DIR} - ${TOP_SRC_DIR}/src - ${TOP_SRC_DIR}/boost) + ${CMAKE_BINARY_DIR} + ${TOP_SRC_DIR}/src) +if(UseExternalBoost) + message(STATUS "Searching for boost") + find_package(Boost COMPONENTS signals regex) +else() + message(STATUS "----- Using internal boost. To build with installed version use -DUseExternalBoost:BOOL=ON") +endif() + +if(Boost_FOUND) + message(STATUS "Boost found") + message(STATUS "Boost-libs = ${Boost_LIBRARIES}") +else() + message(STATUS "Boost not found" ${Boost_ERROR_REASON}) + add_definitions(-DBOOST_USER_CONFIG="") + include_directories(${TOP_SRC_DIR}/boost) + add_subdirectory(boost) +endif() + -add_subdirectory(boost) if(NOT use_external_libintl) add_subdirectory(intl) endif() diff --git a/development/cmake/src/client/CMakeLists.txt b/development/cmake/src/client/CMakeLists.txt index f46a44d72c..3e0b18dc57 100644 --- a/development/cmake/src/client/CMakeLists.txt +++ b/development/cmake/src/client/CMakeLists.txt @@ -17,10 +17,14 @@ include_directories(BEFORE "${TOP_SRC_DIR}/src/client" add_executable(${_lyxclient} ${_lyxclient_sources} ${_lyxclient_headers}) +if(Boost_FOUND) + target_link_libraries(${_lyxclient} ${Boost_LIBRARIES}) +else() + target_link_libraries(${_lyxclient} boost_regex) +endif() target_link_libraries(${_lyxclient} support - boost_regex ${LIBINTL_LIBRARIES} ${ICONV_LIBRARY} ${QT_QTCORE_LIBRARY} diff --git a/development/cmake/src/frontends/CMakeLists.txt b/development/cmake/src/frontends/CMakeLists.txt index 61bcf422bd..c8a2ee426d 100644 --- a/development/cmake/src/frontends/CMakeLists.txt +++ b/development/cmake/src/frontends/CMakeLists.txt @@ -23,7 +23,11 @@ else() add_library(frontends ${library_type} ${_allinone_files}) endif() -target_link_libraries(frontends boost_regex) +if(Boost_FOUND) + target_link_libraries(frontends ${Boost_LIBRARIES}) +else() + target_link_libraries(frontends boost_regex) +endif() project_source_group("${GROUP_CODE}" frontends_sources frontends_headers) diff --git a/development/cmake/src/support/CMakeLists.txt b/development/cmake/src/support/CMakeLists.txt index 1d24fe0817..6d80dafa75 100644 --- a/development/cmake/src/support/CMakeLists.txt +++ b/development/cmake/src/support/CMakeLists.txt @@ -61,7 +61,13 @@ else() ${support_mythes_sources} ${support_linkback_sources} ${support_headers} ${dont_merge}) endif() -target_link_libraries(support boost_signals ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY}) +if(Boost_FOUND) + target_link_libraries(support ${Boost_LIBRARIES}) +else() + target_link_libraries(support boost_signals) +endif() + +target_link_libraries(support ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY}) if(APPLE) target_link_libraries(support "objc" "-framework Appkit" "-framework CoreFoundation") diff --git a/development/cmake/src/tex2lyx/CMakeLists.txt b/development/cmake/src/tex2lyx/CMakeLists.txt index 76922d92d8..13857f9116 100644 --- a/development/cmake/src/tex2lyx/CMakeLists.txt +++ b/development/cmake/src/tex2lyx/CMakeLists.txt @@ -38,9 +38,14 @@ else() endif() +if(Boost_FOUND) + target_link_libraries(${_tex2lyx} ${Boost_LIBRARIES}) +else() + target_link_libraries(${_tex2lyx} boost_regex) +endif() + target_link_libraries(${_tex2lyx} support - boost_regex ${QT_QTCORE_LIBRARY} ${LIBINTL_LIBRARIES} ${ICONV_LIBRARY})