--- /dev/null
+cmake_minimum_required(VERSION 2.4.4)
+set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
+
+project(zlib C)
+
+set(VERSION "1.2.5")
+set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/${VERSION})
+
+file(GLOB support_mythes_sources ${SRCDIR}/*.cxx)
+file(GLOB support_mythes_headers ${SRCDIR}/*.hxx)
+
+include_directories(${VERSION})
+
+#============================================================================
+# lyxmytheslib
+#============================================================================
+
+add_library(mytheslibstatic STATIC ${support_mythes_sources} ${support_mythes_headers} )
+
+
+set(MYTHESLIB_LIBRARY mytheslibstatic CACHE STRING "Mytheslib library" FORCE)
+set(MYTHESLIB_INCLUDE_DIR ${SRCDIR} CACHE STRING "Mytheslib include dir" FORCE)
+set(MYTHESLIB_FOUND CACHE STRING "Mytheslib found" FORCE )
+
+set_target_properties(mytheslibstatic PROPERTIES FOLDER "3rd_party")
LYX_OPTION(ASAN "Use address sanitizer" OFF ALL)
LYX_COMBO(USE_QT "Use Qt version as frontend" QT4 QT5)
#LYX_OPTION(3RDPARTY_BUILD "Build 3rdparty libs" OFF ALL)
-LYX_OPTION(EXTERNAL_Z "Do not build 3rdparty lib zlib" ON ALL)
-LYX_OPTION(EXTERNAL_ICONV "Do not build 3rdparty lib iconvlib" ON ALL)
-LYX_OPTION(EXTERNAL_HUNSPELL "Do not build 3rdparty lib hunspelllib" ON ALL)
-LYX_OPTION(EXTERNAL_MYTHES "Do not build 3rdparty lib mytheslib" OFF ALL)
+LYX_OPTION(EXTERNAL_Z "OFF := Build 3rdparty lib zlib" ON ALL)
+LYX_OPTION(EXTERNAL_ICONV "OFF := Build 3rdparty lib iconvlib" ON ALL)
+LYX_OPTION(EXTERNAL_HUNSPELL "OFF := Build 3rdparty lib hunspelllib" ON ALL)
+LYX_COMBO(EXTERNAL_MYTHES "OFF := Build 3rdparty lib mytheslib" AUTO OFF ON)
# GCC specific
LYX_OPTION(PROFILE "Build profile version" OFF GCC)
set(LYX_CPACK ON)
endif()
-if (LYX_EXTERNAL_MYTHES)
- message(FATAL_ERROR "Compilation with system mythes not supported yet")
-else()
- set(MYTHES_DIR "${TOP_SRC_DIR}/3rdparty/mythes/1.2.5")
-endif()
-
if(LYX_CPACK)
set(LYX_INSTALL ON)
endif()
set(LYX_EXTERNAL_Z OFF CACHE BOOL "Build 3rdparty lib zlib" FORCE)
set(LYX_EXTERNAL_ICONV OFF CACHE BOOL "Build 3rdparty iconvlib" FORCE)
set(LYX_EXTERNAL_HUNSPELL OFF CACHE BOOL "Build 3rdparty hunspelllib" FORCE)
+ set(LYX_EXTERNAL_MYTHES OFF CACHE STRING "Build 3rdparty mytheslib" FORCE)
endif()
macro(setstripped _varname)
set(Spelling_FOUND OFF)
set(Include_used_spellchecker) # String will be inserted into config.h
+if (LYX_EXTERNAL_MYTHES MATCHES "AUTO")
+ # try system library first
+ find_package(MyThesLIB)
+ if (MYTHESLIB_FOUND)
+ set(LYX_EXTERNAL_MYTHES CACHE STRING "ON" FORCE)
+ else()
+ set(LYX_EXTERNAL_MYTHES CACHE STRING "OFF" FORCE)
+ endif()
+endif()
+if (LYX_EXTERNAL_MYTHES MATCHES "ON")
+ find_package(MyThesLIB REQUIRED)
+else()
+ add_subdirectory(3rdparty/mythes)
+endif()
+set(MYTHES_DIR ${MYTHESLIB_INCLUDE_DIR})
+
if(NOT LYX_EXTERNAL_HUNSPELL)
add_subdirectory(3rdparty/hunspell)
add_definitions(-DHUNSPELL_STATIC)
/usr/include
/usr/local/include)
-set(POTENTIAL_MYTHES_LIBS mythes)
+set(POTENTIAL_MYTHES_LIBS mythes-1.2)
find_library(MYTHESLIB_LIBRARY NAMES ${POTENTIAL_MYTHES_LIBS}
PATHS ${SYSTEM_LIB_DIRS} )
frontend_qt
graphics
support
+ ${MYTHESLIB_LIBRARY}
${ICONV_LIBRARY}
${LYX_QTMAIN_LIBRARY}
${vld_dll})
file(GLOB support_headers ${TOP_SRC_DIR}/src/support/${LYX_HPP_FILES})
-file(GLOB support_mythes_sources ${MYTHES_DIR}/*.cxx)
-file(GLOB support_mythes_headers ${MYTHES_DIR}/*.hxx)
-
file(GLOB support_linkback_sources ${TOP_SRC_DIR}/src/support/linkback/*.m*)
file(GLOB support_linkback_headers ${TOP_SRC_DIR}/src/support/linkback/*.h)
include_directories(
${TOP_SRC_DIR}/src/support
${TOP_BINARY_DIR}/src/support
- ${MYTHES_DIR}
${QT_INCLUDES}
${ICONV_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR})
if(NOT LYX_MERGE_FILES)
- set(support_sources ${support_sources} ${support_mythes_sources} ${support_linkback_sources})
- set(support_headers ${support_headers} ${support_mythes_headers} ${support_linkback_headers})
+ set(support_sources ${support_sources} ${support_linkback_sources})
+ set(support_headers ${support_headers} ${support_linkback_headers})
add_library(support ${library_type} ${support_sources} ${support_headers} ${dont_merge})
else()
# GCC bug: gcc resolves ::bind as boost::bind
set_source_files_properties(_allinone_touched.C
PROPERTIES OBJECT_DEPENDS "${depends_moc}")
add_library(support ${library_type} ${_allinone_files} ${support_separate}
- ${support_mythes_sources} ${support_linkback_sources} ${support_headers} ${dont_merge})
+ ${support_linkback_sources} ${support_headers} ${dont_merge})
endif()
set_target_properties(support PROPERTIES FOLDER "applications/LyX")