diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index dd335badbf..50f38244d4 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -396,7 +396,7 @@ add_definitions(-DHAVE_ICONV=1) include_directories( ${CMAKE_BINARY_DIR} ${TOP_SRC_DIR}/src) - + option(UseExternalBoost "Use external boost" OFF) if(UseExternalBoost) message(STATUS "Searching for boost") @@ -404,11 +404,13 @@ if(UseExternalBoost) if(Boost_FOUND) message(STATUS "Boost found") message(STATUS "Boost-libs = ${Boost_LIBRARIES}") + set(Lyx_Boost_Libraries ${Boost_LIBRARIES}) else() message(FATAL_ERROR "Boost not found" ${Boost_ERROR_REASON}) endif() else() message(STATUS "----- Using internal boost. To build with installed version use -DUseExternalBoost:BOOL=ON") + set(Lyx_Boost_Libraries boost_signals boost_regex) add_definitions(-DBOOST_USER_CONFIG="") include_directories(${TOP_SRC_DIR}/boost) add_subdirectory(boost) @@ -416,7 +418,7 @@ endif() if(NOT use_external_libintl) - add_subdirectory(intl) + add_subdirectory(intl) endif() add_subdirectory(src) diff --git a/development/cmake/src/client/CMakeLists.txt b/development/cmake/src/client/CMakeLists.txt index d8b25d9136..3442a902e3 100644 --- a/development/cmake/src/client/CMakeLists.txt +++ b/development/cmake/src/client/CMakeLists.txt @@ -17,14 +17,9 @@ 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 + ${Lyx_Boost_Libraries} ${LIBINTL_LIBRARIES} ${ICONV_LIBRARY} ${QT_QTCORE_LIBRARY} @@ -32,11 +27,11 @@ target_link_libraries(${_lyxclient} ) if (ASPELL_FOUND) - target_link_libraries(${_lyxclient} ${ASPELL_LIBRARY}) + target_link_libraries(${_lyxclient} ${ASPELL_LIBRARY}) endif() if (APPLE) - target_link_libraries(${_lyxclient} "-framework Carbon") + target_link_libraries(${_lyxclient} "-framework Carbon") endif() install(TARGETS ${_lyxclient} DESTINATION bin) diff --git a/development/cmake/src/frontends/CMakeLists.txt b/development/cmake/src/frontends/CMakeLists.txt index c8a2ee426d..a263e2ba38 100644 --- a/development/cmake/src/frontends/CMakeLists.txt +++ b/development/cmake/src/frontends/CMakeLists.txt @@ -23,11 +23,7 @@ else() add_library(frontends ${library_type} ${_allinone_files}) endif() -if(Boost_FOUND) - target_link_libraries(frontends ${Boost_LIBRARIES}) -else() - target_link_libraries(frontends boost_regex) -endif() +target_link_libraries(frontends ${Lyx_Boost_Libraries}) 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 78637c8c70..92af3dee7f 100644 --- a/development/cmake/src/support/CMakeLists.txt +++ b/development/cmake/src/support/CMakeLists.txt @@ -61,13 +61,7 @@ else() ${support_mythes_sources} ${support_linkback_sources} ${support_headers} ${dont_merge}) endif() -if(Boost_FOUND) - target_link_libraries(support ${Boost_LIBRARIES}) -else() - target_link_libraries(support boost_signals boost_regex) -endif() - -target_link_libraries(support ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY}) +target_link_libraries(support ${Lyx_Boost_Libraries} ${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 13857f9116..3d512f0b52 100644 --- a/development/cmake/src/tex2lyx/CMakeLists.txt +++ b/development/cmake/src/tex2lyx/CMakeLists.txt @@ -37,15 +37,9 @@ else() add_executable(${_tex2lyx} ${_allinone_files} ${_allinone_linked_files}) endif() - -if(Boost_FOUND) - target_link_libraries(${_tex2lyx} ${Boost_LIBRARIES}) -else() - target_link_libraries(${_tex2lyx} boost_regex) -endif() - target_link_libraries(${_tex2lyx} support + ${Lyx_Boost_Libraries} ${QT_QTCORE_LIBRARY} ${LIBINTL_LIBRARIES} ${ICONV_LIBRARY})