]> git.lyx.org Git - features.git/commitdiff
Add use of installed boost libraries
authorKornel Benko <kornel@lyx.org>
Tue, 4 Aug 2009 20:56:14 +0000 (20:56 +0000)
committerKornel Benko <kornel@lyx.org>
Tue, 4 Aug 2009 20:56:14 +0000 (20:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30861 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/CMakeLists.txt
development/cmake/src/client/CMakeLists.txt
development/cmake/src/frontends/CMakeLists.txt
development/cmake/src/support/CMakeLists.txt
development/cmake/src/tex2lyx/CMakeLists.txt

index 8f8d0eaed40622a46c856ba8992e3a25d993ff62..c6b995170fb1778d4e0e0fa40f0658eb48652f9e 100644 (file)
@@ -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="<config.h>")
-
 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="<config.h>")
+  include_directories(${TOP_SRC_DIR}/boost)
+  add_subdirectory(boost)
+endif()
+
 
-add_subdirectory(boost)
 if(NOT use_external_libintl)
        add_subdirectory(intl)
 endif()
index f46a44d72cb1e376fab9a9c9e674af0f3f7cb540..3e0b18dc57f1a530abf016cceedc21aab627abdb 100644 (file)
@@ -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}
index 61bcf422bd5a856b20a53a53e48f9478bc40d396..c8a2ee426d294a8710f3aca3f948d68ec9158e1c 100644 (file)
@@ -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)
 
index 1d24fe0817efcc8a98c9b93a2079885f7d383e73..6d80dafa75ff8dc3fb2c9e83f4bb6f659908e7b7 100644 (file)
@@ -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")
index 76922d92d826ad3f61cd0ecf1c44df57f90f00fa..13857f9116b396939ae21527e3d9bd2aecef49ff 100644 (file)
@@ -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})