CMake 2.8.0-rc5

This commit is contained in:
Brad King 2009-11-03 17:25:20 -05:00
parent b4ae8bad4b
commit 86eac830b3
29 changed files with 325 additions and 95 deletions

View File

@ -316,7 +316,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8) SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 0) SET(CMake_VERSION_PATCH 0)
SET(CMake_VERSION_RC 4) SET(CMake_VERSION_RC 5)
# We use odd minor numbers for development versions. # We use odd minor numbers for development versions.
# Use a date for the development patch level. # Use a date for the development patch level.

View File

@ -1,3 +1,22 @@
Changes in CMake 2.8.0 RC 5
- CTest now detects cycles in test dependency graph
- Warn on set(PARENT_SCOPE) at top scope
- Fix Xcode <= 2.0 projects with CMAKE_BUILD_TYPE
- Fix flags for Intel Fortran on Windows
- Fix #2199: UseSWIG documentation for swig_generated_file_fullname
- Fix #7915: UseSWIG interaction with JNI
- Fix #8971: FindOpenSSL now works on windows
- Fix #9124: CPackDeb documentation
- Fix #9722: cmake-gui reports error when not able to create build directory
- Fix #9767: Match more valgrind-reported leaks in CTest memcheck
- Fix #9777: Sync CMakeDetermineJavaCompiler paths with FindJava
- Fix #9793: FindJNI should find matching jni.h and jni_md.h
- Fix #9817: FindJNI on Solaris
- Fix FindHDF5 when hdf5.h exists without H5pubconf.h
- Fix FindZLIB to follow variable name conventions
- Fix invalid use of auto_ptr on array
- Mention temp var convention in Modules/readme.txt documentation
Changes in CMake 2.8.0 RC 4 Changes in CMake 2.8.0 RC 4
- Fix try_compile when file cannot be found - Fix try_compile when file cannot be found
- Add new module to test manifest installation issues on windows. - Add new module to test manifest installation issues on windows.

View File

@ -51,14 +51,18 @@ IF(NOT CMAKE_Java_COMPILER)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin"
$ENV{JAVA_HOME}/bin
/usr/bin /usr/bin
/usr/lib/java/bin /usr/lib/java/bin
/usr/share/java/bin /usr/share/java/bin
/usr/local/bin /usr/local/bin
/usr/local/java/bin /usr/local/java/bin
/usr/local/java/share/bin
/usr/java/j2sdk1.4.2_04 /usr/java/j2sdk1.4.2_04
/usr/lib/j2sdk1.4-sun/bin /usr/lib/j2sdk1.4-sun/bin
/usr/java/j2sdk1.4.2_09/bin
/usr/lib/j2sdk1.5-sun/bin /usr/lib/j2sdk1.5-sun/bin
/opt/sun-jdk-1.5.0.04/bin
) )
# if no compiler has been specified yet, then look for one # if no compiler has been specified yet, then look for one
IF(CMAKE_Java_COMPILER_INIT) IF(CMAKE_Java_COMPILER_INIT)

View File

@ -1,6 +1,50 @@
# - The builtin (binary) CPack Deb generator (Unix only)
# CPackDeb may be used to create Deb package using CPack.
# CPackDeb is a CPack generator thus it uses the CPACK_XXX variables
# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
#
# However CPackRPM has specific features which are controlled by
# the specifics CPACK_RPM_XXX variables.You'll find a detailed usage on
# the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
# However as a handy reminder here comes the list of specific variables:
#
# CPACK_DEBIAN_PACKAGE_NAME
# Mandatory : YES
# Default : CPACK_PACKAGE_NAME (lower case)
# The debian package summary
# CPACK_DEBIAN_PACKAGE_VERSION
# Mandatory : YES
# Default : CPACK_PACKAGE_VERSION
# The debian package version
# CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# Mandatory : YES
# Default : Output of dpkg --print-architecture or i386
# The debian package architecture
# CPACK_DEBIAN_PACKAGE_DEPENDS
# Mandatory : NO
# Default : -
# May be used to set deb dependencies.
# CPACK_DEBIAN_PACKAGE_MAINTAINER
# Mandatory : YES
# Default : CPACK_PACKAGE_CONTACT
# The debian package maintainer
# CPACK_DEBIAN_PACKAGE_DESCRIPTION
# Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
# The debian package description
# CPACK_DEBIAN_PACKAGE_SECTION
# Mandatory : YES
# Default : 'devel'
# The debian package section
# CPACK_DEBIAN_PACKAGE_PRIORITY
# Mandatory : YES
# Default : 'optional'
# The debian package priority
#============================================================================= #=============================================================================
# Copyright 2007-2009 Kitware, Inc. # Copyright 2007-2009 Kitware, Inc.
# Copyright 2007-2009 Mathieu Malaterre <mathieu.malaterre@gmail.com>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.

View File

