add_definitions(-DHAVE_GETTEXT)
endif()
-find_file(HUNSPELL_FOUND hunspell.hxx)
+if(WIN32)
+ find_library(HUNSPELL_LIBRARY "libhunspell")
+else()
+ find_library(HUNSPELL_LIBRARY "hunspell")
+endif()
+if (HUNSPELL_LIBRARY)
+ find_file(HUNSPELL_FOUND "hunspell/hunspell.hxx")
+endif()
if (HUNSPELL_FOUND)
- message(STATUS "----- Building with 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 "")
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")
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)
+
+option(UseExternalBoost "Use external boost" OFF)
+if(UseExternalBoost)
+ message(STATUS "Searching for boost")
+ find_package(Boost COMPONENTS signals regex)
+ 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="<config.h>")
+ include_directories(${TOP_SRC_DIR}/boost)
+ add_subdirectory(boost)
+endif()
+
-add_subdirectory(boost)
if(NOT use_external_libintl)
- add_subdirectory(intl)
+ add_subdirectory(intl)
endif()
add_subdirectory(src)