]> git.lyx.org Git - lyx.git/blobdiff - development/cmake/CMakeLists.txt
Remove moc-files from the set of source files
[lyx.git] / development / cmake / CMakeLists.txt
index 5477d69129442df24a806bb1dc6ffa1f02b6045a..65009f0d96d85b1e20746d35a37690347defba0d 100644 (file)
@@ -108,6 +108,7 @@ endif()
 # lyx's source files
 set(LYX_CPP_FILES *.cpp)
 set(LYX_HPP_FILES *.h)
+set(LYX_MOC_FILES moc_*.cpp)
 
 include(LyXMacros)
 include(ProjectSourceGroup)
@@ -168,8 +169,8 @@ if(NOT MSVC)
        if(concept-checks)
                set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCPP_CONCEPT_CHECKS")
        endif()
-       set(CMAKE_CXX_FLAGS          "${LYX_CXX_FLAGS}" CACHE TYPE STRING FORCE)
-       set(CMAKE_CXX_FLAGS_DEBUG    "${LYX_CXX_FLAGS} -O -g -D_DEBUG" CACHE TYPE STRING FORCE)
+       set(CMAKE_CXX_FLAGS          "${LYX_CXX_FLAGS} -fno-strict-aliasing " CACHE TYPE STRING FORCE)
+       set(CMAKE_CXX_FLAGS_DEBUG    "${LYX_CXX_FLAGS} -fno-strict-aliasing -O -g -D_DEBUG" CACHE TYPE STRING FORCE)
        if(MINGW)
                set(CMAKE_CXX_FLAGS_RELEASE  "${LYX_CXX_FLAGS} -O2 -DNDEBUG" CACHE TYPE STRING FORCE)
        else()
@@ -216,6 +217,21 @@ else()
   message(STATUS "----- Hunspell not found, building without hunspell support")
 endif()
 
+if(WIN32)
+  find_library(ENCHANT_LIBRARY "libenchant")
+  find_path(ENCHANT_INCLUDE_DIR "enchant++.h")
+else()
+  find_library(ENCHANT_LIBRARY "enchant"  "/usr/local/lib" "/usr/lib")
+  find_path(ENCHANT_INCLUDE_DIR "enchant++.h" PATHS /usr/local/include /usr/local/include/enchant /usr/include /usr/include/enchant)
+endif()
+if (ENCHANT_LIBRARY AND ENCHANT_INCLUDE_DIR)
+  set(ENCHANT_FOUND TRUE)
+  add_definitions(-DUSE_ENCHANT=1)
+  message(STATUS "----- Building with USE_ENCHANT")
+else()
+  message(STATUS "----- Enchant not found, building without enchant support")
+endif()
+
 message(STATUS "")
 if(nls OR all)
        set(nls TRUE CACHE TYPE STRING)