@ -291,14 +291,15 @@ else()
# If the HDF5 include directory was found, open H5pubconf.h to determine if # If the HDF5 include directory was found, open H5pubconf.h to determine if
# HDF5 was compiled with parallel IO support # HDF5 was compiled with parallel IO support
set( HDF5_IS_PARALLEL FALSE )
if( HDF5_INCLUDE_DIR ) if( HDF5_INCLUDE_DIR )
file( STRINGS "${HDF5_INCLUDE_DIR}/H5pubconf.h" if( EXISTS "${HDF5_INCLUDE_DIR}/h5pubconf.h" )
HDF5_HAVE_PARALLEL_DEFINE file( STRINGS "${HDF5_INCLUDE_DIR}/H5pubconf.h"
REGEX "HAVE_PARALLEL 1" ) HDF5_HAVE_PARALLEL_DEFINE
if( HDF5_HAVE_PARALLEL_DEFINE ) REGEX "HAVE_PARALLEL 1" )
set( HDF5_IS_PARALLEL TRUE ) if( HDF5_HAVE_PARALLEL_DEFINE )
else() set( HDF5_IS_PARALLEL TRUE )
set( HDF5_IS_PARALLEL FALSE ) endif()
endif() endif()
endif() endif()
set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL

View File

@ -195,14 +195,14 @@ FIND_PATH(JAVA_INCLUDE_PATH jni.h
) )
FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_AWT_INCLUDE_DIRECTORIES} ${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH}/win32 ${JAVA_INCLUDE_PATH}/win32
${JAVA_INCLUDE_PATH}/linux ${JAVA_INCLUDE_PATH}/linux
${JAVA_INCLUDE_PATH}/freebsd ${JAVA_INCLUDE_PATH}/freebsd
${JAVA_INCLUDE_PATH}/solaris
) )
FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h
${JAVA_AWT_INCLUDE_DIRECTORIES}
${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}
) )

View File

@ -8,6 +8,7 @@
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org> # Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2009 Mathieu Malaterre <mathieu.malaterre@gmail.com>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -27,19 +28,32 @@ IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
SET(LIB_FOUND 1) SET(LIB_FOUND 1)
ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE) ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h ) # http://www.slproweb.com/products/Win32OpenSSL.html
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/include"
)
IF(WIN32 AND MSVC) IF(WIN32 AND MSVC)
# /MD and /MDd are the standard values - if somone wants to use # /MD and /MDd are the standard values - if somone wants to use
# others, the libnames have to change here too # others, the libnames have to change here too
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd ssl ssleay32) FIND_LIBRARY(LIB_EAY_DEBUG NAMES libeay32MDd libeay32
FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD ssl ssleay32) PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/VC"
)
FIND_LIBRARY(LIB_EAY_RELEASE NAMES libeay32MD libeay32
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/VC"
)
FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd ssl ssleay32
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/VC"
)
FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD ssl ssleay32
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/VC"
)
IF(MSVC_IDE) IF(MSVC_IDE)
IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE) IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
SET(OPENSSL_LIBRARIES optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG}) SET(OPENSSL_LIBRARIES optimized ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} debug ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG})
ELSE(SSL_EAY_DEBUG AND SSL_EAY_RELEASE) ELSE(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
SET(OPENSSL_LIBRARIES NOTFOUND) SET(OPENSSL_LIBRARIES NOTFOUND)
MESSAGE(STATUS "Could not find the debug and release version of openssl") MESSAGE(STATUS "Could not find the debug and release version of openssl")
@ -47,15 +61,20 @@ IF(WIN32 AND MSVC)
ELSE(MSVC_IDE) ELSE(MSVC_IDE)
STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
SET(OPENSSL_LIBRARIES ${SSL_EAY_DEBUG}) SET(OPENSSL_LIBRARIES ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG})
ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
SET(OPENSSL_LIBRARIES ${SSL_EAY_RELEASE}) SET(OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE})
ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
ENDIF(MSVC_IDE) ENDIF(MSVC_IDE)
MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE) MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE)
MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE)
ELSE(WIN32 AND MSVC) ELSE(WIN32 AND MSVC)
FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD ) FIND_LIBRARY(OPENSSL_SSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD)
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARIES NAMES crypto)
MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARIES OPENSSL_SSL_LIBRARIES)
SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
ENDIF(WIN32 AND MSVC) ENDIF(WIN32 AND MSVC)

View File

@ -1,9 +1,9 @@
# - Find zlib # - Find zlib
# Find the native ZLIB includes and library # Find the native ZLIB includes and library
# #
# ZLIB_INCLUDE_DIR - where to find zlib.h, etc. # ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
# ZLIB_LIBRARIES - List of libraries when using zlib. # ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found. # ZLIB_FOUND - True if zlib found.
#============================================================================= #=============================================================================
# Copyright 2001-2009 Kitware, Inc. # Copyright 2001-2009 Kitware, Inc.
@ -27,16 +27,14 @@ FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
SET(ZLIB_NAMES z zlib zdll) SET(ZLIB_NAMES z zlib zdll)
FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ) FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} )
MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
# Per-recommendation
SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}")
SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}")
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARY ZLIB_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)
IF(ZLIB_FOUND)
SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
ELSE(ZLIB_FOUND)
SET( ZLIB_LIBRARIES )
ENDIF(ZLIB_FOUND)
MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )

