diff options
33 files changed, 507 insertions, 230 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f29f1ac9e..b1eceaa630 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 3) +SET(CMake_VERSION_RC 4) # CVS versions are odd, if this is an odd minor version # then set the CMake_VERSION_DATE variable IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$") diff --git a/ChangeLog.manual b/ChangeLog.manual index 166b0d2043..4aac4ef5b4 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,18 @@ +Changes in CMake 2.6.2 RC 4 +- Fix bug #7359 make llvm-gcc work, by explicitely excluding + "llvm-" from _CMAKE_TOOLCHAIN_PREFIX +- Fix bug 7046: OS X Framework support: extensionless headers were + being ignored when specified as public headers +- Fix documentation in CheckCCompilerFlag.cmake +- Add better version support to find_package command +- Fix Xcode debug not working +- Add VERSION compare to if command +- Make FindThreads sete THREADS_FOUND +- Deb cpack generator sets Installed-Size for the package +- Do not add an empty /D"" at the end of VS 6 .dsp compile lines +- Recognize /MAP in VS 7 and greater +- Add new policy CMP0009 - GLOB_RECURSE should not follow symlinks by default + Changes in CMake 2.6.2 RC 3 - Fix bug, and remove extra closing > in visual fortran projects. - Fix bug in ctest -C where it was sometimes ignored. diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index ae68f1886e..82e9448943 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -88,20 +88,6 @@ IF (NOT _CMAKE_TOOLCHAIN_LOCATION) GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH) ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION) -# If we have a gcc cross compiler, they have usually some prefix, like -# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc . -# The other tools of the toolchain usually have the same prefix -# NAME_WE cannot be used since then this test will fail for names lile -# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be -# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" -IF (NOT _CMAKE_TOOLCHAIN_PREFIX) - GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) - IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$") - STRING(REGEX REPLACE "^(.+-)g?cc(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}") - ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$") -ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) - - # Build a small source file to identify the compiler. IF(${CMAKE_GENERATOR} MATCHES "Visual Studio") SET(CMAKE_C_COMPILER_ID_RUN 1) @@ -141,6 +127,33 @@ IF(NOT CMAKE_C_COMPILER_ID_RUN) ENDIF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW") ENDIF(NOT CMAKE_C_COMPILER_ID_RUN) +# If we have a gcc cross compiler, they have usually some prefix, like +# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc . +# The other tools of the toolchain usually have the same prefix +# NAME_WE cannot be used since then this test will fail for names lile +# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be +# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" +IF (CMAKE_CROSSCOMPILING + AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" + AND NOT _CMAKE_TOOLCHAIN_PREFIX) + GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) + IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$") + SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$") + + # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils + # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) + IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + +ENDIF (CMAKE_CROSSCOMPILING + AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" + AND NOT _CMAKE_TOOLCHAIN_PREFIX) + + + + INCLUDE(CMakeFindBinUtils) # configure variables set in this file for fast reload later on diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 1cd401fc53..87abffa942 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -88,19 +88,6 @@ IF (NOT _CMAKE_TOOLCHAIN_LOCATION) GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH) ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION) -# if we have a g++ cross compiler, they have usually some prefix, like -# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ -# the other tools of the toolchain usually have the same prefix -# NAME_WE cannot be used since then this test will fail for names lile -# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be -# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" -IF (NOT _CMAKE_TOOLCHAIN_PREFIX) - GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) - IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$") - STRING(REGEX REPLACE "^(.+-)[gc]\\+\\+(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}") - ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$") -ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) - # This block was used before the compiler was identified by building a # source file. Unless g++ crashes when building a small C++ # executable this should no longer be needed. @@ -151,6 +138,30 @@ IF(NOT CMAKE_CXX_COMPILER_ID_RUN) ENDIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW") ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN) +# if we have a g++ cross compiler, they have usually some prefix, like +# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ +# the other tools of the toolchain usually have the same prefix +# NAME_WE cannot be used since then this test will fail for names lile +# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be +# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" +IF (CMAKE_CROSSCOMPILING + AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" + AND NOT _CMAKE_TOOLCHAIN_PREFIX) + GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) + IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$") + SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$") + + # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils + # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) + IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + +ENDIF (CMAKE_CROSSCOMPILING + AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" + AND NOT _CMAKE_TOOLCHAIN_PREFIX) + INCLUDE(CMakeFindBinUtils) # configure all variables set in this file diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake index b084399af4..07fca64c35 100644 --- a/Modules/CheckCCompilerFlag.cmake +++ b/Modules/CheckCCompilerFlag.cmake @@ -3,6 +3,10 @@ # # FLAG - the compiler flag # VARIABLE - variable to store the result +# +# This actually calls the check_c_source_compiles macro. +# See help for CheckCSourceCompiles for a listing of variables +# that can modify the build. # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org> # diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 98031e2d0e..6facb51556 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -8,6 +8,7 @@ INCLUDE (CheckIncludeFiles) INCLUDE (CheckLibraryExists) +SET(Threads_FOUND FALSE) # Do we have sproc? IF(CMAKE_SYSTEM MATCHES IRIX) @@ -30,11 +31,13 @@ ELSE(CMAKE_HAVE_SPROC_H) IF(CMAKE_HAVE_PTHREADS_CREATE) SET(CMAKE_THREAD_LIBS_INIT "-lpthreads") SET(CMAKE_HAVE_THREADS_LIBRARY 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_HAVE_PTHREADS_CREATE) # Ok, how about -lpthread CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE) IF(CMAKE_HAVE_PTHREAD_CREATE) SET(CMAKE_THREAD_LIBS_INIT "-lpthread") + SET(Threads_FOUND TRUE) SET(CMAKE_HAVE_THREADS_LIBRARY 1) ENDIF(CMAKE_HAVE_PTHREAD_CREATE) IF(CMAKE_SYSTEM MATCHES "SunOS.*") @@ -43,6 +46,7 @@ ELSE(CMAKE_HAVE_SPROC_H) IF(CMAKE_HAVE_THR_CREATE) SET(CMAKE_THREAD_LIBS_INIT "-lthread") SET(CMAKE_HAVE_THREADS_LIBRARY 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_HAVE_THR_CREATE) ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*") ENDIF(NOT THREADS_HAVE_PTHREAD_ARG) @@ -58,6 +62,7 @@ ELSE(CMAKE_HAVE_SPROC_H) COMPILE_OUTPUT_VARIABLE OUTPUT) IF(THREADS_HAVE_PTHREAD_ARG) IF(THREADS_PTHREAD_ARG MATCHES "^2$") + SET(Threads_FOUND TRUE) MESSAGE(STATUS "Check if compiler accepts -pthread - yes") ELSE(THREADS_PTHREAD_ARG MATCHES "^2$") MESSAGE(STATUS "Check if compiler accepts -pthread - no") @@ -73,6 +78,7 @@ ELSE(CMAKE_HAVE_SPROC_H) ENDIF(THREADS_HAVE_PTHREAD_ARG) ENDIF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG") IF(THREADS_HAVE_PTHREAD_ARG) + SET(Threads_FOUND TRUE) SET(CMAKE_THREAD_LIBS_INIT "-pthread") ENDIF(THREADS_HAVE_PTHREAD_ARG) ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY) @@ -81,10 +87,12 @@ ENDIF(CMAKE_HAVE_SPROC_H) IF(CMAKE_THREAD_LIBS_INIT) SET(CMAKE_USE_PTHREADS_INIT 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_THREAD_LIBS_INIT) IF(CMAKE_SYSTEM MATCHES "Windows") SET(CMAKE_USE_WIN32_THREADS_INIT 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_SYSTEM MATCHES "Windows") IF(CMAKE_USE_PTHREADS_INIT) @@ -101,6 +109,7 @@ IF(CMAKE_USE_PTHREADS_INIT) IF(CMAKE_HAVE_HP_CMA) SET(CMAKE_THREAD_LIBS_INIT "-lcma") SET(CMAKE_HP_PTHREADS_INIT 1) + SET(Threads_FOUND TRUE) ENDIF(CMAKE_HAVE_HP_CMA) SET(CMAKE_USE_PTHREADS_INIT 1) ENDIF(CMAKE_SYSTEM MATCHES "HP-UX-*") @@ -112,8 +121,11 @@ IF(CMAKE_USE_PTHREADS_INIT) IF(CMAKE_SYSTEM MATCHES "CYGWIN_NT*") SET(CMAKE_USE_PTHREADS_INIT 1) + SET(Threads_FOUND TRUE) SET(CMAKE_THREAD_LIBS_INIT ) SET(CMAKE_USE_WIN32_THREADS_INIT 0) ENDIF(CMAKE_SYSTEM MATCHES "CYGWIN_NT*") ENDIF(CMAKE_USE_PTHREADS_INIT) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND) diff --git a/Modules/readme.txt b/Modules/readme.txt index 8d4615a2c5..8e4474eadc 100644 --- a/Modules/readme.txt +++ b/Modules/readme.txt @@ -67,20 +67,25 @@ line. A FindXXX.cmake module will typically be loaded by the command - FIND_PACKAGE(XXX [major[.minor[.patch]]] [EXACT] + FIND_PACKAGE(XXX [major[.minor[.patch[.tweak]]]] [EXACT] [QUIET] [REQUIRED [components...]]) If any version numbers are given to the command it will set the -variable XXX_FIND_VERSION to contain the whole version. The variables -XXX_FIND_VERSION_MAJOR, XXX_FIND_VERSION_MINOR, and -XXX_FIND_VERSION_PATCH will be set to contain the corresponding -portions of the version number. The variable XXX_FIND_VERSION_EXACT -will indicate whether an exact version is requested. +following variables before loading the module: + + XXX_FIND_VERSION = full requested version string + XXX_FIND_VERSION_MAJOR = major version if requested, else 0 + XXX_FIND_VERSION_MINOR = minor version if requested, else 0 + XXX_FIND_VERSION_PATCH = patch version if requested, else 0 + XXX_FIND_VERSION_TWEAK = tweak version if requested, else 0 + XXX_FIND_VERSION_COUNT = number of version components, 0 to 4 + XXX_FIND_VERSION_EXACT = true if EXACT option was given + If the find module supports versioning it should locate a version of the package that is compatible with the version requested. If a compatible version of the package cannot be found the module should not report success. The version of the package found should be stored -in the version variables named above. +in "XXX_VERSION..." version variables docmented by the module. 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 diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 6c0b46a5e9..d2c691d8aa 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -116,6 +116,17 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, { out << "Suggests: " << debian_pkg_sug << "\n"; } + unsigned long totalSize = 0; + { + std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); + dirName += '/'; + for (std::vector<std::string>::const_iterator fileIt = files.begin(); + fileIt != files.end(); ++ fileIt ) + { + totalSize += cmSystemTools::FileLength(fileIt->c_str()); + } + } + out << "Installed-Size: " << totalSize << "\n"; out << "Maintainer: " << maintainer << "\n"; out << "Description: " << desc << "\n"; out << std::endl; diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index bbd8396978..032d603a86 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -668,18 +668,39 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, i++; cmsys::Glob g; g.SetRecurse(recurse); + + bool explicitFollowSymlinks = false; + cmPolicies::PolicyStatus status = + this->Makefile->GetPolicyStatus(cmPolicies::CMP0009); + if(recurse) + { + switch(status) + { + case cmPolicies::NEW: + g.RecurseThroughSymlinksOff(); + break; + case cmPolicies::OLD: + case cmPolicies::WARN: + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + g.RecurseThroughSymlinksOn(); + break; + } + } + std::string output = ""; bool first = true; for ( ; i != args.end(); ++i ) { - if ( *i == "RECURSE_SYMLINKS_OFF" ) + if ( recurse && (*i == "FOLLOW_SYMLINKS") ) { - g.RecurseThroughSymlinksOff(); + explicitFollowSymlinks = true; + g.RecurseThroughSymlinksOn(); ++i; if ( i == args.end() ) { this->SetError( - "GLOB requires a glob expression after RECURSE_SYMLINKS_OFF"); + "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS"); return false; } } @@ -732,6 +753,37 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, first = false; } } + + if(recurse && !explicitFollowSymlinks) + { + switch (status) + { + case cmPolicies::NEW: + // Correct behavior, yay! + break; + case cmPolicies::OLD: + // Probably not really the expected behavior, but the author explicitly + // asked for the old behavior... no warning. + case cmPolicies::WARN: + // Possibly unexpected old behavior *and* we actually traversed + // symlinks without being explicitly asked to: warn the author. + if(g.GetFollowedSymlinkCount() != 0) + { + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, + this->Makefile->GetPolicies()-> + GetPolicyWarning(cmPolicies::CMP0009)); + } + break; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + this->SetError("policy CMP0009 error"); + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + this->Makefile->GetPolicies()-> + GetRequiredPolicyError(cmPolicies::CMP0009)); + return false; + } + } + this->Makefile->AddDefinition(variable.c_str(), output.c_str()); return true; } diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 9343a63acf..1b0c2ff72f 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -77,7 +77,7 @@ public: " [NO_HEX_CONVERSION])\n" " file(GLOB variable [RELATIVE path] [globbing expressions]...)\n" " file(GLOB_RECURSE variable [RELATIVE path] \n" - " [RECURSE_SYMLINKS_OFF] [globbing expressions]...)\n" + " [FOLLOW_SYMLINKS] [globbing expressions]...)\n" " file(REMOVE [file1 ...])\n" " file(REMOVE_RECURSE [file1 ...])\n" " file(MAKE_DIRECTORY [directory1 directory2 ...])\n" @@ -124,11 +124,11 @@ public: " *.cxx - match all files with extension cxx\n" " *.vt? - match all files with extension vta,...,vtz\n" " f[3-5].txt - match files f3.txt, f4.txt, f5.txt\n" - "GLOB_RECURSE will generate similar list as the regular GLOB, except " + "GLOB_RECURSE will generate a list similar to the regular GLOB, except " "it will traverse all the subdirectories of the matched directory and " - "match the files. Subdirectories that are symlinks are traversed by " - "default to match the behavior of older CMake releases. Use " - "RECURSE_SYMLINKS_OFF to prevent recursion through symlinks.\n" + "match the files. Subdirectories that are symlinks are only traversed " + "if FOLLOW_SYMLINKS is given or cmake policy CMP0009 is not set to NEW. " + "See cmake --help-policy CMP0009 for more information.\n" "Examples of recursive globbing include:\n" " /dir/*.py - match all python files in /dir and subdirectories\n" "MAKE_DIRECTORY will create the given directories, also if their parent " diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index f130ba2275..1594fcf57e 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -67,14 +67,16 @@ cmFindPackageCommand::cmFindPackageCommand() this->VersionMajor = 0; this->VersionMinor = 0; this->VersionPatch = 0; + this->VersionTweak = 0; this->VersionCount = 0; this->VersionExact = false; this->VersionFoundMajor = 0; this->VersionFoundMinor = 0; this->VersionFoundPatch = 0; + this->VersionFoundTweak = 0; this->VersionFoundCount = 0; this->CommandDocumentation = - " find_package(<package> [major[.minor[.patch]]] [EXACT] [QUIET]\n" + " find_package(<package> [version] [EXACT] [QUIET]\n" " [[REQUIRED|COMPONENTS] [components...]])\n" "Finds and loads settings from an external project. " "<package>_FOUND will be set to indicate whether the package was found. " @@ -86,8 +88,8 @@ cmFindPackageCommand::cmFindPackageCommand() "A package-specific list of components may be listed after the " "REQUIRED option or after the COMPONENTS option if no REQUIRED " "option is given. " - "The \"[major[.minor[.patch]]]\" version argument specifies a desired " - "version with which the package found should be compatible. " + "The [version] argument requests a version with which the package found " + "should be compatible (format is major[.minor[.patch[.tweak]]]). " "The EXACT option requests that the version be matched exactly. " "Version support is currently provided only on a package-by-package " "basis (details below).\n" @@ -109,7 +111,7 @@ cmFindPackageCommand::cmFindPackageCommand() "check the module documentation. " "If no module is found the command proceeds to Config mode.\n" "The complete Config mode command signature is:\n" - " find_package(<package> [major[.minor[.patch]]] [EXACT] [QUIET]\n" + " find_package(<package> [version] [EXACT] [QUIET]\n" " [[REQUIRED|COMPONENTS] [components...]] [NO_MODULE]\n" " [NAMES name1 [name2 ...]]\n" " [CONFIGS config1 [config2 ...]]\n" @@ -153,9 +155,9 @@ cmFindPackageCommand::cmFindPackageCommand() "a configuration file a fatal error is always generated because user " "intervention is required." "\n" - "When the \"[major[.minor[.patch]]]\" version argument is specified " - "Config mode will only find a version of the package that claims " - "compatibility with the requested version. " + "When the [version] argument is given Config mode will only find a " + "version of the package that claims compatibility with the requested " + "version (format is major[.minor[.patch[.tweak]]]). " "If the EXACT option is given only a version of the package claiming " "an exact match of the requested version may be found. " "CMake does not establish any convention for the meaning of version " @@ -173,22 +175,26 @@ cmFindPackageCommand::cmFindPackageCommand() "variables have been defined:\n" " PACKAGE_FIND_NAME = the <package> name\n" " PACKAGE_FIND_VERSION = full requested version string\n" - " PACKAGE_FIND_VERSION_MAJOR = requested major version, if any\n" - " PACKAGE_FIND_VERSION_MINOR = requested minor version, if any\n" - " PACKAGE_FIND_VERSION_PATCH = requested patch version, if any\n" + " PACKAGE_FIND_VERSION_MAJOR = major version if requested, else 0\n" + " PACKAGE_FIND_VERSION_MINOR = minor version if requested, else 0\n" + " PACKAGE_FIND_VERSION_PATCH = patch version if requested, else 0\n" + " PACKAGE_FIND_VERSION_TWEAK = tweak version if requested, else 0\n" + " PACKAGE_FIND_VERSION_COUNT = number of version components, 0 to 4\n" "The version file checks whether it satisfies the requested version " "and sets these variables:\n" - " PACKAGE_VERSION = package version (major[.minor[.patch]])\n" + " PACKAGE_VERSION = full provided version string\n" " PACKAGE_VERSION_EXACT = true if version is exact match\n" " PACKAGE_VERSION_COMPATIBLE = true if version is compatible\n" "These variables are checked by the find_package command to determine " "whether the configuration file provides an acceptable version. " "They are not available after the find_package call returns. " "If the version is acceptable the following variables are set:\n" - " <package>_VERSION = package version (major[.minor[.patch]])\n" - " <package>_VERSION_MAJOR = major from major[.minor[.patch]], if any\n" - " <package>_VERSION_MINOR = minor from major[.minor[.patch]], if any\n" - " <package>_VERSION_PATCH = patch from major[.minor[.patch]], if any\n" + " <package>_VERSION = full provided version string\n" + " <package>_VERSION_MAJOR = major version if provided, else 0\n" + " <package>_VERSION_MINOR = minor version if provided, else 0\n" + " <package>_VERSION_PATCH = patch version if provided, else 0\n" + " <package>_VERSION_TWEAK = tweak version if provided, else 0\n" + " <package>_VERSION_COUNT = number of version components, 0 to 4\n" "and the corresponding package configuration file is loaded. " "When multiple package configuration files are available whose version " "files claim compatibility with the version requested it is unspecified " @@ -411,7 +417,7 @@ bool cmFindPackageCommand { // Set a variable telling the find script this component // is required. - std::string req_var = Name + "_FIND_REQUIRED_" + args[i]; + std::string req_var = this->Name + "_FIND_REQUIRED_" + args[i]; this->Makefile->AddDefinition(req_var.c_str(), "1"); // Append to the list of required components. @@ -469,10 +475,13 @@ bool cmFindPackageCommand unsigned int parsed_major; unsigned int parsed_minor; unsigned int parsed_patch; - this->VersionCount = sscanf(this->Version.c_str(), "%u.%u.%u", - &parsed_major, &parsed_minor, &parsed_patch); + unsigned int parsed_tweak; + this->VersionCount = sscanf(this->Version.c_str(), "%u.%u.%u.%u", + &parsed_major, &parsed_minor, + &parsed_patch, &parsed_tweak); switch(this->VersionCount) { + case 4: this->VersionTweak = parsed_tweak; // no break! case 3: this->VersionPatch = parsed_patch; // no break! case 2: this->VersionMinor = parsed_minor; // no break! case 1: this->VersionMajor = parsed_major; // no break! @@ -480,9 +489,7 @@ bool cmFindPackageCommand } } - // Store the list of components. - std::string components_var = Name + "_FIND_COMPONENTS"; - this->Makefile->AddDefinition(components_var.c_str(), components.c_str()); + this->SetModuleVariables(components); // See if there is a Find<package>.cmake module. if(!this->NoModule) @@ -533,6 +540,60 @@ bool cmFindPackageCommand return result; } + +//---------------------------------------------------------------------------- +void cmFindPackageCommand::SetModuleVariables(const std::string& components) +{ + // Store the list of components. + std::string components_var = this->Name + "_FIND_COMPONENTS"; + this->Makefile->AddDefinition(components_var.c_str(), components.c_str()); + + if(this->Quiet) + { + // Tell the module that is about to be read that it should find + // quietly. + std::string quietly = this->Name; + quietly += "_FIND_QUIETLY"; + this->Makefile->AddDefinition(quietly.c_str(), "1"); + } + + if(this->Required) + { + // Tell the module that is about to be read that it should report + // a fatal error if the package is not found. + std::string req = this->Name; + req += "_FIND_REQUIRED"; + this->Makefile->AddDefinition(req.c_str(), "1"); + } + + if(!this->Version.empty()) + { + // Tell the module that is about to be read what version of the + // package has been requested. + std::string ver = this->Name; + ver += "_FIND_VERSION"; + this->Makefile->AddDefinition(ver.c_str(), this->Version.c_str()); + char buf[64]; + sprintf(buf, "%u", this->VersionMajor); + this->Makefile->AddDefinition((ver+"_MAJOR").c_str(), buf); + sprintf(buf, "%u", this->VersionMinor); + this->Makefile->AddDefinition((ver+"_MINOR").c_str(), buf); + sprintf(buf, "%u", this->VersionPatch); + this->Makefile->AddDefinition((ver+"_PATCH").c_str(), buf); + sprintf(buf, "%u", this->VersionTweak); + this->Makefile->AddDefinition((ver+"_TWEAK").c_str(), buf); + sprintf(buf, "%u", this->VersionCount); + this->Makefile->AddDefinition((ver+"_COUNT").c_str(), buf); + + // Tell the module whether an exact version has been requested. + std::string exact = this->Name; + exact += "_FIND_VERSION_EXACT"; + this->Makefile->AddDefinition(exact.c_str(), + this->VersionExact? "1":"0"); + } +} + + //---------------------------------------------------------------------------- bool cmFindPackageCommand::FindModule(bool& found) { @@ -542,59 +603,6 @@ bool cmFindPackageCommand::FindModule(bool& found) std::string mfile = this->Makefile->GetModulesFile(module.c_str()); if ( mfile.size() ) { - if(this->Quiet) - { - // Tell the module that is about to be read that it should find - // quietly. - std::string quietly = this->Name; - quietly += "_FIND_QUIETLY"; - this->Makefile->AddDefinition(quietly.c_str(), "1"); - } - - if(this->Required) - { - // Tell the module that is about to be read that it should report - // a fatal error if the package is not found. - std::string req = this->Name; - req += "_FIND_REQUIRED"; - this->Makefile->AddDefinition(req.c_str(), "1"); - } - - if(!this->Version.empty()) - { - // Tell the module that is about to be read what version of the - // package has been requested. - std::string ver = this->Name; - ver += "_FIND_VERSION"; - this->Makefile->AddDefinition(ver.c_str(), this->Version.c_str()); - char buf[64]; - switch(this->VersionCount) - { - case 3: - { - sprintf(buf, "%u", this->VersionPatch); - this->Makefile->AddDefinition((ver+"_PATCH").c_str(), buf); - } // no break - case 2: - { - sprintf(buf, "%u", this->VersionMinor); - this->Makefile->AddDefinition((ver+"_MINOR").c_str(), buf); - } // no break - case 1: - { - sprintf(buf, "%u", this->VersionMajor); - this->Makefile->AddDefinition((ver+"_MAJOR").c_str(), buf); - } // no break - default: break; - } - - // Tell the module whether an exact version has been requested. - std::string exact = this->Name; - exact += "_FIND_VERSION_EXACT"; - this->Makefile->AddDefinition(exact.c_str(), - this->VersionExact? "1":"0"); - } - // Load the module we found. found = true; return this->ReadListFile(mfile.c_str()); @@ -691,7 +699,7 @@ bool cmFindPackageCommand::HandlePackageMode() { // The variable is not set. cmOStringStream e; - e << "could not find "; + e << "Could not find "; if(!this->NoModule) { e << "module Find" << this->Name << ".cmake or "; @@ -721,15 +729,8 @@ bool cmFindPackageCommand::HandlePackageMode() e << " " << *ci << "\n"; } } - if(this->Required) - { - this->SetError(e.str().c_str()); - result = false; - } - else - { - cmSystemTools::Error("find_package ", e.str().c_str()); - } + this->Makefile->IssueMessage( + this->Required? cmake::FATAL_ERROR : cmake::WARNING, e.str()); } // Set a variable marking whether the package was found. @@ -1233,36 +1234,17 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file) this->Makefile->AddDefinition("PACKAGE_FIND_NAME", this->Name.c_str()); this->Makefile->AddDefinition("PACKAGE_FIND_VERSION", this->Version.c_str()); - if(this->VersionCount >= 3) - { - char buf[64]; - sprintf(buf, "%u", this->VersionPatch); - this->Makefile->AddDefinition("PACKAGE_FIND_VERSION_PATCH", buf); - } - else - { - this->Makefile->RemoveDefinition("PACKAGE_FIND_VERSION_PATCH"); - } - if(this->VersionCount >= 2) - { - char buf[64]; - sprintf(buf, "%u", this->VersionMinor); - this->Makefile->AddDefinition("PACKAGE_FIND_VERSION_MINOR", buf); - } - else - { - this->Makefile->RemoveDefinition("PACKAGE_FIND_VERSION_MINOR"); - } - if(this->VersionCount >= 1) - { - char buf[64]; - sprintf(buf, "%u", this->VersionMajor); - this->Makefile->AddDefinition("PACKAGE_FIND_VERSION_MAJOR", buf); - } - else - { - this->Makefile->RemoveDefinition("PACKAGE_FIND_VERSION_MAJOR"); - } + char buf[64]; + sprintf(buf, "%u", this->VersionMajor); + this->Makefile->AddDefinition("PACKAGE_FIND_VERSION_MAJOR", buf); + sprintf(buf, "%u", this->VersionMinor); + this->Makefile->AddDefinition("PACKAGE_FIND_VERSION_MINOR", buf); + sprintf(buf, "%u", this->VersionPatch); + this->Makefile->AddDefinition("PACKAGE_FIND_VERSION_PATCH", buf); + sprintf(buf, "%u", this->VersionTweak); + this->Makefile->AddDefinition("PACKAGE_FIND_VERSION_TWEAK", buf); + sprintf(buf, "%u", this->VersionCount); + this->Makefile->AddDefinition("PACKAGE_FIND_VERSION_COUNT", buf); // Load the version check file. bool found = false; @@ -1285,11 +1267,14 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file) unsigned int parsed_major; unsigned int parsed_minor; unsigned int parsed_patch; + unsigned int parsed_tweak; this->VersionFoundCount = - sscanf(this->VersionFound.c_str(), "%u.%u.%u", - &parsed_major, &parsed_minor, &parsed_patch); + sscanf(this->VersionFound.c_str(), "%u.%u.%u.%u", + &parsed_major, &parsed_minor, + &parsed_patch, &parsed_tweak); switch(this->VersionFoundCount) { + case 4: this->VersionFoundTweak = parsed_tweak; // no break! case 3: this->VersionFoundPatch = parsed_patch; // no break! case 2: this->VersionFoundMinor = parsed_minor; // no break! case 1: this->VersionFoundMajor = parsed_major; // no break! @@ -1320,27 +1305,18 @@ void cmFindPackageCommand::StoreVersionFound() this->Makefile->AddDefinition(ver.c_str(), this->VersionFound.c_str()); } - // Store the portions that could be parsed. + // Store the version components. char buf[64]; - switch(this->VersionFoundCount) - { - case 3: - { - sprintf(buf, "%u", this->VersionFoundPatch); - this->Makefile->AddDefinition((ver+"_PATCH").c_str(), buf); - } // no break - case 2: - { - sprintf(buf, "%u", this->VersionFoundMinor); - this->Makefile->AddDefinition((ver+"_MINOR").c_str(), buf); - } // no break - case 1: - { - sprintf(buf, "%u", this->VersionFoundMajor); - this->Makefile->AddDefinition((ver+"_MAJOR").c_str(), buf); - } // no break - default: break; - } + sprintf(buf, "%u", this->VersionFoundMajor); + this->Makefile->AddDefinition((ver+"_MAJOR").c_str(), buf); + sprintf(buf, "%u", this->VersionFoundMinor); + this->Makefile->AddDefinition((ver+"_MINOR").c_str(), buf); + sprintf(buf, "%u", this->VersionFoundPatch); + this->Makefile->AddDefinition((ver+"_PATCH").c_str(), buf); + sprintf(buf, "%u", this->VersionFoundTweak); + this->Makefile->AddDefinition((ver+"_TWEAK").c_str(), buf); + sprintf(buf, "%u", this->VersionFoundCount); + this->Makefile->AddDefinition((ver+"_COUNT").c_str(), buf); } //---------------------------------------------------------------------------- diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index d5fe703dd0..cf7b93cd00 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -73,6 +73,7 @@ public: private: void AppendSuccessInformation(); void AppendToProperty(const char* propertyName); + void SetModuleVariables(const std::string& components); bool FindModule(bool& found); bool HandlePackageMode(); void FindConfig(); @@ -110,6 +111,7 @@ private: unsigned int VersionMajor; unsigned int VersionMinor; unsigned int VersionPatch; + unsigned int VersionTweak; unsigned int VersionCount; bool VersionExact; cmStdString FileFound; @@ -117,6 +119,7 @@ private: unsigned int VersionFoundMajor; unsigned int VersionFoundMinor; unsigned int VersionFoundPatch; + unsigned int VersionFoundTweak; unsigned int VersionFoundCount; bool Quiet; bool Required; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f9d4445577..b045ffda24 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -526,11 +526,13 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, buildFile->AddAttribute("settings", settings); fileRef->AddAttribute("fileEncoding", this->CreateString("4")); + const char* lang = this->CurrentLocalGenerator->GetSourceFileLanguage(*sf); std::string sourcecode = "sourcecode"; std::string ext = sf->GetExtension(); ext = cmSystemTools::LowerCase(ext); + if(ext == "o") { sourcecode = "compiled.mach-o.objfile"; @@ -541,41 +543,50 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, } else if(ext == "m") { - sourcecode += ".cpp.objc"; + sourcecode += ".c.objc"; } else if(ext == "plist") { sourcecode += ".text.plist"; } - else if(!lang) + else if(ext == "h" || ext == "hxx" || ext == "hpp") { - sourcecode += ext; - sourcecode += "."; - sourcecode += ext; - } - else if(strcmp(lang, "C") == 0) - { - sourcecode += ".c.c"; + const char* linkLanguage = cmtarget.GetLinkerLanguage(this); + if(linkLanguage && (std::string(linkLanguage) == "CXX")) + { + sourcecode += ".cpp.h"; + } + else + { + sourcecode += ".c.h"; + } } - else if(strcmp(lang, "CXX") == 0) + else if(lang && strcmp(lang, "CXX") == 0) { sourcecode += ".cpp.cpp"; } - else + else if(lang && strcmp(lang, "C") == 0) { - sourcecode += ext; - sourcecode += "."; - sourcecode += ext; + sourcecode += ".c.c"; } + //else + // { + // // Already specialized above or we leave sourcecode == "sourcecode" + // // which is probably the most correct choice. Extensionless headers, + // // for example... Or file types unknown to Xcode that do not map to a + // // valid lastKnownFileType value. + // } + fileRef->AddAttribute("lastKnownFileType", this->CreateString(sourcecode.c_str())); - std::string path = + + std::string path = this->ConvertToRelativeForXCode(sf->GetFullPath().c_str()); std::string dir; std::string file; cmSystemTools::SplitProgramPath(sf->GetFullPath().c_str(), dir, file); - + fileRef->AddAttribute("name", this->CreateString(file.c_str())); fileRef->AddAttribute("path", this->CreateString(path.c_str())); if(this->XcodeVersion == 15) @@ -590,6 +601,7 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, { fileRef->AddAttribute("sourceTree", this->CreateString("<absolute>")); } + return buildFile; } @@ -693,7 +705,9 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, { externalObjFiles.push_back(xsf); } - else if((*i)->GetPropertyAsBool("HEADER_FILE_ONLY")) + else if((*i)->GetPropertyAsBool("HEADER_FILE_ONLY") || + (tsFlags.Type == cmTarget::SourceFileTypePrivateHeader) || + (tsFlags.Type == cmTarget::SourceFileTypePublicHeader)) { headerFiles.push_back(xsf); } @@ -1003,7 +1017,7 @@ std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag, { std::string retFlag; std::string::size_type pos = flags.find(flag); - if(pos != flags.npos && (pos ==0 || flags[pos]==' ')) + if(pos != flags.npos && (pos ==0 || flags[pos-1]==' ')) { while(pos < flags.size() && flags[pos] != ' ') { diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 757f59828c..ccc788eeee 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -235,6 +235,33 @@ namespace } } } + + enum Op { OpLess, OpEqual, OpGreater }; + bool HandleVersionCompare(Op op, const char* lhs_str, const char* rhs_str) + { + // Parse out up to 4 components. + unsigned int lhs[4] = {0,0,0,0}; + unsigned int rhs[4] = {0,0,0,0}; + sscanf(lhs_str, "%u.%u.%u.%u", &lhs[0], &lhs[1], &lhs[2], &lhs[3]); + sscanf(rhs_str, "%u.%u.%u.%u", &rhs[0], &rhs[1], &rhs[2], &rhs[3]); + + // Do component-wise comparison. + for(unsigned int i=0; i < 4; ++i) + { + if(lhs[i] < rhs[i]) + { + // lhs < rhs, so true if operation is LESS + return op == OpLess; + } + else if(lhs[i] > rhs[i]) + { + // lhs > rhs, so true if operation is GREATER + return op == OpGreater; + } + } + // lhs == rhs, so true if operation is EQUAL + return op == OpEqual; + } } @@ -565,6 +592,37 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args, reducible = 1; } + if (argP1 != newArgs.end() && argP2 != newArgs.end() && + (*(argP1) == "VERSION_LESS" || *(argP1) == "VERSION_GREATER" || + *(argP1) == "VERSION_EQUAL")) + { + def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile); + def2 = cmIfCommand::GetVariableOrString((argP2)->c_str(), makefile); + Op op = OpEqual; + if(*argP1 == "VERSION_LESS") + { + op = OpLess; + } + else if(*argP1 == "VERSION_GREATER") + { + op = OpGreater; + } + bool result = HandleVersionCompare(op, def, def2); + if(result) + { + *arg = "1"; + } + else + { + *arg = "0"; + } + newArgs.erase(argP2); + newArgs.erase(argP1); + argP1 = arg; + IncrementArguments(newArgs,argP1,argP2); + reducible = 1; + } + // is file A newer than file B if (argP1 != newArgs.end() && argP2 != newArgs.end() && *(argP1) == "IS_NEWER_THAN") diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index 532190acf4..912e0a8357 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -177,6 +177,11 @@ public: " if(string STREQUAL string)\n" "True if the given string or variable's value is lexicographically " "less (or greater, or equal) than the string on the right.\n" + " if(version1 VERSION_LESS version2)\n" + " if(version1 VERSION_EQUAL version2)\n" + " if(version1 VERSION_GREATER version2)\n" + "Component-wise integer version number comparison (version format is " + "major[.minor[.patch[.tweak]]]).\n" " if(DEFINED variable)\n" "True if the given variable is defined. It does not matter if the " "variable is true or false just if it has been set."; diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index b396f2278c..aa29f04402 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1314,6 +1314,13 @@ void cmLocalVisualStudio6Generator } std::string line; + std::string libnameExports; + if(exportSymbol.size()) + { + libnameExports = "/D \""; + libnameExports += exportSymbol; + libnameExports += "\""; + } while(cmSystemTools::GetLineFromStream(fin, line)) { const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); @@ -1322,7 +1329,7 @@ void cmLocalVisualStudio6Generator mfcFlag = "0"; } cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME_EXPORTS", - exportSymbol.c_str()); + libnameExports.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG", mfcFlag); if(target.GetType() == cmTarget::STATIC_LIBRARY ) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 149aa692a2..534c3a3222 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -460,7 +460,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"IgnoreAllDefaultLibraries", "NODEFAULTLIB", "ignore all default libs", "TRUE", 0}, {"ModuleDefinitionFile", "DEF:", "add an export def file", "", - cmVS7FlagTable::UserValue}, + cmVS7FlagTable::UserValue}, + {"GenerateMapFile", "MAP", "enable generation of map file", "TRUE", 0}, {0,0,0,0,0} }; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 640e0e7d68..5d8c71f8c9 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -307,6 +307,22 @@ cmPolicies::cmPolicies() "The NEW behavior for this policy is to trust the given path and " "pass it directly to the native build tool unchanged.", 2,6,1, cmPolicies::WARN); + + this->DefinePolicy( + CMP0009, "CMP0009", + "FILE GLOB_RECURSE calls should not follow symlinks by default.", + "In CMake 2.6.1 and below, FILE GLOB_RECURSE calls would follow " + "through symlinks, sometimes coming up with unexpectedly large " + "result sets because of symlinks to top level directories that " + "contain hundreds of thousands of files." + "\n" + "This policy determines whether or not to follow symlinks " + "encountered during a FILE GLOB_RECURSE call. " + "The OLD behavior for this policy is to follow the symlinks. " + "The NEW behavior for this policy is not to follow the symlinks " + "by default, but only if FOLLOW_SYMLINKS is given as an additional " + "argument to the FILE command.", + 2,6,2, cmPolicies::WARN); } cmPolicies::~cmPolicies() @@ -384,7 +400,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, "In order to get compatibility features supporting versions earlier " "than 2.4 set policy CMP0001 to OLD to tell CMake to check the " "CMAKE_BACKWARDS_COMPATIBILITY variable. " - "One way to so this is to set the policy version to 2.4 exactly." + "One way to do this is to set the policy version to 2.4 exactly." ); return false; } diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 5284034cbc..06079b032d 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -49,6 +49,7 @@ public: CMP0006, // BUNDLE install rules needed for MACOSX_BUNDLE targets CMP0007, // list command handling of empty elements CMP0008, // Full-path libraries must be a valid library file name + CMP0009, // GLOB_RECURSE should not follow symlinks by default // Always the last entry. Useful mostly to avoid adding a comma // the last policy when adding a new one. diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index 80fdf29acd..f5dc5128b7 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -67,6 +67,7 @@ Glob::Glob() this->RecurseThroughSymlinks = true; // RecurseThroughSymlinks is true by default for backwards compatibility, // not because it's a good idea... + this->FollowedSymlinkCount = 0; } //---------------------------------------------------------------------------- @@ -266,9 +267,13 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, } if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) { - if (!kwsys::SystemTools::FileIsSymlink(realname.c_str()) || - this->RecurseThroughSymlinks) + bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str()); + if (!isSymLink || this->RecurseThroughSymlinks) { + if (isSymLink) + { + ++this->FollowedSymlinkCount; + } this->RecurseDirectory(start+1, realname, dir_only); } } diff --git a/Source/kwsys/Glob.hxx.in b/Source/kwsys/Glob.hxx.in index a66dd6f551..fb4eac6a61 100644 --- a/Source/kwsys/Glob.hxx.in +++ b/Source/kwsys/Glob.hxx.in @@ -64,6 +64,9 @@ public: void SetRecurseThroughSymlinks(bool i) { this->RecurseThroughSymlinks = i; } bool GetRecurseThroughSymlinks() { return this->RecurseThroughSymlinks; } + //! Get the number of symlinks followed through recursion + unsigned int GetFollowedSymlinkCount() { return this->FollowedSymlinkCount; } + //! Set relative to true to only show relative path to files. void SetRelative(const char* dir); const char* GetRelative(); @@ -98,6 +101,7 @@ protected: bool Recurse; kwsys_stl::string Relative; bool RecurseThroughSymlinks; + unsigned int FollowedSymlinkCount; private: Glob(const Glob&); // Not implemented. diff --git a/Templates/DLLHeader.dsptemplate b/Templates/DLLHeader.dsptemplate index 29ae8e7d7e..20bc778111 100644 --- a/Templates/DLLHeader.dsptemplate +++ b/Templates/DLLHeader.dsptemplate @@ -57,9 +57,9 @@ RSC=rc.exe # PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -89,9 +89,9 @@ CMAKE_CUSTOM_RULE_CODE_RELEASE # PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@@ -122,10 +122,10 @@ CMAKE_CUSTOM_RULE_CODE_DEBUG # PROP Intermediate_Dir "MinSizeRel"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c OUTPUT_LIBNAME_EXPORTS
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -155,9 +155,9 @@ CMAKE_CUSTOM_RULE_CODE_MINSIZEREL # PROP Intermediate_Dir "RelWithDebInfo"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
diff --git a/Templates/EXEHeader.dsptemplate b/Templates/EXEHeader.dsptemplate index 57c5b5f0bf..cf58f0642c 100644 --- a/Templates/EXEHeader.dsptemplate +++ b/Templates/EXEHeader.dsptemplate @@ -58,7 +58,7 @@ RSC=rc.exe # PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -88,7 +88,7 @@ CMAKE_CUSTOM_RULE_CODE_RELEASE # PROP Target_Dir ""
# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@@ -119,7 +119,7 @@ CMAKE_CUSTOM_RULE_CODE_DEBUG # PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
# ADD CPP /nologo /D "WIN32" BUILD_INCLUDES EXTRA_DEFINES /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -149,7 +149,7 @@ CMAKE_CUSTOM_RULE_CODE_MINSIZEREL # PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
# ADD BASE RSC /l 0x409 /d "NDEBUG"
diff --git a/Templates/EXEWinHeader.dsptemplate b/Templates/EXEWinHeader.dsptemplate index 5ca0f91a89..0a68d7fb2f 100644 --- a/Templates/EXEWinHeader.dsptemplate +++ b/Templates/EXEWinHeader.dsptemplate @@ -58,7 +58,7 @@ RSC=rc.exe # PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -90,7 +90,7 @@ CMAKE_CUSTOM_RULE_CODE_RELEASE # PROP Target_Dir ""
# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /GZ /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@@ -121,7 +121,7 @@ CMAKE_CUSTOM_RULE_CODE_DEBUG # PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -151,7 +151,7 @@ CMAKE_CUSTOM_RULE_CODE_MINSIZEREL # PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
+# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index f02cd70f1f..1703fe7af9 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -27,6 +27,7 @@ LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) FIND_PACKAGE(VersionTestA 1) FIND_PACKAGE(VersionTestB 1.2) FIND_PACKAGE(VersionTestC 1.2.3) +FIND_PACKAGE(VersionTestD 1.2.3.4) #----------------------------------------------------------------------------- @@ -144,3 +145,20 @@ IF(NOT "${Special_VERSION_MINOR}" STREQUAL "2") MESSAGE(SEND_ERROR "Package Special is minor version [${Special_VERSION_MINOR}], not [2]") ENDIF(NOT "${Special_VERSION_MINOR}" STREQUAL "2") + +# Test version number comparison. +IF(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") + MESSAGE(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!") +ENDIF() +IF(NOT "1.2" VERSION_LESS "1.10") + MESSAGE(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!") +ENDIF() +IF(NOT "1.02" VERSION_GREATER "1.1") + MESSAGE(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!") +ENDIF() +IF("1.2.3" VERSION_GREATER "1.2.3.4") + MESSAGE(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!") +ENDIF() +IF(NOT "1.2" VERSION_EQUAL "1.2.0.0") + MESSAGE(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!") +ENDIF() diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake index eedf37141b..55c67e2575 100644 --- a/Tests/FindPackageTest/FindVersionTestA.cmake +++ b/Tests/FindPackageTest/FindVersionTestA.cmake @@ -4,9 +4,15 @@ ENDIF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") IF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") ENDIF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(DEFINED VersionTestA_FIND_VERSION_MINOR) - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR should not be defined") -ENDIF(DEFINED VersionTestA_FIND_VERSION_MINOR) -IF(DEFINED VersionTestA_FIND_VERSION_PATCH) - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH should not be defined") -ENDIF(DEFINED VersionTestA_FIND_VERSION_PATCH) +IF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") + MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") +ENDIF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") +IF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") + MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") +ENDIF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") +IF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") + MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") +ENDIF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") +IF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") + MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") +ENDIF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") diff --git a/Tests/FindPackageTest/FindVersionTestB.cmake b/Tests/FindPackageTest/FindVersionTestB.cmake index 787d2006d3..03173c65a1 100644 --- a/Tests/FindPackageTest/FindVersionTestB.cmake +++ b/Tests/FindPackageTest/FindVersionTestB.cmake @@ -7,6 +7,12 @@ ENDIF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") IF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") ENDIF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") -IF(DEFINED VersionTestB_FIND_VERSION_PATCH) - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH should not be defined") -ENDIF(DEFINED VersionTestB_FIND_VERSION_PATCH) +IF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") + MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") +ENDIF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") +IF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") + MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") +ENDIF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") +IF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") + MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") +ENDIF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") diff --git a/Tests/FindPackageTest/FindVersionTestC.cmake b/Tests/FindPackageTest/FindVersionTestC.cmake index 26ce05069d..1344cbc229 100644 --- a/Tests/FindPackageTest/FindVersionTestC.cmake +++ b/Tests/FindPackageTest/FindVersionTestC.cmake @@ -10,3 +10,9 @@ ENDIF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") IF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") ENDIF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") +IF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") + MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") +ENDIF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") +IF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") + MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") +ENDIF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") diff --git a/Tests/FindPackageTest/FindVersionTestD.cmake b/Tests/FindPackageTest/FindVersionTestD.cmake new file mode 100644 index 0000000000..d3e3f509ec --- /dev/null +++ b/Tests/FindPackageTest/FindVersionTestD.cmake @@ -0,0 +1,18 @@ +IF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") + MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") +ENDIF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") +IF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") + MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") +ENDIF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") +IF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") + MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") +ENDIF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") +IF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") + MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") +ENDIF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") +IF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") + MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") +ENDIF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") +IF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") + MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") +ENDIF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") diff --git a/Tests/Framework/CMakeLists.txt b/Tests/Framework/CMakeLists.txt index 397e970f5c..29f9838103 100644 --- a/Tests/Framework/CMakeLists.txt +++ b/Tests/Framework/CMakeLists.txt @@ -5,8 +5,11 @@ add_library(foo SHARED foo.cxx foo.h foo2.h + fooExtensionlessResource fooPublic.h + fooPublicExtensionlessHeader fooPrivate.h + fooPrivateExtensionlessHeader fooNeither.h fooBoth.h test.lua @@ -20,9 +23,9 @@ set(foo_ver ver4) set_target_properties(foo PROPERTIES FRAMEWORK TRUE FRAMEWORK_VERSION ${foo_ver} - PRIVATE_HEADER "fooPrivate.h;fooBoth.h" - PUBLIC_HEADER "foo.h;foo2.h;fooPublic.h;fooBoth.h" - RESOURCE "test.lua" + PRIVATE_HEADER "fooPrivate.h;fooBoth.h;fooPrivateExtensionlessHeader" + PUBLIC_HEADER "foo.h;foo2.h;fooPublic.h;fooBoth.h;fooPublicExtensionlessHeader" + RESOURCE "fooExtensionlessResource;test.lua" INSTALL_NAME_DIR "@executable_path/../../../Library/Frameworks" DEBUG_POSTFIX -d ) @@ -57,11 +60,15 @@ add_library(fooStatic STATIC foo.cxx foo.h foo2.h + fooExtensionlessResource fooPublic.h + fooPublicExtensionlessHeader fooPrivate.h + fooPrivateExtensionlessHeader fooNeither.h fooBoth.h test.lua + fooDeepPublic.h ) set_target_properties(fooStatic PROPERTIES FRAMEWORK TRUE diff --git a/Tests/Framework/fooExtensionlessResource b/Tests/Framework/fooExtensionlessResource new file mode 100644 index 0000000000..5122750ee7 --- /dev/null +++ b/Tests/Framework/fooExtensionlessResource @@ -0,0 +1 @@ +fooExtensionlessResource diff --git a/Tests/Framework/fooPrivateExtensionlessHeader b/Tests/Framework/fooPrivateExtensionlessHeader new file mode 100644 index 0000000000..ac97b929ec --- /dev/null +++ b/Tests/Framework/fooPrivateExtensionlessHeader @@ -0,0 +1 @@ +fooPrivateExtensionlessHeader diff --git a/Tests/Framework/fooPublicExtensionlessHeader b/Tests/Framework/fooPublicExtensionlessHeader new file mode 100644 index 0000000000..972d9898d7 --- /dev/null +++ b/Tests/Framework/fooPublicExtensionlessHeader @@ -0,0 +1 @@ +fooPublicExtensionlessHeader |