mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
cmake cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19871 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
34aba4a42b
commit
83c9b040e7
@ -211,9 +211,12 @@ if(MSVC)
|
||||
# add here warnings which should be disabled /wdXXXX
|
||||
set(MSVC_W_DISABLE "/wd4800 /wd4996 /wd4311 /wd4312 /wd4505 /wd4267 /wd4512 /wd4245 /wd4127 /wd4180")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG
|
||||
"${CMAKE_CXX_FLAGS_DEBUG} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASEs
|
||||
"${CMAKE_CXX_FLAGS_RELEASE} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
"${CMAKE_CXX_FLAGS_MINSIZEREL} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
|
||||
|
||||
else()
|
||||
set(WALL 0 CACHE TYPE STRING FORCE)
|
||||
@ -255,8 +258,7 @@ include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${TOP_SRC_DIR}/src
|
||||
${TOP_SRC_DIR}/boost
|
||||
${QT_INCLUDES}
|
||||
)
|
||||
${QT_INCLUDES})
|
||||
|
||||
add_subdirectory(boost)
|
||||
add_subdirectory(intl)
|
||||
|
@ -33,6 +33,8 @@
|
||||
# ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
|
||||
#
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
if(WIN32)
|
||||
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
|
||||
endif()
|
||||
|
@ -2,6 +2,8 @@
|
||||
# from kdelibs
|
||||
#
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
if(WIN32)
|
||||
|
||||
# check if GNUWIN32_DIR is already set
|
||||
|
@ -25,31 +25,29 @@
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
if (ICONV_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
set(ICONV_FIND_QUIETLY TRUE)
|
||||
endif()
|
||||
|
||||
FIND_PATH(ICONV_INCLUDE_DIR iconv.h
|
||||
find_path(ICONV_INCLUDE_DIR iconv.h
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
)
|
||||
/usr/local/include)
|
||||
|
||||
set(POTENTIAL_ICONV_LIBS iconv libiconv libiconv2)
|
||||
|
||||
FIND_LIBRARY(ICONV_LIBRARY NAMES ${POTENTIAL_ICONV_LIBS}
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
find_library(ICONV_LIBRARY NAMES ${POTENTIAL_ICONV_LIBS}
|
||||
PATHS /usr/lib /usr/local/lib)
|
||||
|
||||
if(WIN32)
|
||||
set(ICONV_DLL_NAMES iconv.dll libiconv.dll libiconv2.dll)
|
||||
FIND_FILE(ICONV_DLL
|
||||
find_file(ICONV_DLL
|
||||
NAMES ${ICONV_DLL_NAMES}
|
||||
PATHS ENV PATH
|
||||
NO_DEFAULT_PATH)
|
||||
FIND_FILE(ICONV_DLL_HELP
|
||||
find_file(ICONV_DLL_HELP
|
||||
NAMES ${ICONV_DLL_NAMES}
|
||||
PATHS ENV PATH
|
||||
${ICONV_INCLUDE_DIR}/../bin)
|
||||
@ -58,7 +56,7 @@ if(WIN32)
|
||||
message(FATAL_ERROR "Could not find iconv.dll, please add correct your PATH environment variable")
|
||||
endif()
|
||||
if(NOT ICONV_DLL AND ICONV_DLL_HELP)
|
||||
GET_FILENAME_COMPONENT(ICONV_DLL_HELP ${ICONV_DLL_HELP} PATH)
|
||||
get_filename_component(ICONV_DLL_HELP ${ICONV_DLL_HELP} PATH)
|
||||
message(STATUS)
|
||||
message(STATUS "Could not find iconv.dll in standard search path, please add ")
|
||||
message(STATUS "${ICONV_DLL_HELP}")
|
||||
@ -98,4 +96,4 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
MARK_AS_ADVANCED(ICONV_LIBRARY ICONV_INCLUDE_DIR)
|
||||
mark_as_advanced(ICONV_LIBRARY ICONV_INCLUDE_DIR)
|
||||
|
@ -169,86 +169,95 @@
|
||||
INCLUDE(CheckSymbolExists)
|
||||
INCLUDE(MacroAddFileDependencies)
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
|
||||
|
||||
set( QT_DEFINITIONS "")
|
||||
set(QT_DEFINITIONS "")
|
||||
|
||||
# check for qmake
|
||||
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake-qt4 PATHS
|
||||
find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake-qt4 PATHS
|
||||
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
|
||||
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
|
||||
$ENV{QTDIR}/bin
|
||||
)
|
||||
$ENV{QTDIR}/bin)
|
||||
|
||||
set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
|
||||
|
||||
## macro for asking qmake to process pro files
|
||||
MACRO(QT_QUERY_QMAKE outvar invar)
|
||||
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
|
||||
macro(QT_QUERY_QMAKE outvar invar)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
|
||||
"message(CMAKE_MESSAGE<$$${invar}>)")
|
||||
EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE}
|
||||
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE}
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake
|
||||
OUTPUT_VARIABLE _qmake_query_output
|
||||
ERROR_VARIABLE _qmake_query_output )
|
||||
FILE(REMOVE_RECURSE
|
||||
file(REMOVE_RECURSE
|
||||
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake")
|
||||
STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}")
|
||||
ENDMACRO(QT_QUERY_QMAKE)
|
||||
string(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1"
|
||||
${outvar} "${_qmake_query_output}")
|
||||
endmacro(QT_QUERY_QMAKE)
|
||||
|
||||
|
||||
IF (QT_QMAKE_EXECUTABLE)
|
||||
if(QT_QMAKE_EXECUTABLE)
|
||||
|
||||
set(QT4_QMAKE_FOUND FALSE)
|
||||
|
||||
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
|
||||
exec_program(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION"
|
||||
OUTPUT_VARIABLE QTVERSION)
|
||||
# check for qt3 qmake and then try and find qmake-qt4 in the path
|
||||
IF("${QTVERSION}" MATCHES "Unknown")
|
||||
if("${QTVERSION}" MATCHES "Unknown")
|
||||
set(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
|
||||
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake-qt4 PATHS
|
||||
find_program(QT_QMAKE_EXECUTABLE NAMES qmake-qt4 PATHS
|
||||
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
|
||||
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
|
||||
$ENV{QTDIR}/bin
|
||||
)
|
||||
IF(QT_QMAKE_EXECUTABLE)
|
||||
if(QT_QMAKE_EXECUTABLE)
|
||||
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
|
||||
ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
|
||||
endif()
|
||||
endif()
|
||||
# check that we found the Qt4 qmake, Qt3 qmake output won't match here
|
||||
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
|
||||
IF (qt_version_tmp)
|
||||
string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
|
||||
if(qt_version_tmp)
|
||||
|
||||
# we need at least version 4.0.0
|
||||
IF (NOT QT_MIN_VERSION)
|
||||
if(NOT QT_MIN_VERSION)
|
||||
set(QT_MIN_VERSION "4.0.0")
|
||||
endif()
|
||||
|
||||
#now parse the parts of the user given version string into variables
|
||||
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}")
|
||||
IF (NOT req_qt_major_vers)
|
||||
# now parse the parts of the user given version string into variables
|
||||
string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}")
|
||||
if(NOT req_qt_major_vers)
|
||||
message( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"")
|
||||
endif()
|
||||
|
||||
# now parse the parts of the user given version string into variables
|
||||
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
|
||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1"
|
||||
req_qt_major_vers "${QT_MIN_VERSION}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1"
|
||||
req_qt_minor_vers "${QT_MIN_VERSION}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1"
|
||||
req_qt_patch_vers "${QT_MIN_VERSION}")
|
||||
|
||||
IF (NOT req_qt_major_vers EQUAL 4)
|
||||
if(NOT req_qt_major_vers EQUAL 4)
|
||||
message( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"")
|
||||
endif()
|
||||
|
||||
# and now the version string given by qmake
|
||||
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_qt_major_vers "${QTVERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" found_qt_minor_vers "${QTVERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_qt_patch_vers "${QTVERSION}")
|
||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1"
|
||||
found_qt_major_vers "${QTVERSION}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1"
|
||||
found_qt_minor_vers "${QTVERSION}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1"
|
||||
found_qt_patch_vers "${QTVERSION}")
|
||||
|
||||
# compute an overall version number which can be compared at once
|
||||
MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
|
||||
MATH(EXPR found_vers "${found_qt_major_vers}*10000 + ${found_qt_minor_vers}*100 + ${found_qt_patch_vers}")
|
||||
math(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
|
||||
math(EXPR found_vers "${found_qt_major_vers}*10000 + ${found_qt_minor_vers}*100 + ${found_qt_patch_vers}")
|
||||
|
||||
IF (found_vers LESS req_vers)
|
||||
if(found_vers LESS req_vers)
|
||||
set(QT4_QMAKE_FOUND FALSE)
|
||||
set(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
|
||||
else()
|
||||
@ -258,15 +267,15 @@ IF (QT_QMAKE_EXECUTABLE)
|
||||
|
||||
endif()
|
||||
|
||||
IF (QT4_QMAKE_FOUND)
|
||||
if(QT4_QMAKE_FOUND)
|
||||
|
||||
# ask qmake for the library dir
|
||||
# Set QT_LIBRARY_DIR
|
||||
IF (NOT QT_LIBRARY_DIR)
|
||||
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
||||
if(NOT QT_LIBRARY_DIR)
|
||||
exec_program( ${QT_QMAKE_EXECUTABLE}
|
||||
ARGS "-query QT_INSTALL_LIBS"
|
||||
OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
|
||||
IF(EXISTS "${QT_LIBRARY_DIR_TMP}")
|
||||
OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP)
|
||||
if(EXISTS "${QT_LIBRARY_DIR_TMP}")
|
||||
set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir")
|
||||
else()
|
||||
message("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
|
||||
@ -274,8 +283,8 @@ IF (QT4_QMAKE_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF (APPLE)
|
||||
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
||||
if(APPLE)
|
||||
if(EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
|
||||
set(QT_USE_FRAMEWORKS ON
|
||||
CACHE BOOL "Set to ON if Qt build uses frameworks.")
|
||||
else()
|
||||
@ -283,19 +292,19 @@ IF (QT4_QMAKE_FOUND)
|
||||
CACHE BOOL "Set to ON if Qt build uses frameworks.")
|
||||
endif()
|
||||
|
||||
MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
|
||||
mark_as_advanced(QT_USE_FRAMEWORKS)
|
||||
endif()
|
||||
|
||||
# ask qmake for the binary dir
|
||||
IF (NOT QT_BINARY_DIR)
|
||||
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
|
||||
if(NOT QT_BINARY_DIR)
|
||||
exec_program(${QT_QMAKE_EXECUTABLE}
|
||||
ARGS "-query QT_INSTALL_BINS"
|
||||
OUTPUT_VARIABLE qt_bins )
|
||||
set(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# ask qmake for the include dir
|
||||
IF (NOT QT_HEADERS_DIR)
|
||||
if(NOT QT_HEADERS_DIR)
|
||||
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
||||
ARGS "-query QT_INSTALL_HEADERS"
|
||||
OUTPUT_VARIABLE qt_headers )
|
||||
@ -304,27 +313,29 @@ IF (QT4_QMAKE_FOUND)
|
||||
|
||||
|
||||
# ask qmake for the documentation directory
|
||||
IF (NOT QT_DOC_DIR)
|
||||
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
||||
if(NOT QT_DOC_DIR)
|
||||
exec_program( ${QT_QMAKE_EXECUTABLE}
|
||||
ARGS "-query QT_INSTALL_DOCS"
|
||||
OUTPUT_VARIABLE qt_doc_dir )
|
||||
set(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs")
|
||||
endif()
|
||||
|
||||
# ask qmake for the mkspecs directory
|
||||
IF (NOT QT_MKSPECS_DIR)
|
||||
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
||||
if(NOT QT_MKSPECS_DIR)
|
||||
exec_program( ${QT_QMAKE_EXECUTABLE}
|
||||
ARGS "-query QMAKE_MKSPECS"
|
||||
OUTPUT_VARIABLE qt_mkspecs_dir )
|
||||
set(QT_MKSPECS_DIR ${qt_mkspecs_dir} CACHE PATH "The location of the Qt mkspecs")
|
||||
set(QT_MKSPECS_DIR ${qt_mkspecs_dir} CACHE PATH
|
||||
"The location of the Qt mkspecs")
|
||||
endif()
|
||||
|
||||
# ask qmake for the plugins directory
|
||||
IF (NOT QT_PLUGINS_DIR)
|
||||
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
|
||||
if(NOT QT_PLUGINS_DIR)
|
||||
exec_program( ${QT_QMAKE_EXECUTABLE}
|
||||
ARGS "-query QT_INSTALL_PLUGINS"
|
||||
OUTPUT_VARIABLE qt_plugins_dir )
|
||||
set(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins")
|
||||
set(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH
|
||||
"The location of the Qt plugins")
|
||||
endif()
|
||||
########################################
|
||||
#
|
||||
@ -332,24 +343,23 @@ IF (QT4_QMAKE_FOUND)
|
||||
#
|
||||
########################################
|
||||
|
||||
FIND_PATH(QT_QTCORE_INCLUDE_DIR QtGlobal
|
||||
find_path(QT_QTCORE_INCLUDE_DIR QtGlobal
|
||||
${QT_HEADERS_DIR}/QtCore
|
||||
${QT_LIBRARY_DIR}/QtCore.framework/Headers
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# Set QT_INCLUDE_DIR by removine "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR}
|
||||
IF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
|
||||
IF (QT_USE_FRAMEWORKS)
|
||||
# Set QT_INCLUDE_DIR by removing "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR}
|
||||
if(QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
|
||||
if(QT_USE_FRAMEWORKS)
|
||||
set(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
|
||||
else()
|
||||
STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR})
|
||||
set( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
|
||||
string(REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR})
|
||||
set(QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF( NOT QT_INCLUDE_DIR)
|
||||
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
||||
if(NOT QT_INCLUDE_DIR)
|
||||
if(NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
|
||||
message( FATAL_ERROR "Could NOT find QtGlobal header")
|
||||
endif()
|
||||
endif()
|
||||
@ -364,13 +374,13 @@ IF (QT4_QMAKE_FOUND)
|
||||
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
|
||||
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
|
||||
# Check for Window system symbols (note: only one should end up being set)
|
||||
CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
|
||||
CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
|
||||
CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
|
||||
check_symbol_exists(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
|
||||
check_symbol_exists(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
|
||||
check_symbol_exists(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
|
||||
|
||||
IF (QT_QTCOPY_REQUIRED)
|
||||
CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
|
||||
IF (NOT QT_IS_QTCOPY)
|
||||
if(QT_QTCOPY_REQUIRED)
|
||||
check_symbol_exists(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
|
||||
if(NOT QT_IS_QTCOPY)
|
||||
message(FATAL_ERROR "qt-copy is required, but hasn't been found")
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,38 +1,38 @@
|
||||
#
|
||||
# based on cmake file
|
||||
#
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
if (ZLIB_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
set(ZLIB_FIND_QUIETLY TRUE)
|
||||
endif()
|
||||
|
||||
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
|
||||
find_path(ZLIB_INCLUDE_DIR zlib.h
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
)
|
||||
/usr/local/include)
|
||||
|
||||
set(POTENTIAL_Z_LIBS z zlib zdll)
|
||||
FIND_LIBRARY(ZLIB_LIBRARY NAMES ${POTENTIAL_Z_LIBS}
|
||||
PATHS
|
||||
"C:\\Programme\\Microsoft Visual Studio 8\\VC\\lib"
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
|
||||
find_library(ZLIB_LIBRARY NAMES ${POTENTIAL_Z_LIBS}
|
||||
PATHS "C:\\Programme\\Microsoft Visual Studio 8\\VC\\lib"
|
||||
/usr/lib /usr/local/lib)
|
||||
|
||||
if(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
|
||||
set(ZLIB_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
IF (ZLIB_FOUND)
|
||||
IF (NOT ZLIB_FIND_QUIETLY)
|
||||
if(ZLIB_FOUND)
|
||||
if(NOT ZLIB_FIND_QUIETLY)
|
||||
message(STATUS "Found Z: ${ZLIB_LIBRARY}")
|
||||
endif()
|
||||
else()
|
||||
IF (ZLIB_FIND_REQUIRED)
|
||||
if(ZLIB_FIND_REQUIRED)
|
||||
message(STATUS "Looked for Z libraries named ${POTENTIAL_Z_LIBS}.")
|
||||
message(STATUS "Found no acceptable Z library. This is fatal.")
|
||||
message(FATAL_ERROR "Could NOT find z library")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
|
||||
mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
|
||||
|
@ -25,6 +25,8 @@
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
macro(lyx_add_path _list _prefix)
|
||||
set(_tmp)
|
||||
foreach(_current ${${_list}})
|
||||
@ -35,9 +37,10 @@ macro(lyx_add_path _list _prefix)
|
||||
endmacro(lyx_add_path _out _prefix)
|
||||
|
||||
|
||||
#create the implementation files from the ui files and add them to the list of sources
|
||||
#create the implementation files from the ui files and add them
|
||||
# to the list of sources
|
||||
#usage: LYX_ADD_QT4_UI_FILES(foo_SRCS ${ui_files})
|
||||
macro (LYX_ADD_UI_FILES _sources _ui)
|
||||
macro(LYX_ADD_UI_FILES _sources _ui)
|
||||
foreach (_current_FILE ${ARGN})
|
||||
|
||||
get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
|
||||
@ -59,11 +62,11 @@ macro (LYX_ADD_UI_FILES _sources _ui)
|
||||
)
|
||||
set(${_ui} ${${_ui}} ${_header})
|
||||
endforeach (_current_FILE)
|
||||
endmacro (LYX_ADD_UI_FILES)
|
||||
endmacro(LYX_ADD_UI_FILES)
|
||||
|
||||
|
||||
|
||||
MACRO (LYX_AUTOMOC)
|
||||
macro(LYX_AUTOMOC)
|
||||
if(QT4_GET_MOC_INC_DIRS)
|
||||
QT4_GET_MOC_INC_DIRS(_moc_INCS)
|
||||
endif()
|
||||
@ -102,11 +105,9 @@ MACRO (LYX_AUTOMOC)
|
||||
|
||||
#message(STATUS "moc : ${_header}")
|
||||
|
||||
|
||||
|
||||
#set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
|
||||
#set(_header ${_abs_PATH}/${_basename}.h)
|
||||
set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
|
||||
#set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
|
||||
#set(_header ${_abs_PATH}/${_basename}.h)
|
||||
set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
|
||||
|
||||
#set(_moc ${_abs_PATH}/${_current_MOC})
|
||||
add_custom_command(OUTPUT ${_moc}
|
||||
|
@ -67,14 +67,12 @@ set(_gnuwin32_dir ${GNUWIN32_DIR})
|
||||
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
|
||||
${_gnuwin32_dir}/include
|
||||
${_zlib_path}/include
|
||||
${_iconv_path}/include
|
||||
)
|
||||
${_iconv_path}/include)
|
||||
|
||||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
|
||||
${_gnuwin32_dir}/lib
|
||||
${_zlib_path}/lib
|
||||
${_iconv_path}/lib
|
||||
)
|
||||
${_iconv_path}/lib)
|
||||
|
||||
#chek_include_files path
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${_gnuwin32_dir}/include)
|
||||
@ -87,8 +85,8 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
GET_FILENAME_COMPONENT(lyx_dir_readme ${CMAKE_SOURCE_DIR}/../../README ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(TOP_SRC_DIR ${lyx_dir_readme} PATH)
|
||||
get_filename_component(lyx_dir_readme ${CMAKE_SOURCE_DIR}/../../README ABSOLUTE)
|
||||
get_filename_component(TOP_SRC_DIR ${lyx_dir_readme} PATH)
|
||||
|
||||
if(WIN32)
|
||||
set(locale_dir Resources/locale)
|
||||
@ -102,6 +100,3 @@ set(LOCAL_DIR ${PREFIX}/${locale_dir})
|
||||
#message(" PREFIX : ${PREFIX}")
|
||||
#message(" LOCAL_DIR : ${LOCAL_DIR}")
|
||||
#message(" TOP_SRC_DIR : ${TOP_SRC_DIR}")
|
||||
|
||||
|
||||
|
||||
|
@ -25,18 +25,26 @@
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${KDE_UIC_EXECUTABLE}
|
||||
${KDE_UIC_FILE}
|
||||
OUTPUT_VARIABLE _uic_CONTENTS
|
||||
ERROR_QUIET
|
||||
)
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${KDE_UIC_EXECUTABLE}
|
||||
${KDE_UIC_FILE}
|
||||
OUTPUT_VARIABLE _uic_CONTENTS
|
||||
ERROR_QUIET)
|
||||
|
||||
set(KDE_UIC_CPP_FILE ${KDE_UIC_H_FILE})
|
||||
|
||||
|
||||
if(WIN32)
|
||||
STRING(REGEX REPLACE "\r" "" _uic_CONTENTS "${_uic_CONTENTS}" )
|
||||
string(REGEX REPLACE "\r" "" _uic_CONTENTS "${_uic_CONTENTS}" )
|
||||
endif()
|
||||
|
||||
FILE(WRITE ${KDE_UIC_CPP_FILE} "${_uic_CONTENTS}\n")
|
||||
file(WRITE ${KDE_UIC_CPP_FILE} "${_uic_CONTENTS}\n")
|
||||
|
||||
#message("" "")
|
||||
#message("KDE_UIC_EXECUTABLE:" ${KDE_UIC_EXECUTABLE})
|
||||
#message("KDE_UIC_FILE:" ${KDE_UIC_FILE})
|
||||
#message("KDE_UIC_H_FILE:" ${KDE_UIC_H_FILE})
|
||||
#message("KDE_UIC_CPP_FILE:" ${KDE_UIC_CPP_FILE})
|
||||
#message("_uic_CONTENTS:" ${_uic_CONTENTS})
|
||||
#message("" "")
|
||||
|
@ -26,9 +26,11 @@
|
||||
#
|
||||
|
||||
# folders in the msvc projects
|
||||
# mode==flat : headers and ourses in no folders
|
||||
# mode==flat : headers and sources not in folders
|
||||
# mode==split : standard behavior of cmake, split headers and sources
|
||||
# mode== <other values" : code is in this folder
|
||||
# mode==<other values> : code is in this folder
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
macro(project_source_group mode sources headers)
|
||||
#message(STATUS ${mode})
|
||||
|
@ -58,8 +58,7 @@ target_link_libraries(lyx
|
||||
support
|
||||
intl
|
||||
${QT_QTMAIN_LIBRARY}
|
||||
boost_iostreams
|
||||
)
|
||||
boost_iostreams)
|
||||
|
||||
if(ASPELL_FOUND)
|
||||
target_link_libraries(lyx ${ASPELL_LIBRARY})
|
||||
|
@ -6,15 +6,18 @@
|
||||
|
||||
project(controllers)
|
||||
|
||||
file(GLOB controllers_sources ${TOP_SRC_DIR}/src/frontends/controllers/${LYX_CPP_FILES})
|
||||
file(GLOB controllers_headers ${TOP_SRC_DIR}/src/frontends/controllers/${LYX_HPP_FILES})
|
||||
file(GLOB controllers_sources
|
||||
${TOP_SRC_DIR}/src/frontends/controllers/${LYX_CPP_FILES})
|
||||
file(GLOB controllers_headers
|
||||
${TOP_SRC_DIR}/src/frontends/controllers/${LYX_HPP_FILES})
|
||||
|
||||
lyx_add_msvc_pch(controllers)
|
||||
|
||||
include_directories(${TOP_SRC_DIR}/src/frontends/controllers)
|
||||
|
||||
if(NOT MERGE_FILES)
|
||||
add_library(controllers ${library_type} ${controllers_sources} ${controllers_headers})
|
||||
add_library(controllers ${library_type}
|
||||
${controllers_sources} ${controllers_headers})
|
||||
else()
|
||||
lyx_const_touched_files(_allinone controllers_sources)
|
||||
add_library(controllers ${library_type} ${_allinone_files})
|
||||
|
Loading…
Reference in New Issue
Block a user