View File

@ -53,10 +53,10 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visu
# does the compiler support pdbtype and is it the newer compiler # does the compiler support pdbtype and is it the newer compiler
SET(CMAKE_BUILD_TYPE_INIT Debug) SET(CMAKE_BUILD_TYPE_INIT Debug)
SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp") SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads")
SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full") SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs")
SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG") SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG")
SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/MD /O1 /D NDEBUG") SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O1 /D NDEBUG")
SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG") SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG")
SET (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib") SET (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")

View File

@ -6,7 +6,7 @@
# - Link libraries to swig module # - Link libraries to swig module
# All other macros are for internal use only. # All other macros are for internal use only.
# To get the actual name of the swig module, # To get the actual name of the swig module,
# use: ${SWIG_MODULE_name_REAL_NAME}. # use: ${SWIG_MODULE_${name}_REAL_NAME}.
# Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to specify # Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to specify
# special behavior of SWIG. Also global CMAKE_SWIG_FLAGS can be used to add # special behavior of SWIG. Also global CMAKE_SWIG_FLAGS can be used to add
# special flags to all swig calls. # special flags to all swig calls.
@ -14,9 +14,14 @@
# where to write all the swig generated module (swig -outdir option) # where to write all the swig generated module (swig -outdir option)
# The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used # The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used
# to specify extra dependencies for the generated modules. # to specify extra dependencies for the generated modules.
# If the source file generated by swig need some special flag you can use
# SET_SOURCE_FILES_PROPERTIES( ${swig_generated_file_fullname}
# PROPERTIES COMPILE_FLAGS "-bla")
#============================================================================= #=============================================================================
# Copyright 2004-2009 Kitware, Inc. # Copyright 2004-2009 Kitware, Inc.
# Copyright 2009 Mathieu Malaterre <mathieu.malaterre@gmail.com>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -48,6 +53,9 @@ MACRO(SWIG_MODULE_INITIALIZE name language)
SET(SWIG_MODULE_${name}_REAL_NAME "${name}") SET(SWIG_MODULE_${name}_REAL_NAME "${name}")
IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$") IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
# when swig is used without the -interface it will produce in the module.py
# a 'import _modulename' statement, which implies having a corresponding
# _modulename.so (*NIX), _modulename.pyd (Win32).
SET(SWIG_MODULE_${name}_REAL_NAME "_${name}") SET(SWIG_MODULE_${name}_REAL_NAME "_${name}")
ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$") ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$") IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$")
@ -117,6 +125,8 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
# If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir # If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
IF(CMAKE_SWIG_OUTDIR) IF(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_SWIG_OUTDIR}) SET(swig_outdir ${CMAKE_SWIG_OUTDIR})
# it may not exist, so create it:
file(MAKE_DIRECTORY ${CMAKE_SWIG_OUTDIR})
ELSE(CMAKE_SWIG_OUTDIR) ELSE(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR}) SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(CMAKE_SWIG_OUTDIR) ENDIF(CMAKE_SWIG_OUTDIR)
@ -203,8 +213,33 @@ MACRO(SWIG_ADD_MODULE name language)
MODULE MODULE
${swig_generated_sources} ${swig_generated_sources}
${swig_other_sources}) ${swig_other_sources})
SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} STRING(TOLOWER "${language}" swig_lowercase_language)
PROPERTIES PREFIX "") IF ("${swig_lowercase_language}" STREQUAL "java")
IF (APPLE)
# In java you want:
# System.loadLibrary("LIBRARY");
# then JNI will look for a library whose name is platform dependent, namely
# MacOS : libLIBRARY.jnilib
# Windows: LIBRARY.dll
# Linux : libLIBRARY.so
SET_TARGET_PROPERTIES (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
ENDIF (APPLE)
ENDIF ("${swig_lowercase_language}" STREQUAL "java")
IF ("${swig_lowercase_language}" STREQUAL "python")
# this is only needed for the python case where a _modulename.so is generated
SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
# Python extension modules on Windows must have the extension ".pyd"
# instead of ".dll" as of Python 2.5. Older python versions do support
# this suffix.
# http://docs.python.org/whatsnew/ports.html#SECTION0001510000000000000000
# <quote>
# Windows: .dll is no longer supported as a filename extension for extension modules.
# .pyd is now the only filename extension that will be searched for.
# </quote>
IF(WIN32 AND NOT CYGWIN)
SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
ENDIF(WIN32 AND NOT CYGWIN)
ENDIF ("${swig_lowercase_language}" STREQUAL "python")
ENDMACRO(SWIG_ADD_MODULE) ENDMACRO(SWIG_ADD_MODULE)
# #

View File

@ -88,7 +88,7 @@ If the find module supports versioning it should locate a version of
the package that is compatible with the version requested. If a the package that is compatible with the version requested. If a
compatible version of the package cannot be found the module should compatible version of the package cannot be found the module should
not report success. The version of the package found should be stored not report success. The version of the package found should be stored
in "XXX_VERSION..." version variables docmented by the module. in "XXX_VERSION..." version variables documented by the module.
If the QUIET option is given to the command it will set the variable If the QUIET option is given to the command it will set the variable
XXX_FIND_QUIETLY to true before loading the FindXXX.cmake module. If XXX_FIND_QUIETLY to true before loading the FindXXX.cmake module. If
@ -110,3 +110,6 @@ error if the module is not found.
To get this behaviour you can use the FIND_PACKAGE_HANDLE_STANDARD_ARGS() To get this behaviour you can use the FIND_PACKAGE_HANDLE_STANDARD_ARGS()
macro, as an example see FindJPEG.cmake. macro, as an example see FindJPEG.cmake.
For internal implementation, it's a generally accepted convention that variables starting with
underscore are for temporary use only. (variable starting with an underscore
are not intended as a reserved prefix).

View File

@ -218,7 +218,7 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName,
&mydata &mydata
}; };
// Ok, this libtar is not const safe. Make a non-const copy of outFileName // This libtar is not const safe. Make a non-const copy of outFileName
char* realName = new char[ strlen(outFileName) + 1 ]; char* realName = new char[ strlen(outFileName) + 1 ];
strcpy(realName, outFileName); strcpy(realName, outFileName);
int flags = O_WRONLY | O_CREAT; int flags = O_WRONLY | O_CREAT;
@ -241,6 +241,8 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName,
return 0; return 0;
} }
delete [] realName;
std::vector<std::string>::const_iterator fileIt; std::vector<std::string>::const_iterator fileIt;
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
{ {
@ -256,7 +258,6 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName,
<< pathname << "\"): " << pathname << "\"): "
<< strerror(errno) << std::endl); << strerror(errno) << std::endl);
tar_close(t); tar_close(t);
delete [] realName;
return 0; return 0;
} }
} }
@ -265,7 +266,6 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName,
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_append_eof(): " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_append_eof(): "
<< strerror(errno) << std::endl); << strerror(errno) << std::endl);
tar_close(t); tar_close(t);
delete [] realName;
return 0; return 0;
} }
@ -273,10 +273,8 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName,
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_close(): " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_close(): "
<< strerror(errno) << std::endl); << strerror(errno) << std::endl);
delete [] realName;
return 0; return 0;
} }
delete [] realName;
return 1; return 1;
} }

