Commit 3497345c authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: 2.6.2 rc 2 merge from main tree

parent 1243389c
......@@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 6)
SET(CMake_VERSION_PATCH 2)
SET(CMake_VERSION_RC 1)
SET(CMake_VERSION_RC 2)
# CVS versions are odd, if this is an odd minor version
# then set the CMake_VERSION_DATE variable
IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
......
Changes in CMake 2.6.2 RC 2
- allow tool chains to limit object path length
- add info.plist to frameworks
- better preservation of user link lines
- add a get command for cmake policies
- support for imported libraries of unknown type
- support link interface in target_link_libraries
- Do not hang when select lies
- .m compiled with gcc and g++ on mac
- Fix issue when application bundle dir is removed cmake
needs to re-run automatically
- Report an error when configure has one error
- Fix bug where -E commands stole command line options
- Fix infinite recursion bug with try-compile and change of compilers
- Fix delete and backspace in ccmake
- Fix coverage not to follow symlinks
- Add more possible languages for NSIS in cpack
- FindQt4.cmake fix bug #7433, add documentation that
directories also can be specified to update the translation files.
- Add standard arg handling to FindPHP4.cmake
- Add X11R6 to search path for FindOpenGL
- update cmake-syntax.vim to have more keywords
- BUG: fix #7477, set VERBOSE=1 in the kdevelop setting for
the environment, not together with the make executable
- UsePkgConfig.cmake - clean up, add a status message in case
pkgconfig didn't find the package, sync with kde
- FindX11 look in more places
- FindTIFF look for more names
- FindQt3, make sure qt4 is not found and some style stuff
- FindPNG add more names of linpng (sync with the KDE version)
- FindKDE3/KDE4 sanity checks on qt versions found
- FindLibXMl2 also search for xmllint, which comes with libxml2
(sync with FindLibXml2.cmake from KDE)
- Fix sizeof, and other compiler INFO string checks with
GNU linker's --gc-sections
- Fix bogus dependency on executable targets when a linked library
happended to match the name of an executable target
- Improve readability of circular depends error
- Fix crash on circular target dependencies
- find_package now knows about lib64 paths
- Fix gentoo elf security issue with RPATH and RUNPATH
Changes in CMake 2.6.2 RC 1
- Fix abort in eclipse generator with empty EXECUTABLE_OUTPUT_PATH
- Fix FindKDE3.cmake syntax error
- Fix custom command output by relative path not always working
- Fix bug, Do not convert RPATH entries to full path.
- Allow for "$ORIGIN" into the RPATH
- Allow for "$ORIGIN" into the RPATH>
- Allow for static libraries with lots of objects using archive append
- Fix documentation for FindImageMagick.cmake
- Fix link error with MS compiler and comdef
......
......@@ -41,7 +41,7 @@ syn region cmakeString start=/"/ end=/"/
syn region cmakeArguments start=/(/ end=/)/
\ contains=ALLBUT,cmakeArguments,cmakeTodo
syn keyword cmakeSystemVariables
\ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80
\ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 MSVC90
syn keyword cmakeOperators
\ ABSOLUTE AND BOOL CACHE COMMAND DEFINED DOC EQUAL EXISTS EXT FALSE GREATER INTERNAL LESS MATCHES NAME NAMES NAME_WE NOT OFF ON OR PATH PATHS PROGRAM STREQUAL STRGREATER STRING STRLESS TRUE
\ contained
......@@ -50,7 +50,7 @@ syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_
" The keywords are generated as: cmake --help-command-list | tr "\n" " "
syn keyword cmakeStatement
\ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE
\ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN UNSET USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE
\ nextgroup=cmakeArguments
syn keyword cmakeTodo
\ TODO FIXME XXX
......
......@@ -12,17 +12,17 @@
/*--------------------------------------------------------------------------*/
/* Make sure the information strings are referenced. */
#define REQUIRE(x) (&x[0] != &require)
int main()
#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
const char require = 0;
return
(
REQUIRE(info_sizeof_dptr)
int require = 0;
require += info_sizeof_dptr[argc];
#if defined(ABI_ID)
&& REQUIRE(info_abi)
require += info_abi[argc];
#endif
);
(void)argv;
return require;
}
......@@ -2,15 +2,9 @@
# error "A C++ compiler has been selected for C."
#endif
/* Provide main() so the program can link. */
#if defined(__18CXX)
# define ID_VOID_MAIN
#endif
#ifdef ID_VOID_MAIN
void main() {}
#else
int main() { return 0; }
#endif
#if defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
......@@ -82,3 +76,18 @@ int main() { return 0; }
char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
/*--------------------------------------------------------------------------*/
#ifdef ID_VOID_MAIN
void main() {}
#else
int main(int argc, char* argv[])
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
(void)argv;
return require;
}
#endif
......@@ -8,17 +8,13 @@
/*--------------------------------------------------------------------------*/
/* Make sure the information strings are referenced. */
#define REQUIRE(x) (&x[0] != &require)
int main()
int main(int argc, char* argv[])
{
const char require = 0;
return
(
REQUIRE(info_sizeof_dptr)
int require = 0;
require += info_sizeof_dptr[argc];
#if defined(ABI_ID)
&& REQUIRE(info_abi)
require += info_abi[argc];
#endif
);
(void)argv;
return require;
}
......@@ -5,9 +5,6 @@
# error "A C compiler has been selected for C++."
#endif
/* Provide main() so the program can link. */
int main() { return 0; }
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
......@@ -70,3 +67,14 @@ int main() { return 0; }
char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
/*--------------------------------------------------------------------------*/
int main(int argc, char* argv[])
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
(void)argv;
return require;
}
......@@ -29,15 +29,16 @@ const char info_sizeof[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','o','f','[
('0' + (SIZE % 10)),
']','\0'};
#ifdef __CLASSIC_C__
int main(){
int ac;
char*av[];
int main(argc, argv) int argc; char *argv[];
#else
int main(int ac, char*av[]){
int main(int argc, char *argv[])
#endif
return (&info_sizeof[0] != &info_sizeof[0]);
{
int require = 0;
require += info_sizeof[argc];
(void)argv;
return require;
}
#else /* CHECK_TYPE_SIZE_TYPE */
......
......@@ -67,6 +67,18 @@ IF(NOT UNIX AND KDE3_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
ENDIF(NOT UNIX AND KDE3_FIND_REQUIRED)
# If Qt4 has already been found, fail.
IF(QT4_FOUND)
IF(KDE3_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project.")
ELSE(KDE3_FIND_REQUIRED)
IF(NOT KDE3_FIND_QUIETLY)
MESSAGE( STATUS "KDE3/Qt3 and Qt4 cannot be used together in one project.")
ENDIF(NOT KDE3_FIND_QUIETLY)
RETURN()
ENDIF(KDE3_FIND_REQUIRED)
ENDIF(QT4_FOUND)
SET(QT_MT_REQUIRED TRUE)
#SET(QT_MIN_VERSION "3.0.0")
......
......@@ -9,6 +9,18 @@
#
# Author: Alexander Neundorf <neundorf@kde.org>
# If Qt3 has already been found, fail.
IF(QT_QT_LIBRARY)
IF(KDE4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "KDE4/Qt4 and Qt3 cannot be used together in one project.")
ELSE(KDE4_FIND_REQUIRED)
IF(NOT KDE4_FIND_QUIETLY)
MESSAGE( STATUS "KDE4/Qt4 and Qt3 cannot be used together in one project.")
ENDIF(NOT KDE_FIND_QUIETLY)
RETURN()
ENDIF(KDE4_FIND_REQUIRED)
ENDIF(QT_QT_LIBRARY)
FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
# when cross compiling, searching kde4-config in order to run it later on
......
# - Try to find LibXml2
# Once done this will define
#
# LIBXML2_FOUND - system has LibXml2
# LIBXML2_INCLUDE_DIR - the LibXml2 include directory
# LIBXML2_LIBRARIES - the libraries needed to use LibXml2
# LIBXML2_FOUND - System has LibXml2
# LIBXML2_INCLUDE_DIR - The LibXml2 include directory
# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
#
......@@ -36,11 +37,15 @@ FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
${_LibXml2LinkDir}
)
FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
# for backwards compat. with KDE 4.0.x:
SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
# Locate Lua library
# This module defines
# LUA50_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES, both lua and lualib
# LUA_FOUND, if false, do not try to link to Lua
# LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
#
# Note that the expected include convention is
......
# Locate Lua library
# This module defines
# LUA51_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_FOUND, if false, do not try to link to Lua
# LUA_INCLUDE_DIR, where to find lua.h
#
# Note that the expected include convention is
......
......@@ -57,20 +57,20 @@ ELSE (WIN32)
FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h
/usr/share/doc/NVIDIA_GLX-1.0/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/include /usr/X11R6/include
)
FIND_PATH(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
/usr/share/doc/NVIDIA_GLX-1.0/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/include /usr/X11R6/include
)
FIND_LIBRARY(OPENGL_gl_LIBRARY
NAMES GL MesaGL
PATHS /opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib
/usr/shlib /usr/X11R6/lib
)
# On Unix OpenGL most certainly always requires X11.
......@@ -94,7 +94,7 @@ ELSE (WIN32)
PATHS ${OPENGL_gl_LIBRARY}
/opt/graphics/OpenGL/lib
/usr/openwin/lib
/usr/shlib
/usr/shlib /usr/X11R6/lib
)
ENDIF(APPLE)
......
......@@ -68,3 +68,5 @@ IF(APPLE)
ENDFOREACH(symbol)
ENDIF(APPLE)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PHP4 DEFAULT_MSG PHP4_EXECUTABLE PHP4_INCLUDE_PATH)
......@@ -16,7 +16,7 @@ IF(ZLIB_FOUND)
/usr/local/include/libpng # OpenBSD
)
SET(PNG_NAMES ${PNG_NAMES} png libpng)
SET(PNG_NAMES ${PNG_NAMES} png libpng png12 libpng12)
FIND_LIBRARY(PNG_LIBRARY NAMES ${PNG_NAMES} )
IF (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
......
......@@ -20,6 +20,19 @@
# QT_WRAP_CPP, set true if QT_MOC_EXECUTABLE is found
# QT_WRAP_UI set true if QT_UIC_EXECUTABLE is found
# If Qt4 has already been found, fail.
IF(QT4_FOUND)
IF(Qt3_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
ELSE(Qt3_FIND_REQUIRED)
IF(NOT Qt3_FIND_QUIETLY)
MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project.")
ENDIF(NOT Qt3_FIND_QUIETLY)
RETURN()
ENDIF(Qt3_FIND_REQUIRED)
ENDIF(QT4_FOUND)
FILE(GLOB GLOB_PATHS_BIN /usr/lib/qt-3*/bin/)
FIND_PATH(QT_INCLUDE_DIR qt.h
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
......@@ -34,13 +47,12 @@ FIND_PATH(QT_INCLUDE_DIR qt.h
/usr/share/qt3/include
C:/Progra~1/qt/include
/usr/include/qt3
/usr/X11R6/include
)
# if qglobal.h is not in the qt_include_dir then set
# QT_INCLUDE_DIR to NOTFOUND
IF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
SET(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to qt3 include directory" FORCE)
SET(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to Qt3 include directory" FORCE)
ENDIF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
IF(QT_INCLUDE_DIR)
......@@ -52,7 +64,6 @@ IF(QT_INCLUDE_DIR)
# Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the
# version X.Y.Z, so we need to remove the dots from version
STRING(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}")
ELSE(QT_INCLUDE_DIR)
ENDIF(QT_INCLUDE_DIR)
FILE(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/)
......@@ -73,7 +84,6 @@ IF (QT_MT_REQUIRED)
/usr/lib/qt3/lib64
/usr/share/qt3/lib
C:/Progra~1/qt/lib
/usr/X11R6/lib
)
ELSE (QT_MT_REQUIRED)
......@@ -94,14 +104,9 @@ ELSE (QT_MT_REQUIRED)
/usr/lib/qt3/lib64
/usr/share/qt3/lib
C:/Progra~1/qt/lib
/usr/X11R6/lib
)
ENDIF (QT_MT_REQUIRED)
IF(QT_QT_LIBRARY)
ELSE(QT_QT_LIBRARY)
ENDIF(QT_QT_LIBRARY)
FIND_LIBRARY(QT_QASSISTANTCLIENT_LIBRARY
NAMES qassistantclient
......@@ -116,7 +121,6 @@ FIND_LIBRARY(QT_QASSISTANTCLIENT_LIBRARY
/usr/lib/qt3/lib64
/usr/share/qt3/lib
C:/Progra~1/qt/lib
/usr/X11R6/lib
)
# qt 3 should prefer QTDIR over the PATH
......@@ -140,7 +144,6 @@ FIND_PROGRAM(QT_MOC_EXECUTABLE
IF(QT_MOC_EXECUTABLE)
SET ( QT_WRAP_CPP "YES")
ELSE(QT_MOC_EXECUTABLE)
ENDIF(QT_MOC_EXECUTABLE)
# qt 3 should prefer QTDIR over the PATH
......@@ -162,7 +165,6 @@ FIND_PROGRAM(QT_UIC_EXECUTABLE uic
IF(QT_UIC_EXECUTABLE)
SET ( QT_WRAP_UI "YES")
ELSE(QT_UIC_EXECUTABLE)
ENDIF(QT_UIC_EXECUTABLE)
IF (WIN32)
......@@ -194,28 +196,28 @@ IF (QT_MIN_VERSION)
STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
# req = "6.5.4", qt = "3.2.1"
macro(error_message msg)
MACRO(error_message msg)
IF(QT3_REQUIRED)
MESSAGE( FATAL_ERROR ${msg})
ELSE(QT3_REQUIRED)
MESSAGE( STATUS ${msg})
ENDIF(QT3_REQUIRED)
endmacro(error_message)
ENDMACRO(error_message)
IF (req_qt_major_vers GREATER qt_major_vers) # (6 > 3) ?
error_message( "Qt major version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ERROR_MESSAGE( "Qt major version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ELSE (req_qt_major_vers GREATER qt_major_vers) # no
IF (req_qt_major_vers LESS qt_major_vers) # (6 < 3) ?
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
ELSE (req_qt_major_vers LESS qt_major_vers) # ( 6==3) ?
IF (req_qt_minor_vers GREATER qt_minor_vers) # (5>2) ?
error_message( "Qt minor version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ERROR_MESSAGE( "Qt minor version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ELSE (req_qt_minor_vers GREATER qt_minor_vers) # no
IF (req_qt_minor_vers LESS qt_minor_vers) # (5<2) ?
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
ELSE (req_qt_minor_vers LESS qt_minor_vers) # (5==2)
IF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
error_message( "Qt patch level not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ERROR_MESSAGE( "Qt patch level not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes
ELSE (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes
ENDIF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ?
......@@ -226,11 +228,9 @@ IF (QT_MIN_VERSION)
ENDIF (QT_MIN_VERSION)
# if the include a library are found then we have it
IF(QT_INCLUDE_DIR)
IF(QT_QT_LIBRARY)
SET( QT_FOUND "YES" )
ENDIF(QT_QT_LIBRARY)
ENDIF(QT_INCLUDE_DIR)
IF(QT_INCLUDE_DIR AND QT_QT_LIBRARY)
SET( QT_FOUND "YES" )
ENDIF(QT_INCLUDE_DIR AND QT_QT_LIBRARY)
IF(QT_FOUND)
SET( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
......@@ -293,18 +293,14 @@ IF("${QTVERSION_MOC}" MATCHES ".* 3..*")
ENDIF("${QTVERSION_MOC}" MATCHES ".* 3..*")
SET(QT_WRAP_CPP FALSE)
IF (QT_MOC_EXECUTABLE)
IF(_QT_MOC_VERSION_3)
SET ( QT_WRAP_CPP TRUE)
ENDIF(_QT_MOC_VERSION_3)
ENDIF (QT_MOC_EXECUTABLE)
IF (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
SET ( QT_WRAP_CPP TRUE)
ENDIF (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
SET(QT_WRAP_UI FALSE)
IF (QT_UIC_EXECUTABLE)
IF(_QT_UIC_VERSION_3)
SET ( QT_WRAP_UI TRUE)
ENDIF(_QT_UIC_VERSION_3)
ENDIF (QT_UIC_EXECUTABLE)
IF (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
SET ( QT_WRAP_UI TRUE)
ENDIF (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
MARK_AS_ADVANCED(
QT_INCLUDE_DIR
......
......@@ -48,8 +48,9 @@
#
# macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
# create moc code from a list of files containing Qt class with
# the Q_OBJECT declaration. Options may be given to moc, such as those found
# when executing "moc -help"
# the Q_OBJECT declaration. Per-direcotry preprocessor definitions
# are also added. Options may be given to moc, such as those found
# when executing "moc -help".
#
# macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
# create code from a list of Qt designer ui files.
......@@ -102,11 +103,11 @@
# interface file is constructed from the basename of the header with
# the suffix .xml appended.
#
# macro QT4_CREATE_TRANSLATION( qm_files sources ... ts_files ... )
# macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ... ts_files ... )
# out: qm_files
# in: sources ts_files
# in: directories sources ts_files
# generates commands to create .ts (vie lupdate) and .qm
# (via lrelease) - files from sources. The ts files are
# (via lrelease) - files from directories and/or sources. The ts files are
# created and/or updated in the source tree (unless given with full paths).
# The qm files are generated in the build tree.
# Updating the translations can be done by adding the qm_files
......@@ -256,6 +257,19 @@
# (They make no sense in Qt4)
# QT_QT_LIBRARY Qt-Library is now split
# If Qt3 has already been found, fail.
IF(QT_QT_LIBRARY)
IF(Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
ELSE(Qt4_FIND_REQUIRED)
IF(NOT Qt4_FIND_QUIETLY)
MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project.")
ENDIF(NOT Qt4_FIND_QUIETLY)
RETURN()
ENDIF(Qt4_FIND_REQUIRED)
ENDIF(QT_QT_LIBRARY)
INCLUDE(CheckSymbolExists)
INCLUDE(MacroAddFileDependencies)
......@@ -474,9 +488,9 @@ IF (QT4_QMAKE_FOUND)
ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
IF( NOT QT_INCLUDE_DIR)
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
IF(Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could NOT find QtGlobal header")
ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
ENDIF(Qt4_FIND_REQUIRED)
ENDIF( NOT QT_INCLUDE_DIR)
#############################################
......@@ -512,10 +526,6 @@ IF (QT4_QMAKE_FOUND)
#
#############################################
IF (QT_USE_FRAMEWORKS)
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -F${QT_LIBRARY_DIR} -L${QT_LIBRARY_DIR} )
ENDIF (QT_USE_FRAMEWORKS)
# Set QT_QT3SUPPORT_INCLUDE_DIR
FIND_PATH(QT_QT3SUPPORT_INCLUDE_DIR Qt3Support
PATHS
......@@ -771,9 +781,9 @@ IF (QT4_QMAKE_FOUND)
ENDIF(EXISTS ${QT_LIBRARY_DIR}/libqtmain.a)
ENDIF(QT_LIBRARY_DIR AND MSVC)
IF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
IF(Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
ENDIF( NOT Qt4_FIND_QUIETLY AND Qt4_FIND_REQUIRED)
ENDIF(Qt4_FIND_REQUIRED)
ENDIF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
# Set QT_QTASSISTANT_LIBRARY
......@@ -1028,18 +1038,27 @@ IF (QT4_QMAKE_FOUND)
SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
ENDMACRO (QT4_MAKE_OUTPUT_FILE )
MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS)
SET(${_moc_INC_DIRS})
MACRO (QT4_GET_MOC_FLAGS _moc_flags)
SET(${_moc_flags})
GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
FOREACH(_current ${_inc_DIRS})
SET(${_moc_INC_DIRS} ${${_moc_INC_DIRS}} "-I" ${_current})
SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
ENDFOREACH(_current ${_inc_DIRS})
GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
FOREACH(_current ${_defines})
SET(${_moc_flags} ${${_moc_flags}} "-D${_current}")
ENDFOREACH(_current ${_defines})
IF(Q_WS_WIN)
SET(${_moc_flags} ${${_moc_flags}} -DWIN32)
ENDIF(Q_WS_WIN)
ENDMACRO(QT4_GET_MOC_INC_DIRS)
ENDMACRO(QT4_GET_MOC_FLAGS)
# helper macro to set up a moc rule
MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_includes moc_options)
MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
# For Windows, create a parameters file to work around command line length limit
IF (WIN32)
# Pass the parameters in a file. Set the working directory to
......@@ -1053,7 +1072,7 @@ IF (QT4_QMAKE_FOUND)
SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
ENDIF(_moc_outfile_dir)
SET (_moc_parameters_file ${outfile}_parameters)
SET (_moc_parameters ${moc_includes} ${moc_options} -o "${outfile}" "${infile}")
SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
FILE (REMOVE ${_moc_parameters_file})