From: Kornel Benko Date: Sun, 19 Apr 2009 15:04:20 +0000 (+0000) Subject: Added libmythes to lyx-build X-Git-Tag: 2.0.0~6789 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ced1b3530bc66dc9a0e06406605dc33faf9188b9;p=features.git Added libmythes to lyx-build git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29334 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index e1a9d424d6..917a5d4cc3 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -372,9 +372,14 @@ else() include(ConfigureChecks.cmake) configure_file(configCompiler.h.cmake ${CMAKE_BINARY_DIR}/configCompiler.h) endif() +find_package(MyThesLIB) +if(MYTHESLIB_FOUND) + # Variables in config.h will be set correctly with configure_file() + set(HAVE_LIBMYTHES 1) + set(MYTHES_H_LOCATION 1) +endif() configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h) - find_package(ICONV REQUIRED) add_definitions(-DHAVE_ICONV=1) diff --git a/development/cmake/config.h.cmake b/development/cmake/config.h.cmake index 51ab14d530..ac744a2ae6 100644 --- a/development/cmake/config.h.cmake +++ b/development/cmake/config.h.cmake @@ -41,5 +41,7 @@ #cmakedefine USE_MACOSX_PACKAGING 1 #cmakedefine PATH_MAX ${PATH_MAX} +#cmakedefine HAVE_LIBMYTHES 1 +#cmakedefine MYTHES_H_LOCATION <${MYTHES_H}> #endif diff --git a/development/cmake/modules/FindMyThesLIB.cmake b/development/cmake/modules/FindMyThesLIB.cmake new file mode 100644 index 0000000000..bfcef1489d --- /dev/null +++ b/development/cmake/modules/FindMyThesLIB.cmake @@ -0,0 +1,39 @@ +# +# based on FindZLIB.cmake +# created 2009, Kornel Benko, +# + +set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) + +if (MYTHESLIB_INCLUDE_DIR) + # Already in cache, be silent + set(MYTHESLIB_FIND_QUIETLY TRUE) +endif() + +set(MYTHES_H mythes.hxx) +find_path(MYTHESLIB_INCLUDE_DIR ${MYTHES_H} + /usr/include + /usr/local/include) + +set(POTENTIAL_MYTHES_LIBS mythes) + +find_library(MYTHESLIB_LIBRARY NAMES ${POTENTIAL_MYTHES_LIBS} + PATHS + /usr/lib /usr/local/lib) + +if(MYTHESLIB_INCLUDE_DIR AND MYTHESLIB_LIBRARY) + set(MYTHESLIB_FOUND TRUE) +endif() + +if(MYTHESLIB_FOUND) + if(NOT MYTHESLIB_FIND_QUIETLY) + message(STATUS "Found MYTHES: ${MYTHESLIB_LIBRARY}") + endif() +else() + if(MYTHESLIB_FIND_REQUIRED) + message(STATUS "Looked for MYTHES libraries named ${POTENTIAL_MYTHES_LIBS}.") + message(STATUS "Found no acceptable MYTHES library. This is fatal.") + endif() +endif() + +mark_as_advanced(MYTHESLIB_LIBRARY MYTHESLIB_INCLUDE_DIR) diff --git a/development/cmake/src/CMakeLists.txt b/development/cmake/src/CMakeLists.txt index 763755f170..824ceaa1ef 100644 --- a/development/cmake/src/CMakeLists.txt +++ b/development/cmake/src/CMakeLists.txt @@ -30,8 +30,8 @@ list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/Section.cpp) if (ASPELL_FOUND) - include_directories(${ASPELL_INCLUDE_DIR}) - set(lyx_sources ${lyx_sources} ${TOP_SRC_DIR}/src/ASpell.cpp) + include_directories(${ASPELL_INCLUDE_DIR}) + list(APPEND lyx_sources ${TOP_SRC_DIR}/src/ASpell.cpp) endif() include_directories(${CMAKE_CURRENT_BINARY_DIR} @@ -40,11 +40,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} lyx_add_msvc_pch(lyx) -if (NOT MERGE_FILES) - set(lyx_sources ${lyx_sources}) -else() - lyx_const_touched_files(_allinone lyx_sources) - set(lyx_sources ${_allinone_files}) +if (MERGE_FILES) + lyx_const_touched_files(_allinone lyx_sources) + set(lyx_sources ${_allinone_files}) endif() if (LYX_LEAK_DETECTION) @@ -85,6 +83,10 @@ if (MINGW) target_link_libraries(${_lyx} ole32) endif() +if (MYTHES_LIBS) + target_link_libraries(${_lyx} ${MYTHESLIB_LIBRARY}) +endif() + project_source_group("${GROUP_CODE}" lyx_sources lyx_headers) install(TARGETS ${_lyx} DESTINATION bin)