View File

@ -23,7 +23,6 @@
#include <cmsys/SystemTools.hxx> #include <cmsys/SystemTools.hxx>
#include <cmcompress/cmcompress.h> #include <cmcompress/cmcompress.h>
#include <libtar/libtar.h> #include <libtar/libtar.h>
#include <memory> // auto_ptr
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
@ -165,9 +164,8 @@ int cmCPackTarCompressGenerator::CompressFiles(const char* outFileName,
&mydata &mydata
}; };
// Ok, this libtar is not const safe. for now use auto_ptr hack // This libtar is not const safe. Make a non-const copy of outFileName
char* realName = new char[ strlen(outFileName) + 1 ]; char* realName = new char[ strlen(outFileName) + 1 ];
std::auto_ptr<char> realNamePtr(realName);
strcpy(realName, outFileName); strcpy(realName, outFileName);
int flags = O_WRONLY | O_CREAT; int flags = O_WRONLY | O_CREAT;
int options = 0; int options = 0;
@ -185,9 +183,12 @@ int cmCPackTarCompressGenerator::CompressFiles(const char* outFileName,
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): "
<< strerror(errno) << std::endl); << strerror(errno) << std::endl);
delete [] realName;
return 0; return 0;
} }
delete [] realName;
std::vector<std::string>::const_iterator fileIt; std::vector<std::string>::const_iterator fileIt;
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
{ {

View File

@ -659,8 +659,12 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
"== .*Invalid free\\(\\) / delete / delete\\[\\]"); "== .*Invalid free\\(\\) / delete / delete\\[\\]");
cmsys::RegularExpression vgFMM( cmsys::RegularExpression vgFMM(
"== .*Mismatched free\\(\\) / delete / delete \\[\\]"); "== .*Mismatched free\\(\\) / delete / delete \\[\\]");
cmsys::RegularExpression vgMLK( cmsys::RegularExpression vgMLK1(
"== .*[0-9][0-9]* bytes in [0-9][0-9]* blocks are definitely lost" "== .*[0-9][0-9]* bytes in [0-9][0-9]* blocks are definitely lost"
" in loss record [0-9][0-9]* of [0-9]");
cmsys::RegularExpression vgMLK2(
"== .*[0-9][0-9]* \\([0-9]*,?[0-9]* direct, [0-9]*,?[0-9]* indirect\\)"
" bytes in [0-9][0-9]* blocks are definitely lost"
" in loss record [0-9][0-9]* of [0-9]"); " in loss record [0-9][0-9]* of [0-9]");
cmsys::RegularExpression vgPAR( cmsys::RegularExpression vgPAR(
"== .*Syscall param .* contains unaddressable byte\\(s\\)"); "== .*Syscall param .* contains unaddressable byte\\(s\\)");
@ -705,7 +709,11 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
{ {
failure = cmCTestMemCheckHandler::FMM; failure = cmCTestMemCheckHandler::FMM;
} }
else if ( vgMLK.find(lines[cc]) ) else if ( vgMLK1.find(lines[cc]) )
{
failure = cmCTestMemCheckHandler::MLK;
}
else if ( vgMLK2.find(lines[cc]) )
{ {
failure = cmCTestMemCheckHandler::MLK; failure = cmCTestMemCheckHandler::MLK;
} }

