]> git.lyx.org Git - lyx.git/blobdiff - development/cmake/CMakeLists.txt
TR1: use std::tr1 regex with msvc10
[lyx.git] / development / cmake / CMakeLists.txt
index a9ab21ed97f9aa56d46b6238b2358b9cd532a2b9..2237d4856d9ace27d16978c2d7aba7d3ead61969 100644 (file)
@@ -2,8 +2,9 @@
 # This file is part of LyX, the document processor.
 # Licence details can be found in the file COPYING.
 #
-# Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
-#
+# Copyright (c) 2006-2010 Peter Kümmel, <syntheticpp@gmx.net>
+# Copyright (c) 2008-2010 Kornel Benko, <Kornel.Benko@berlin.de>
+
 
 cmake_minimum_required(VERSION 2.4)
 
@@ -97,9 +98,15 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
   endif()
 endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
 
+if (WIN32)
+  set(DATA_SUBDIR "Resources/" CACHE STRING "Subdirectory for all lyx-system-data" FORCE)
+else()
+  set(DATA_SUBDIR "" CACHE STRING "Subdirectory for all lyx-system-data" FORCE)
+endif()
+
 set(LYX_ABS_INSTALLED_DATADIR "${CMAKE_INSTALL_PREFIX}")
 set(LYX_LOCALEDIR "locale")
-set(LYX_ABS_INSTALLED_LOCALEDIR "${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}")
+set(LYX_ABS_INSTALLED_LOCALEDIR "${LYX_ABS_INSTALLED_DATADIR}/${DATA_SUBDIR}${LYX_LOCALEDIR}")
 set(LYX_ABS_TOP_SRCDIR "${TOP_SRC_DIR}")
 
 
@@ -174,7 +181,7 @@ if(NOT MSVC)
                set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCPP_CONCEPT_CHECKS")
        endif()
        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)
+       set(CMAKE_CXX_FLAGS_DEBUG    "${LYX_CXX_FLAGS} -fno-strict-aliasing -O0 -g -D_DEBUG" CACHE TYPE STRING FORCE)
        if(MINGW)
                set(CMAKE_CXX_FLAGS_RELEASE  "${LYX_CXX_FLAGS} -O2 -DNDEBUG" CACHE TYPE STRING FORCE)
        else()
@@ -208,7 +215,7 @@ if(WIN32)
   find_library(HUNSPELL_LIBRARY "libhunspell")
 else()
   #find_library(HUNSPELL_LIBRARY NAME "hunspell" PATH "/usr/local/lib" "/usr/lib" NO_DEFAULT_PATH)
-  find_library(HUNSPELL_LIBRARY "hunspell" "/usr/local/lib" "/usr/lib")
+  find_library(HUNSPELL_LIBRARY NAMES "hunspell" "hunspell-1.2" PATHS "/usr/local/lib" "/usr/lib" "/usr/lib64")
 endif()
 if (HUNSPELL_LIBRARY)
   find_file(HUNSPELL_FOUND "hunspell/hunspell.hxx")
@@ -225,8 +232,8 @@ 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)
+  find_library(ENCHANT_LIBRARY "enchant"  "/usr/local/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib")
+  find_path(ENCHANT_INCLUDE_DIR "enchant++.h" PATHS /usr/local/include /usr/local/include/enchant /usr/include /usr/include/enchant /opt/local/include/enchant)
 endif()
 if (ENCHANT_LIBRARY AND ENCHANT_INCLUDE_DIR)
   set(ENCHANT_FOUND TRUE)
@@ -378,7 +385,7 @@ if(MSVC)
                # add here warnings which should produce an error /weXXXX
                set(MSVC_W_ERROR   "/we4101 /we4189")
                # add here warnings which should be disabled /wdXXXX
-               set(MSVC_W_DISABLE "/wd4288 /wd4355 /wd4800 /wd4996 /wd4311 /wd4312 /wd4505 /wd4267 /wd4512 /wd4245 /wd4127 /wd4180")
+               set(MSVC_W_DISABLE "/wd4288 /wd4355 /wd4800 /wd4996 /wd4311 /wd4312 /wd4505 /wd4267 /wd4512 /wd4245 /wd4127 /wd4180 /wd4231")
 
                set(CMAKE_CXX_FLAGS_DEBUG
                        "${CMAKE_CXX_FLAGS_DEBUG} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
@@ -396,7 +403,7 @@ if(MSVC)
                # add here warnings which should produce an error /weXXXX
                set(MSVC_W_ERROR   "/we4101 /we4189")
                # add here warnings which should be disabled /wdXXXX
-               set(MSVC_W_DISABLE "/wd4288 /wd4355 /wd4800 /wd4996 /wd4267 /wd4180")
+               set(MSVC_W_DISABLE "/wd4288 /wd4355 /wd4800 /wd4996 /wd4267 /wd4180 /wd4231")
 
                set(CMAKE_CXX_FLAGS_DEBUG
                        "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
@@ -472,7 +479,7 @@ if(UseExternalBoost)
   endif()
 else()
   message(STATUS "----- Using internal boost. To build with installed version use -DUseExternalBoost:BOOL=ON")
-  set(Lyx_Boost_Libraries boost_signals boost_regex)
+  set(Lyx_Boost_Libraries boost_signals ${BOOST_REGEX_LIB})
   add_definitions(-DBOOST_USER_CONFIG="<config.h>")
   include_directories(${TOP_SRC_DIR}/boost)
   add_subdirectory(boost)