]> git.lyx.org Git - features.git/commitdiff
Added libmythes to lyx-build
authorKornel Benko <kornel@lyx.org>
Sun, 19 Apr 2009 15:04:20 +0000 (15:04 +0000)
committerKornel Benko <kornel@lyx.org>
Sun, 19 Apr 2009 15:04:20 +0000 (15:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29334 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/CMakeLists.txt
development/cmake/config.h.cmake
development/cmake/modules/FindMyThesLIB.cmake [new file with mode: 0644]
development/cmake/src/CMakeLists.txt

index e1a9d424d65e9f520e63a74816ab554535216f05..917a5d4cc3e000e14f5f54db820208c0f23b4464 100644 (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)
 
index 51ab14d53096000088e1ed6a9e5f7a193ee482b6..ac744a2ae6bf2d61e613b8df4e387d6f6f9ecd56 100644 (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
diff --git a/development/cmake/modules/FindMyThesLIB.cmake b/development/cmake/modules/FindMyThesLIB.cmake
new file mode 100644 (file)
index 0000000..bfcef14
--- /dev/null
@@ -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)
index 763755f1703ba5afe18e66936525e377efe87929..824ceaa1efc7b2ae31912a98b7ba3e43c3995a35 100644 (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)