View File

@ -15,6 +15,7 @@
#include "cmCTest.h" #include "cmCTest.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include <stdlib.h> #include <stdlib.h>
#include <stack>
cmCTestMultiProcessHandler::cmCTestMultiProcessHandler() cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
{ {
@ -56,6 +57,10 @@ void cmCTestMultiProcessHandler::SetParallelLevel(size_t level)
void cmCTestMultiProcessHandler::RunTests() void cmCTestMultiProcessHandler::RunTests()
{ {
this->CheckResume(); this->CheckResume();
if(!this->CheckCycles())
{
return;
}
this->TestHandler->SetMaxIndex(this->FindMaxIndex()); this->TestHandler->SetMaxIndex(this->FindMaxIndex());
this->StartNextTests(); this->StartNextTests();
while(this->Tests.size() != 0) while(this->Tests.size() != 0)
@ -340,7 +345,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
this->TestHandler->SetMaxIndex(this->FindMaxIndex()); this->TestHandler->SetMaxIndex(this->FindMaxIndex());
int count = 0; int count = 0;
for (PropertiesMap::iterator it = this->Properties.begin(); for (PropertiesMap::iterator it = this->Properties.begin();
it != this->Properties.end(); it ++ ) it != this->Properties.end(); ++it)
{ {
count++; count++;
cmCTestTestHandler::cmCTestTestProperties& p = *it->second; cmCTestTestHandler::cmCTestTestProperties& p = *it->second;
@ -433,3 +438,47 @@ int cmCTestMultiProcessHandler::FindMaxIndex()
} }
return max; return max;
} }
//Returns true if no cycles exist in the dependency graph
bool cmCTestMultiProcessHandler::CheckCycles()
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Checking test dependency graph..." << std::endl);
for(TestMap::iterator it = this->Tests.begin();
it != this->Tests.end(); ++it)
{
//DFS from each element to itself
std::stack<int> s;
std::vector<int> visited;
s.push(it->first);
visited.push_back(it->first);
while(!s.empty())
{
int test = s.top();
s.pop();
for(TestSet::iterator d = this->Tests[test].begin();
d != this->Tests[test].end(); ++d)
{
s.push(*d);
for(std::vector<int>::iterator v = visited.begin();
v != visited.end(); ++v)
{
if(*v == *d)
{
//cycle exists
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
"the test dependency graph for the test \""
<< this->Properties[*d]->Name << "\"." << std::endl
<< "Please fix the cycle and run ctest again." << std::endl);
return false;
}
}
visited.push_back(*d);
}
visited.pop_back();
}
}
return true;
}

View File

@ -76,6 +76,8 @@ protected:
void RemoveTest(int index); void RemoveTest(int index);
//Check if we need to resume an interrupted test set //Check if we need to resume an interrupted test set
void CheckResume(); void CheckResume();
//Check if there are any circular dependencies
bool CheckCycles();
int FindMaxIndex(); int FindMaxIndex();
inline size_t GetProcessorsUsed(int index); inline size_t GetProcessorsUsed(int index);
// map from test number to set of depend tests // map from test number to set of depend tests

View File

@ -294,7 +294,14 @@ void CMakeSetupDialog::doConfigure()
{ {
return; return;
} }
dir.mkpath("."); if(!dir.mkpath("."))
{
QMessageBox::information(this, tr("Create Directory Failed"),
QString(tr("Failed to create directory %1")).arg(dir.path()),
QMessageBox::Ok);
return;
}
} }
// if no generator, prompt for it and other setup stuff // if no generator, prompt for it and other setup stuff

