Added libmythes to lyx-build

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29334 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Kornel Benko 2009-04-19 15:04:20 +00:00
parent ee32af52da
commit ced1b3530b
4 changed files with 56 additions and 8 deletions

View File

@ -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)

View File

@ -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

View File

@ -0,0 +1,39 @@
#
# based on FindZLIB.cmake
# created 2009, Kornel Benko, <kornel.benko@berlin.de>
#
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)

View File

@ -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)