View File

@ -1281,7 +1281,10 @@ void cmGlobalXCodeGenerator
) )
{ {
std::string makefileName=makefileBasename; std::string makefileName=makefileBasename;
makefileName+=configName; if(this->XcodeVersion > 20)
{
makefileName+=configName;
}
cmGeneratedFileStream makefileStream(makefileName.c_str()); cmGeneratedFileStream makefileStream(makefileName.c_str());
if(!makefileStream) if(!makefileStream)
{ {

View File

@ -3388,14 +3388,20 @@ void cmMakefile::RaiseScope(const char *var, const char *varDef)
// Now update the definition in the parent scope. // Now update the definition in the parent scope.
up->Set(var, varDef); up->Set(var, varDef);
} }
else if(cmMakefile* parent = else if(cmLocalGenerator* plg = this->LocalGenerator->GetParent())
this->LocalGenerator->GetParent()->GetMakefile())
{ {
// Update the definition in the parent directory top scope. This // Update the definition in the parent directory top scope. This
// directory's scope was initialized by the closure of the parent // directory's scope was initialized by the closure of the parent
// scope, so we do not need to localize the definition first. // scope, so we do not need to localize the definition first.
cmMakefile* parent = plg->GetMakefile();
parent->Internal->VarStack.top().Set(var, varDef); parent->Internal->VarStack.top().Set(var, varDef);
} }
else
{
cmOStringStream m;
m << "Cannot set \"" << var << "\": current scope has no parent.";
this->IssueMessage(cmake::AUTHOR_WARNING, m.str());
}
} }

View File

@ -46,7 +46,6 @@
#if defined(CMAKE_BUILD_WITH_CMAKE) #if defined(CMAKE_BUILD_WITH_CMAKE)
# include <libtar/libtar.h> # include <libtar/libtar.h>
# include <memory> // auto_ptr
# include <fcntl.h> # include <fcntl.h>
# include <cm_zlib.h> # include <cm_zlib.h>
# include <cmsys/MD5.h> # include <cmsys/MD5.h>
@ -1807,9 +1806,8 @@ bool cmSystemTools::CreateTar(const char* outFileName,
&gzs &gzs
}; };
// Ok, this libtar is not const safe. for now use auto_ptr hack // This libtar is not const safe. Make a non-const copy of outFileName
char* realName = new char[ strlen(outFileName) + 1 ]; char* realName = new char[ strlen(outFileName) + 1 ];
std::auto_ptr<char> realNamePtr(realName);
strcpy(realName, outFileName); strcpy(realName, outFileName);
int options = 0; int options = 0;
if(verbose) if(verbose)
@ -1825,9 +1823,12 @@ bool cmSystemTools::CreateTar(const char* outFileName,
options) == -1) options) == -1)
{ {
cmSystemTools::Error("Problem with tar_open(): ", strerror(errno)); cmSystemTools::Error("Problem with tar_open(): ", strerror(errno));
delete [] realName;
return false; return false;
} }
delete [] realName;
std::vector<cmStdString>::const_iterator it; std::vector<cmStdString>::const_iterator it;
for (it = files.begin(); it != files.end(); ++ it ) for (it = files.begin(); it != files.end(); ++ it )
{ {
@ -1859,6 +1860,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
cmSystemTools::Error("Problem with tar_close(): ", strerror(errno)); cmSystemTools::Error("Problem with tar_close(): ", strerror(errno));
return false; return false;
} }
return true; return true;
#else #else
(void)outFileName; (void)outFileName;
@ -1886,9 +1888,8 @@ bool cmSystemTools::ExtractTar(const char* outFileName,
&gzs &gzs
}; };
// Ok, this libtar is not const safe. for now use auto_ptr hack // This libtar is not const safe. Make a non-const copy of outFileName
char* realName = new char[ strlen(outFileName) + 1 ]; char* realName = new char[ strlen(outFileName) + 1 ];
std::auto_ptr<char> realNamePtr(realName);
strcpy(realName, outFileName); strcpy(realName, outFileName);
if (tar_open(&t, realName, if (tar_open(&t, realName,
(gzip? &gztype : NULL), (gzip? &gztype : NULL),
@ -1901,9 +1902,12 @@ bool cmSystemTools::ExtractTar(const char* outFileName,
| 0) == -1) | 0) == -1)
{ {
cmSystemTools::Error("Problem with tar_open(): ", strerror(errno)); cmSystemTools::Error("Problem with tar_open(): ", strerror(errno));
delete [] realName;
return false; return false;
} }
delete [] realName;
if (tar_extract_all(t, 0) != 0) if (tar_extract_all(t, 0) != 0)
{ {
cmSystemTools::Error("Problem with tar_extract_all(): ", strerror(errno)); cmSystemTools::Error("Problem with tar_extract_all(): ", strerror(errno));
@ -1940,9 +1944,8 @@ bool cmSystemTools::ListTar(const char* outFileName,
&gzs &gzs
}; };
// Ok, this libtar is not const safe. for now use auto_ptr hack // This libtar is not const safe. Make a non-const copy of outFileName
char* realName = new char[ strlen(outFileName) + 1 ]; char* realName = new char[ strlen(outFileName) + 1 ];
std::auto_ptr<char> realNamePtr(realName);
strcpy(realName, outFileName); strcpy(realName, outFileName);
if (tar_open(&t, realName, if (tar_open(&t, realName,
(gzip? &gztype : NULL), (gzip? &gztype : NULL),
@ -1955,9 +1958,12 @@ bool cmSystemTools::ListTar(const char* outFileName,
| 0) == -1) | 0) == -1)
{ {
cmSystemTools::Error("Problem with tar_open(): ", strerror(errno)); cmSystemTools::Error("Problem with tar_open(): ", strerror(errno));
delete [] realName;
return false; return false;
} }
delete [] realName;
while ((th_read(t)) == 0) while ((th_read(t)) == 0)
{ {
const char* filename = th_get_pathname(t); const char* filename = th_get_pathname(t);

View File

@ -881,30 +881,25 @@ void cmTarget::DefineProperties(cmake *cm)
"an archive target. " \ "an archive target. " \
"All Windows-based systems including Cygwin are DLL platforms." "All Windows-based systems including Cygwin are DLL platforms."
#define CM_TARGET_OUTDIR_DOC(TYPE, type) \
"This property specifies the directory into which " #type " target " \
"files should be built. " \
CM_TARGET_FILE_TYPES_DOC " " \
"This property is initialized by the value of the variable " \
"CMAKE_" #TYPE "_OUTPUT_DIRECTORY if it is set when a target is created."
cm->DefineProperty cm->DefineProperty
("ARCHIVE_OUTPUT_DIRECTORY", cmProperty::TARGET, ("ARCHIVE_OUTPUT_DIRECTORY", cmProperty::TARGET,
"Output directory in which to build ARCHIVE target files.", "Output directory in which to build ARCHIVE target files.",
"This property specifies the directory into which archive target files " CM_TARGET_OUTDIR_DOC(ARCHIVE, archive));
"should be built. "
CM_TARGET_FILE_TYPES_DOC " "
"This property is initialized by the value of the variable "
"CMAKE_ARCHIVE_OUTPUT_DIRECTORY if it is set when a target is created.");
cm->DefineProperty cm->DefineProperty
("LIBRARY_OUTPUT_DIRECTORY", cmProperty::TARGET, ("LIBRARY_OUTPUT_DIRECTORY", cmProperty::TARGET,
"Output directory in which to build LIBRARY target files.", "Output directory in which to build LIBRARY target files.",
"This property specifies the directory into which library target files " CM_TARGET_OUTDIR_DOC(LIBRARY, library));
"should be built. "
CM_TARGET_FILE_TYPES_DOC " "
"This property is initialized by the value of the variable "
"CMAKE_LIBRARY_OUTPUT_DIRECTORY if it is set when a target is created.");
cm->DefineProperty cm->DefineProperty
("RUNTIME_OUTPUT_DIRECTORY", cmProperty::TARGET, ("RUNTIME_OUTPUT_DIRECTORY", cmProperty::TARGET,
"Output directory in which to build RUNTIME target files.", "Output directory in which to build RUNTIME target files.",
"This property specifies the directory into which runtime target files " CM_TARGET_OUTDIR_DOC(RUNTIME, runtime));
"should be built. "
CM_TARGET_FILE_TYPES_DOC " "
"This property is initialized by the value of the variable "
"CMAKE_RUNTIME_OUTPUT_DIRECTORY if it is set when a target is created.");
cm->DefineProperty cm->DefineProperty
("ARCHIVE_OUTPUT_NAME", cmProperty::TARGET, ("ARCHIVE_OUTPUT_NAME", cmProperty::TARGET,

View File

@ -242,7 +242,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
") ")
ADD_TEST(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh) ADD_TEST(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh)
IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
SET_TESTS_PROPERTIES (${name} PROPERTIES TIMEOUT 3500) SET_TESTS_PROPERTIES (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
ENDMACRO(ADD_NIGHTLY_BUILD_TEST) ENDMACRO(ADD_NIGHTLY_BUILD_TEST)
IF(CMAKE_BUILD_NIGHTLY_RELEASES) IF(CMAKE_BUILD_NIGHTLY_RELEASES)
@ -1209,17 +1209,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
PASS_REGULAR_EXPRESSION "\\*\\*\\*Timeout") PASS_REGULAR_EXPRESSION "\\*\\*\\*Timeout")
CONFIGURE_FILE( CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake" "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake"
@ONLY ESCAPE_QUOTES) @ONLY ESCAPE_QUOTES)
CONFIGURE_FILE( CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/hello.cmake" "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/hello.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestRunScript/hello.cmake" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/hello.cmake"
@ONLY ESCAPE_QUOTES) @ONLY ESCAPE_QUOTES)
#ADD_TEST(CTestTestRunScript ${CMAKE_CTEST_COMMAND} ADD_TEST(CTestTestRunScript ${CMAKE_CTEST_COMMAND}
# -S "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" -V -S "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" -V
# --output-log "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/testOutput.log" --output-log "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/testOutput.log"
# ) )
ADD_TEST(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N) ADD_TEST(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N)
@ -1242,8 +1242,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
set(regex "(Problems when submitting via S*CP") set(regex "(Problems when submitting via S*CP")
set(regex "${regex}|Error message was: ") set(regex "${regex}|Error message was: ")
set(regex "${regex}(Couldn.t resolve host ") set(regex "${regex}([Cc]ould *n.t resolve host")
set(regex "${regex}|couldn.t connect to host") set(regex "${regex}|[Cc]ould *n.t connect to host")
set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)") set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)")
set(regex "${regex}|Submission method .xmlrpc. not compiled into CTest") set(regex "${regex}|Submission method .xmlrpc. not compiled into CTest")
set(regex "${regex}|Submission successful)") set(regex "${regex}|Submission successful)")

View File

@ -16,8 +16,16 @@ target_link_libraries(mylibapp mylib)
# On Linux, enable using an absolute install path to verify that # On Linux, enable using an absolute install path to verify that
# CMAKE_INSTALL_PREFIX and CPACK_SET_DESTDIR interact properly. # CMAKE_INSTALL_PREFIX and CPACK_SET_DESTDIR interact properly.
#
# But only use absolute paths if not targeting an NSIS installer
# as indicated by CPACK_BINARY_NSIS. (If we allow this, the test
# fails on Linux machines with makensis installed when we are not
# cross-compiling...)
#
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
set(mylib_install_to_absolute_path ON) if(NOT CPACK_BINARY_NSIS)
set(mylib_install_to_absolute_path ON)
endif()
endif() endif()
if(mylib_install_to_absolute_path) if(mylib_install_to_absolute_path)

View File

@ -1,6 +0,0 @@
GET_FILENAME_COMPONENT(CTEST_COMMAND "${CMAKE_COMMAND}" PATH)
SET(CTEST_COMMAND "${CTEST_COMMAND}/ctest")
SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestRunScript")
SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestRunScript")
message("hello world")

View File

@ -0,0 +1,2 @@
SET(CTEST_RUN_CURRENT_SCRIPT 0)
MESSAGE("hello world")

View File

@ -1,7 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
GET_FILENAME_COMPONENT(CTEST_COMMAND "${CMAKE_COMMAND}" PATH)
SET(CTEST_COMMAND "${CTEST_COMMAND}/ctest")
SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestRunScript")
SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestRunScript")
CTEST_RUN_SCRIPT("${CTEST_BINARY_DIRECTORY}/hello.cmake")

View File

@ -0,0 +1,2 @@
SET(CTEST_RUN_CURRENT_SCRIPT 0)
CTEST_RUN_SCRIPT("CTestTestRunScript/hello.cmake" RETURN_VALUE res RETURN_VALUE)

View File

@ -142,6 +142,17 @@ IF(NOT "${TRY_OUT}" MATCHES "hello world")
MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"") MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"")
ENDIF(NOT "${TRY_OUT}" MATCHES "hello world") ENDIF(NOT "${TRY_OUT}" MATCHES "hello world")
TRY_RUN(ARG_TEST_RUN ARG_TEST_COMPILE
${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
${TryCompile_SOURCE_DIR}/expect_arg.c
OUTPUT_VARIABLE TRY_OUT
ARGS arg1 arg2)
IF(NOT ARG_TEST_COMPILE)
MESSAGE(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}")
ENDIF(NOT ARG_TEST_COMPILE)
IF(NOT "${ARG_TEST_RUN}" STREQUAL "0")
MESSAGE(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}")
ENDIF(NOT "${ARG_TEST_RUN}" STREQUAL "0")
# try to run a file that should compile and run, but return an error # try to run a file that should compile and run, but return an error
TRY_RUN(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE TRY_RUN(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE

View File

@ -0,0 +1,22 @@
#include <stdio.h>
#include <string.h>
int main(int ac, char*av[])
{
int i;
printf("ac = [%d]\n", ac);
for(i =0; i < ac; i++)
{
printf("arg[%d] = %s\n", i, av[i]);
}
if(ac == 3)
{
if(strcmp(av[1], "arg1") ==0
&& strcmp(av[2], "arg2") ==0)
{
printf("arg1 and arg2 present and accounted for!\n");
return 0;
}
}
printf("arg1 and arg2 missing!\n");
return -1;
}