diff options
86 files changed, 1355 insertions, 359 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 37e0edc..23525c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,7 +430,7 @@ ENDIF() # The CMake version number. SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 8) -SET(CMake_VERSION_PATCH 3) +SET(CMake_VERSION_PATCH 4) #SET(CMake_VERSION_TWEAK 0) #SET(CMake_VERSION_RC 1) diff --git a/ChangeLog.manual b/ChangeLog.manual index c2e2cdf..20998a3 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,416 @@ +Changes in CMake 2.8.4 (since 2.8.4-rc2) +---------------------------------------- +Alex Neundorf (1): + Fix crash in GraphVizWriter when GRAPHVIZ_TARGET_IGNORE_REGEX is used + +Andreas Schneider (1): + FindPerlLibs: Add notice of copyright + +Brad King (3): + libarchive: Define major/minor/makedev only where needed (#11648) + libarchive: Use OpenSSL only if CMAKE_USE_OPENSSL (#11815) + Fix documentation of MSVC_VERSION (#11833) + +David Cole (1): + Silence the may be used uninitialized warnings: initialize stuff. + +Eric NOULARD (2): + CPack Tests the different ways of packaging components + Avoid foreach IN LISTS syntax which is not supported by CMake 2.6 + +Changes in CMake 2.8.4-rc2 (since 2.8.4-rc1) +-------------------------------------------- +Alex Neundorf (3): + Make cmake build again with cmake < 2.6.3 + Strip trailing whitespace. + Fix parsing of compiler name with a version number + +Ben Boeckel (86): + ... 86 commit messages summarized as: + Fix ADD_TEST regression when WORKING_DIRECTORY not given + Add new "strict-mode" CMake variable checking + Activate / avoid using new command line arguments: + --warn-uninitialized + --warn-unused-vars + --no-warn-unused-cli + --check-system-vars + +Bill Hoffman (3): + For macros make sure the FilePath points to a valid pointer in the args. + Add a warning when variables are used uninitialized. + Make --strict-mode option, and integrate with cmake-gui + +Brad King (34): + bootstrap: Granular system library selection (#11431) + bootstrap: Clarify --init flag documentation (#11431) + bootstrap: --verbose implies verbose Makefiles (#11708) + Combine duplicate COMPILE_DEFINITIONS disclaimer + Document COMPILE_DEFINITIONS known limitations (#11660, #11712) + Document try_compile behavior more clearly (#11688) + Document Check(C|CXX)SourceCompiles behavior more clearly (#11688) + Fix get_(cmake|test)_property documentation (#11703) + Reference get_property() from old get_*_property() commands + Replace misleading example in the if() documentation (#10773) + Clarify auto-dereference cases in if() command (#11701) + Document CheckFunctionExists more clearly (#10044) + Document CheckSymbolExists more clearly (#11685) + Update CheckSymbolExists copyright year + Report directory with missing source file (#11677) + Test that missing source mentions directory (#11677) + Teach Simple_Mingw_Linux2Win test to use windres + Disable SubDirSpaces parens with GNU Make 3.82 (#11654) + libarchive: Fix major() check for LSB 4.0 (#11648) + Xcode: Make generation depend on all input directories + Recognize SCO UnixWare C/C++ compilers (#11700) + Factor SCO compiler info out of platform file (#11700) + Honor CMAKE_TRY_COMPILE_CONFIGURATION in Makefile generators (#10809) + Document CMAKE_TRY_COMPILE_CONFIGURATION variable + Honor VS_SCC_* properties in Fortran targets (#10237) + Normalize slashes in scanned #include lines (#10281) + Improve try_compile and try_run error messages + Use shortest extension to verify try_compile language (#11731) + Modules: Include builtin FindPackageHandleStandardArgs directly + Fix relative CMAKE_USER_MAKE_RULES_OVERRIDE (#11725) + Clarify CMAKE_USER_MAKE_RULES_OVERRIDE documentation (#11724) + Always place try_compile executables predictably (#11724) + try_compile: Allow only languages loaded in caller (#11469) + Fix ArgumentExpansion test expected results + +Clinton Stimpson (1): + Replace exec_program with execute_process for qmake queries. + +David Cole (16): + Update script with new machine name + VS10: Fix problems with InstallRequiredSystemLibraries. + Add CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS variable + Add CPACK_NSIS_INSTALL_ROOT for CMake's own installer (#9148) + Xcode: Disable implicit make rules in custom rules makefiles. + Add freeglut as library name (#10031) + Add new names for PNG and ZLIB libraries + Avoid exceptions when ccmake terminal window is too small (#11668) + VS10: Load projects with obj "source" files (#11147) + VS10: Enable using devenv as CMAKE_MAKE_PROGRAM (#11459) + Xcode: Fix crash: avoid strlen call on NULL char * + CTestTest2: Avoid running purify unless requested + VS10: Escape double quote chars in defines for rc files (#11695) + Fix line too long KWStyle issue (#11695) + Avoid space in rc /D values for VS6 and Cygwin (#11695) + VSResource: Avoid windres /D with quoted spaces (#11695) + +Marcus D. Hanwell (1): + Bug #11715 - generate header in the build tree. + +Nicolas Despres (1): + bootstrap: Add --enable-ccache option (#11707) + +Changes in CMake 2.8.4-rc1 (since 2.8.3) +---------------------------------------- +Alex Neundorf (32): + Add support for nasm assembler, patch by Peter Collingbourne (see #10069) + Improve misleading comments. + Add missing copyright headers + We already have 2010, fix copyright year. + Make FindBISON work properly with non-C locales (#11326) + Add support for yasm, a nasm compatible assembler + Use CMAKE_ASM_NASM_FLAGS for nasm instead of FLAGS + Remove trailing whitespace and minor formatting changes for the dot-code + Move the code for collecting targets and libraries into separate functions + Properly insert all targets, also those which don't link to anything. + Generate separate dot files for each target, and a big one with everything. + Move the code for generating dot-files into separate class cmGraphVizWriter + Fix #11421: FindQt3.cmake doesn't honor the REQUIRED keyword + Remove trailing whitespace + Don't enforce VERBOSE makefiles for the CodeBlocks generator + Remove the "early alpha stage" comments about Eclipse and C::B + Don't disable colors in the CodeBlocks generator and minor cleanup. + Some more fixes for nasm support, from Etienne (#10069) + Enable/disable generating graphs depending on the target type + Use std::cout instead of fprintf + Collect targets and libs on demand instead of in the ctor + Exclude targets from the graphviz file based on a regex + Include CMakeDetermineCompilerId in CMakeDetermineASMCompiler.cmake (#11467) + Fix typos in the doc + Add cache var CMAKE_ECLIPSE_MAKE_ARGUMENTS when using the Eclipse generator + Add ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT as a ADVANCED cache variable (#9631) + Fix crash in Eclipse generator with empty project (#11616) + Fix indentation in cmPolicies::ApplyPolicyVersion() + Remove trailing whitespace + Prefer files from CMAKE_ROOT when including from CMAKE_ROOT + Improve documentation and messages for the new CMP0017 + Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017 + +Alexey Ozeritsky (5): + FindBLAS works in C/C++ projects without Fortran + ACML find fixes (issue 0011219) + find ACML fixes + fix for Fortran-only projects + FindLAPACK works with C/C++ only projects (issue 0009976) + +Andrius Štikonas (1): + Modules: Fix spelling 'becase' -> 'because'. + +Ben Boeckel (25): + Fix parsing of cache variables without a type + Use cmCacheManager to load entries from the cache + Support manual cache entries + Condense parsing of cache entries + Use FPHSA in FindOpenGL + Ignore strerror_r since CMake isn't threaded + Use _POLL_EMUL_H_ instead of HAVE_POLL_FINE + Rename WorkingDirectory test + Add WORKING_DIRECTORY argument to add_test + Add tests for WORKING_DIRECTORY arg to add_test + Rename the project to match the test + Fix header includes for C++ and Visual Studio + Add ctype.h include for toupper() + Flip slashes around on Windows + Use --><-- markers to denote the path + Simplify the _default_cwd derivation + Only test the default cwd with Makefiles + Group adding tests with its properties + Fully specify the path to old-signature add_test + Use iostream to make Borland happy + Check for poll when looking for _POLL_EMUL_H_ + Toss out strerror_r macros + Fix missed _POLL_EMUL_H_ and HAVE_POLL combo + Make TestsWorkingDirectory test a C file + Pass the expected value as the first argument + +Bill Hoffman (17): + Fixes for the OSF operating system build. + Add a fix for the inline keyword on the osf os. + Add a "Contract" test for VTK. The test downloads and builds VTK. + Fix contract test so it is not hard coded to the vtk542 test. + Fix incremental linking for VS2010 with nmake or make. + Change cpack run and verify script to work with multi-config generators. + Fix vs2010 project generation error when HEADER_FILE_ONLY is set. + Add more documentation for LANGUAGE property. + Add flags to resource builds on vs 2010 with a test. + Disable incremental testing for this test, it crashes vs9 linker. + Only run resource test for MSVC compilers. + Add support for windows resources with mingw/msys. + Add support for windres to cygwin. + Add testing for windows resources for mingw/msys/cygwin and remove for watcom. + Enable resource building with the intel compiler on windows. + Add support for source files in custom targets for VS 10 (Bug#11330). + Change the nightly tests to build from the nightly branch and not next. + +Brad King (90): + Store direct dependencies in solutions for VS >= 8 + BUG: Fix compiler flag test for non-English MSVC (#11336) + Document custom command behavior without DEPENDS (#11407) + Consolidate duplicate link rule make dependency code + Define LINK_DEPENDS target property (#11406) + KWSys: Teach SystemInformation about WinXP Pro and Win7 + Fix Intel .vfproj SubSystem attribute values + Set Intel .vfproj RuntimeLibrary attribute + Create Fortran info variables for .mod behavior + Teach CMake about Cray C, C++, and Fortran compilers + Speedup find_* commands (#11412) + Prefer non-empty prefixes when matching lib names (#11468) + Record edge type in global dependency graph + Use modern global dependency graph for VS < 8 deps + Allow add_dependencies() on imported targets (#10395) + Pass Mac linker flag through PGI compiler using "-Wl," + Modernize FindITK module (#11494) + Fix find_* argument parsing crash (#11513) + Skip VS <= 7.1 dependency analysis for VS >= 8 + Enable 64-bit tools with VS 2010 Express (#9981, #10722) + KWSys: Associate installed library with an EXPORT + Fix try_compile RemoveFile anti-virus loop (#11503) + Fix Fortran .mod timestamps with Cray compiler + Make Fortran $obj.provides.build targets not .PHONY + Honor custom command dependencies on imported targets (#10395) + Improve signature of cmLocalGenerator::GetRealDependency + Skip file-level dependencies on custom targets (#11332) + Simplify VS generator ConstructScript interface + Factor out common custom command generator + Remove cmLocalGenerator::GetRealLocation + KWSys: Remove realpath from SystemTools::GetPath (#10335) + Fix parallel "make install" of CMake itself + CTest: Fix ctest_sleep documentation (#11554) + Fix soname in cross-compiled targets with Mac host (#11547) + Detect object files in implicit link information + Allow Fortran platform files to set empty values + Recognize the NAG Fortran compiler + Add NAG Fortran compiler information files + FortranCInterface: Recognize NAG Fortran module symbols + Remove unused variable "rootdir" in VS generators + Avoid msbuild idiosyncrasy that builds multiple configs (#11594) + Remove unused parameter "root" in some VS generator methods + Fix dependency tracing of INSTALL and PACKAGE (#11598) + Remove unused GLOBAL_TARGET generation code + KWSys: Use EXPORT name only if installing library + Write full version into try_compile CMakeLists + KWSys: Do not mangle UNC paths in ConvertToUnixOutputPath (#10206) + Normalize add_custom_command OUTPUT names (#10485) + Make link rule depend on ".def" file (#11014) + Document target_link_libraries target scope (#11058) + Record backtrace in cmCustomCommand + Factor generator expression docs out of add_test + Factor per-config sample targets out of 'Testing' test + Optionally suppress errors in cmGeneratorExpression + Record set of targets used in cmGeneratorExpression + Introduce "generator expression" syntax to custom commands (#11209) + CTest: Fix test DEPEND cycle detection + Make Intel defines consistent with MSVC on Windows (#9904) + CTest: Fix line-too-long style in DEPEND cycle error + Detect Fortran target architecture on Windows + Modernize Intel compiler info on Windows + Remove unused old-style g++ info file + CheckCCompilerFlag: Strict signature of 'main' (#11615) + Warn in find(GLOB) docs about bad use case (#11617) + Remove call to SystemTools::GetMaximumFilePathLength + Xcode: Generate native 3.2 projects + Declare min CMake version in --system-information project + Cygwin: Fix tests to check CYGWIN instead of WIN32 + Cygwin: Do not define 'WIN32' (#10122) + Revert "Remove unused parameter "root" in some VS generator methods" + Revert "Avoid msbuild idiosyncrasy that builds multiple configs" (#11633) + Avoid msbuild ".\" idiosyncrasy that builds multiple configs (#11594) + Mark CustomCommand test perconfig.out as SYMBOLIC + CTest: Factor out duplicate Git author/committer code + KWSys: Avoid buffer overflow in SystemInformation (#11018) + Fix sentence break in add_test documentation + Pass Mac linker flag through all compilers with -Wl, + KWSys: Avoid passing string literal as char* + Avoid passing string literal to char* type + Fix constness in compiler id detection + Build enable_language command during bootstrap + Map multiple /FI flags for VS < 10 (#11649) + KWSys: Remove useless include <sys/procfs.h> (#11648) + Allow users to specify defaults for unset policies + ccmake: Use LSB 4.0 curses API conditionally + CTest: Do not truncate UTF-8 test output too early (#10656) + ccmake: Use LSB 4.0 getmaxyx conditionally + Allow platform files to set large archive rules (#11674) + Document reading LOCATION early as undefined (#11671) + Document reading LOCATION_<CONFIG> early as undefined (#11671) + +Brian Bassett (1): + VS: Fix linking of Fortran-only DLL projects (#10803) + +Campbell Barton (1): + Honor RULE_MESSAGES property for build target messages + +Chuck Atkins (1): + CTest: Teach launcher to ignore empty/no-op make commands + +Clinton Stimpson (11): + Fix regex for moc includes when looking for frameworks. + cmake-gui: use BundleUtilities in place of custom script. + Fix regression in 2dae2f1 which added find of Qt imports dir. + Force cmake to run again when qrc dependency scanning needs to happen. + Fix regression to allow specifying a CMakeCache.txt file on the command line. + BundleUtilities: only do rpath strip on copied prerequisites. + Fix build issues cross compiling with static Qt. + CTest: multiple ctest_test calls w/LABEL regexs (#11487) + cmake-gui: always enable generate button. + allow absolute paths for dbus interface. + Add support for using static/dynamic Qt plugins. + +Craig Scott (1): + ccmake: Port for LSB 4.0 (#11648) + +Dave Abrahams (1): + FindPerlLibs: Fix for Mac locally applied patches + +David Cole (31): + Add a contract test for building the CSE. + Enable overriding contract test timeout values. + Update tag in the Contracts/cse-snapshot test. + Make HTML test fail when --nonet arg is not available. + Begin post-2.8.3 development + No CMake.HTML test if xmllint has no --nonet. + Suppress "loop was vectorized" "warnings." + Add contract test for Trilinos 10.6.1 snapshot. + Honor FOLDER on include_external_msproject targets (#11436) + Correct misspelling in error message text. + BundleUtilities: error if fixup_bundle_item called on non-embedded item + VS10: stop build on custom command error (#11533) + CPack: look for makensis in the PATH (#8210) + VS10: avoid warning, no nologo when verbose (#10587) + Use m prefix in shorttag value to indicate "md5 of tarball" + Establish pass criteria for the Trilinos contract test. + Suppress erroneous warnings from Intel compiler + Avoid running CMake.Install test simultaneously with other tests + VS10: Finish Midl support (#11461) + Prohibit space in HOME value for VSMidl test. + KWSys: Fix CPU speed calculations (#9963) + KWSys: Retrieve QNX specific memory and processor info (#11329) + Improve build error detection. + VSMidl Test: Use correct include_directories with VS6 (#11461) + Add PATH_SUFFIXES for finding git. + ExternalProject: Avoid bleed-through output when logging. + Fix WOW64 registry mode on Windows 2000 (#10759) + ExternalProject: Replace location tags in CMAKE_CACHE_ARGS + CPack: Detect more URLs in CPACK_NSIS_MENU_LINKS (#10644) + KWSys: Fix WOW64 registry mode on Windows 2000 (#10759) + CPack: Add CPACK_NSIS_INSTALL_ROOT variable (#9148) + +Eric NOULARD (13): + CPackRPM add basic component support to CPackRPM + CPack fix kwstyle breakage and make CPackRPM backward compatible + CPack backward compatibility fix 2.8.3-2.8.2 (bug 11452) + CPack Fix KWStyle error + CPack Honor CPACK_MONOLITHIC_INSTALL at CPack time too + CPack use IsOn when it's better than IsSet + CPackRPM fix bug 0011595 : Can't generate RPMs (on FC11...) + CPack new tests for component install + CPack Default component test for ZIP should be OK + CPackTest spit out more output in case of failure + Arrange output in a better way + Precise the project config type when invoking cpack + CPackSTGZ quote here-doc, fix bug10518 + +Kai Wasserbäch (1): + FindTCL: Fix TCL and TK version variable references (#11528) + +Marcus D. Hanwell (5): + BUG 11451 - pass CMAKE_EXTRA_GENERATOR down. + Added CMAKE_CACHE_ARGS to ExternalProject. + Escape file write expansion, and build up lists. + Fixed bug where last entry would be lost. + Python additional version support, bug #10279. + +Matthias Kretz (1): + Inline help in vim with vertical split. + +Mike McQuaid (6): + Fix incorrect variable documentation (#11127) + Add variable for InstallRequiredSystemLibraries dir (#11140) + InstallRequiredSystemLibraries debug-only (#11141) + Allow NSIS package or uninstall icon (#11143) + Add CPACK_NSIS_EXECUTABLES_DIRECTORY (#7828) + Add CPack NSIS MUI_FINISHPAGE_RUN support (#11144) + +Philip Lowman (8): + 11363: FindBoost.cmake fails to find debug libraries in tagged layout install + 11429: FindGTK2 does not find libraries built for Visual Studio 2010 + 11430: FindBullet doesn't find header files installed by Bullet >= 2.77 + 11384: FindCxxTest now includes test code in VS project + [patch] Add Boost 1.45 to search, simplify a check removing VERSION_LESS + Add Boost 1.46 + Fix spelling BOOST_LIBRARYDIR message. Add error for common misspellings. + Lowercase all function names and improve consistency + +Rolf Eike Beer (2): + allow STRING(SUBSTRING) work with length -1 as "rest of the string" + Add the WORKING_DIRECTORY property to tests + +Wojciech Migda (1): + Recognize the Texas Instruments DSP compiler (#11645) + +Yaakov Selkowitz (2): + Cygwin: Use 'cyg' prefix for module DLLs (#10122) + Cygwin: Fix release script libncurses search patterns (#10766) + +Zach Mullen (4): + Remove debugging message from parallel ctest + CTest git update should pass the committer as well as the author + Support explicitly set test costs in non-parallel testing. + Test TIMEOUT property explicitly set to zero should be honored + No changes in CMake 2.8.3 since 2.8.3-rc4. Changes in CMake 2.8.3-rc4 (since 2.8.3-rc3) diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 7a443e0..d6350bf 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -81,16 +81,17 @@ ENDIF() # If we have a gas/as cross compiler, they have usually some prefix, like -# e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas . +# e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas , optionally +# with a 3-component version number at the end # 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-gas.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_ASM${ASM_DIALECT}_COMPILER}" NAME) - IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(\\.exe)?$") + IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") STRING(REGEX REPLACE "^(.+-)g?as(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}") - ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(\\.exe)?$") + ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) INCLUDE(CMakeFindBinUtils) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 639b426..06664c1 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -15,14 +15,14 @@ # determine the compiler to use for C programs # NOTE, a generator may set CMAKE_C_COMPILER before # loading this file to force a compiler. -# use environment variable CC first if defined by user, next use +# use environment variable CC first if defined by user, next use # the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator # as a default compiler -# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used +# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used # as prefix for the tools (e.g. arm-elf-gcc, arm-elf-ar etc.). This works # currently with the GNU crosscompilers. # -# Sets the following variables: +# Sets the following variables: # CMAKE_C_COMPILER # CMAKE_AR # CMAKE_RANLIB @@ -41,12 +41,12 @@ IF(NOT CMAKE_C_COMPILER) SET(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler") ENDIF(CMAKE_C_FLAGS_ENV_INIT) IF(NOT EXISTS ${CMAKE_C_COMPILER_INIT}) - MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.") + MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.") ENDIF(NOT EXISTS ${CMAKE_C_COMPILER_INIT}) ENDIF($ENV{CC} MATCHES ".+") # next try prefer the compiler specified by the generator - IF(CMAKE_GENERATOR_CC) + IF(CMAKE_GENERATOR_CC) IF(NOT CMAKE_C_COMPILER_INIT) SET(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC}) ENDIF(NOT CMAKE_C_COMPILER_INIT) @@ -64,7 +64,7 @@ IF(NOT CMAKE_C_COMPILER) FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} PATHS ${_CMAKE_USER_CXX_COMPILER_PATH} DOC "C compiler" NO_DEFAULT_PATH) ENDIF (_CMAKE_USER_CXX_COMPILER_PATH) FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} DOC "C compiler") - + IF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER) SET(CMAKE_C_COMPILER "${CMAKE_C_COMPILER_INIT}" CACHE FILEPATH "C compiler" FORCE) ENDIF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER) @@ -72,7 +72,7 @@ ELSE(NOT CMAKE_C_COMPILER) # we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE - # if CMAKE_C_COMPILER is a list of length 2, use the first item as + # if CMAKE_C_COMPILER is a list of length 2, use the first item as # CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1 LIST(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH) @@ -81,9 +81,9 @@ ELSE(NOT CMAKE_C_COMPILER) LIST(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER) ENDIF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2) - # if a compiler was specified by the user but without path, + # if a compiler was specified by the user but without path, # now try to find it with the full path - # if it is found, force it into the cache, + # if it is found, force it into the cache, # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND" # if the C compiler already had a path, reuse it for searching the CXX compiler GET_FILENAME_COMPONENT(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH) @@ -143,19 +143,20 @@ 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 . +# 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, optionally +# with a 3-component version number at the end (e.g. arm-eabi-gcc-4.5.2). # 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.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 +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)?$") + IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$") + ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.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.) @@ -163,7 +164,7 @@ IF (CMAKE_CROSSCOMPILING SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") -ENDIF (CMAKE_CROSSCOMPILING +ENDIF (CMAKE_CROSSCOMPILING AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _CMAKE_TOOLCHAIN_PREFIX) @@ -179,5 +180,5 @@ ENDIF(MSVC_C_ARCHITECTURE_ID) CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake" @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 - ) + ) SET(CMAKE_C_COMPILER_ENV_VAR "CC") diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 555d20e..e77672d 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -15,10 +15,10 @@ # determine the compiler to use for C++ programs # NOTE, a generator may set CMAKE_CXX_COMPILER before # loading this file to force a compiler. -# use environment variable CXX first if defined by user, next use +# use environment variable CXX first if defined by user, next use # the cmake variable CMAKE_GENERATOR_CXX which can be defined by a generator # as a default compiler -# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used +# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used # as prefix for the tools (e.g. arm-elf-g++, arm-elf-ar etc.) # # Sets the following variables: @@ -63,7 +63,7 @@ IF(NOT CMAKE_CXX_COMPILER) FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} PATHS ${_CMAKE_USER_C_COMPILER_PATH} DOC "C++ compiler" NO_DEFAULT_PATH) ENDIF (_CMAKE_USER_C_COMPILER_PATH) FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} DOC "C++ compiler") - + IF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER) SET(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER_INIT}" CACHE FILEPATH "C++ compiler" FORCE) ENDIF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER) @@ -72,7 +72,7 @@ ELSE(NOT CMAKE_CXX_COMPILER) # we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE # -# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as +# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as # CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1 LIST(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH) @@ -81,9 +81,9 @@ ELSE(NOT CMAKE_CXX_COMPILER) LIST(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER) ENDIF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2) -# if a compiler was specified by the user but without path, +# if a compiler was specified by the user but without path, # now try to find it with the full path -# if it is found, force it into the cache, +# if it is found, force it into the cache, # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND" # if the CXX compiler already had a path, reuse it for searching the C compiler GET_FILENAME_COMPONENT(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH) @@ -151,19 +151,20 @@ 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 +# 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++ , optionally +# with a 3-component version number at the end (e.g. arm-eabi-gcc-4.5.2). +# 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.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 +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)?$") + IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) - ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$") + ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.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.) @@ -171,7 +172,7 @@ IF (CMAKE_CROSSCOMPILING SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") -ENDIF (CMAKE_CROSSCOMPILING +ENDIF (CMAKE_CROSSCOMPILING AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _CMAKE_TOOLCHAIN_PREFIX) diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index bb76ddd..c261eb3 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -63,7 +63,8 @@ OPTION(BUILD_TESTING "Build the testing tree." ON) # function to turn generator name into a version string # like vs7 vs71 vs8 vs9 FUNCTION(GET_VS_VERSION_STRING generator var) - STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER "${generator}") + STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" + NUMBER "${generator}") IF("${generator}" MATCHES "Visual Studio 7 .NET 2003") SET(ver_string "vs71") ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003") @@ -253,15 +254,16 @@ IF(BUILD_TESTING) ENDIF(CTEST_USE_LAUNCHERS) MARK_AS_ADVANCED( + BZRCOMMAND + BZR_UPDATE_OPTIONS COVERAGE_COMMAND + CTEST_SUBMIT_RETRY_DELAY + CTEST_SUBMIT_RETRY_COUNT CVSCOMMAND - SVNCOMMAND - BZRCOMMAND - HGCOMMAND - GITCOMMAND CVS_UPDATE_OPTIONS - SVN_UPDATE_OPTIONS - BZR_UPDATE_OPTIONS + DART_TESTING_TIMEOUT + GITCOMMAND + HGCOMMAND MAKECOMMAND MEMORYCHECK_COMMAND MEMORYCHECK_SUPPRESSIONS_FILE @@ -270,10 +272,9 @@ IF(BUILD_TESTING) SLURM_SBATCH_COMMAND SLURM_SRUN_COMMAND SITE - CTEST_SUBMIT_RETRY_DELAY - CTEST_SUBMIT_RETRY_COUNT + SVNCOMMAND + SVN_UPDATE_OPTIONS ) - # BUILDNAME IF(NOT RUN_FROM_DART) SET(RUN_FROM_CTEST_OR_DART 1) INCLUDE(CTestTargets) diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake index 270d894..eea55f1 100644 --- a/Modules/FindPerlLibs.cmake +++ b/Modules/FindPerlLibs.cmake @@ -25,6 +25,7 @@ #============================================================================= # Copyright 2004-2009 Kitware, Inc. +# Copyright 2008 Andreas Schneider <asn@cryptomilk.org> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 7722c19..278d4df 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -343,7 +343,7 @@ TARGET_LINK_LIBRARIES(CMakeLib cmsys ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES} ${CMAKE_CURL_LIBRARIES} ) -# On Apple we need Carbon +# On Apple we need CoreFoundation IF(APPLE) TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation") ENDIF(APPLE) @@ -465,7 +465,7 @@ IF(APPLE) ADD_EXECUTABLE(OSXScriptLauncher CPack/OSXScriptLauncher.cxx) TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys) - TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework Carbon") + TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation") ENDIF(APPLE) # Build CMake executable diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index 99ffecc..e0fbe9b 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -14,7 +14,6 @@ #include <cmsys/ios/fstream> #include <cmsys/ios/iostream> -#include <Carbon/Carbon.h> #include <CoreFoundation/CoreFoundation.h> // For the PATH_MAX constant diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 2d4bb97..0e8cbc0 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -150,7 +150,7 @@ int cmCPackOSXX11Generator::PackageFiles() // since we get random dashboard failures with this one // try running it more than once int numTries = 4; - bool res; + bool res = false; while(numTries > 0) { res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index ef81da8..0c4b1a6 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -320,7 +320,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string output; int retVal = 1; int numTries = 4; - bool res; + bool res = false; while(numTries > 0) { res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index 03896c2..f234722 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -1086,7 +1086,7 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts) if (form->status & _POSTED) { - if ((form->curpage == field->page)) + if (form->curpage == field->page) { if (changed_opts & O_VISIBLE) { diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 7af6ec8..502829e 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -286,6 +286,13 @@ bool cmAddCustomCommandCommand return false; } + // Convert working directory to a full path. + if(!working.empty()) + { + const char* build_dir = this->Makefile->GetCurrentOutputDirectory(); + working = cmSystemTools::CollapseFullPath(working.c_str(), build_dir); + } + // Choose which mode of the command to use. bool escapeOldStyle = !verbatim; if(source.empty() && output.empty()) diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h index 490e043..47b542c 100644 --- a/Source/cmAddCustomCommandCommand.h +++ b/Source/cmAddCustomCommandCommand.h @@ -110,6 +110,8 @@ public: "will be treated as PRE_LINK.\n" "If WORKING_DIRECTORY is specified the command will be executed " "in the directory given. " + "If it is a relative path it will be interpreted relative to the " + "build tree directory corresponding to the current source directory. " "If COMMENT is set, the value will be displayed as a " "message before the commands are executed at build time. " "If APPEND is specified the COMMAND and DEPENDS option values " diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index edb787b..27dea98 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -166,6 +166,14 @@ bool cmAddCustomTargetCommand } } + // Convert working directory to a full path. + if(!working_directory.empty()) + { + const char* build_dir = this->Makefile->GetCurrentOutputDirectory(); + working_directory = + cmSystemTools::CollapseFullPath(working_directory.c_str(), build_dir); + } + // Add the utility target to the makefile. bool escapeOldStyle = !verbatim; cmTarget* target = diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h index 7a2b396..6d94fb2 100644 --- a/Source/cmAddCustomTargetCommand.h +++ b/Source/cmAddCustomTargetCommand.h @@ -79,6 +79,8 @@ public: "empty target will be created. " "If WORKING_DIRECTORY is set, then the command will be run in that " "directory. " + "If it is a relative path it will be interpreted relative to the " + "build tree directory corresponding to the current source directory. " "If COMMENT is set, the value will be displayed as a " "message before the commands are executed at build time. " "Dependencies listed with the DEPENDS argument may reference files " diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 6fffecb..0cd5fa2 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -867,8 +867,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("MSVC_VERSION", cmProperty::VARIABLE, "The version of Microsoft Visual C/C++ being used if any.", - "The version of Microsoft Visual C/C++ being used if any. " - "For example 1300 is MSVC 6.0.", + "Known version numbers are:\n" + " 1200 = VS 6.0\n" + " 1300 = VS 7.0\n" + " 1310 = VS 7.1\n" + " 1400 = VS 8.0\n" + " 1500 = VS 9.0\n" + " 1600 = VS 10.0\n" + "", false, "Variables That Describe the System"); diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index e2a6035..9e5c91e 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -325,6 +325,12 @@ cmExportFileGenerator os << "SET_PROPERTY(TARGET " << targetName << " PROPERTY MACOSX_BUNDLE 1)\n"; } + + if (target->IsCFBundleOnApple()) + { + os << "SET_PROPERTY(TARGET " << targetName + << " PROPERTY BUNDLE 1)\n"; + } os << "\n"; } diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 717571c..23ff5fb 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -263,6 +263,20 @@ cmExportInstallFileGenerator value += ".framework/"; value += itgen->GetInstallFilename(target, config); } + else if(target->IsCFBundleOnApple()) + { + const char *ext = target->GetProperty("BUNDLE_EXTENSION"); + if (!ext) + { + ext = "bundle"; + } + + value += itgen->GetInstallFilename(target, config); + value += "."; + value += ext; + value += "/"; + value += itgen->GetInstallFilename(target, config); + } else if(target->IsAppBundleOnApple()) { value += itgen->GetInstallFilename(target, config); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 2d080df..ef723b7 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -358,6 +358,15 @@ static cmVS7FlagTable cmVS8ExtraFlagTable[] = {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, + {"EnablePREfast", "analyze", "", "true", 0}, + {"EnablePREfast", "analyze-", "", "false", 0}, + + // Language options + {"TreatWChar_tAsBuiltInType", "Zc:wchar_t", + "wchar_t is a built-in type", "true", 0}, + {"TreatWChar_tAsBuiltInType", "Zc:wchar_t-", + "wchar_t is not a built-in type", "false", 0}, + {0,0,0,0,0} }; cmIDEFlagTable const* cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 1395865..d5c0fef 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -165,13 +165,16 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const& } else { - mf->AddCacheDefinition( - "CMAKE_CONFIGURATION_TYPES", - "Debug;Release;MinSizeRel;RelWithDebInfo", - "Semicolon separated list of supported configuration types, " - "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " - "anything else will be ignored.", - cmCacheManager::STRING); + if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) + { + mf->AddCacheDefinition( + "CMAKE_CONFIGURATION_TYPES", + "Debug;Release;MinSizeRel;RelWithDebInfo", + "Semicolon separated list of supported configuration types, " + "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " + "anything else will be ignored.", + cmCacheManager::STRING); + } } mf->AddDefinition("CMAKE_GENERATOR_CC", "gcc"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "g++"); @@ -578,6 +581,12 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, } } + if(cmtarget.IsCFBundleOnApple()) + { + cmtarget.SetProperty("PREFIX", ""); + cmtarget.SetProperty("SUFFIX", ""); + } + // Add the fileRef to the top level Resources group/folder if it is not // already there. // @@ -812,6 +821,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // some build phases only apply to bundles and/or frameworks bool isFrameworkTarget = cmtarget.IsFrameworkOnApple(); bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"); + bool isCFBundleTarget = cmtarget.IsCFBundleOnApple(); cmXCodeObject* buildFiles = 0; @@ -857,7 +867,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // create resource build phase - only for framework or bundle targets cmXCodeObject* resourceBuildPhase = 0; - if (!resourceFiles.empty() && (isFrameworkTarget || isBundleTarget)) + if (!resourceFiles.empty() && + (isFrameworkTarget || isBundleTarget || isCFBundleTarget)) { resourceBuildPhase = this->CreateObject(cmXCodeObject::PBXResourcesBuildPhase); @@ -878,7 +889,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // create vector of "non-resource content file" build phases - only for // framework or bundle targets std::vector<cmXCodeObject*> contentBuildPhases; - if (isFrameworkTarget || isBundleTarget) + if (isFrameworkTarget || isBundleTarget || isCFBundleTarget) { typedef std::map<cmStdString, std::vector<cmSourceFile*> > mapOfVectorOfSourceFiles; @@ -1605,7 +1616,33 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { buildSettings->AddAttribute("LIBRARY_STYLE", this->CreateString("BUNDLE")); - if(this->XcodeVersion >= 22) + if (target.GetPropertyAsBool("BUNDLE")) + { + // It turns out that a BUNDLE is basically the same + // in many ways as an application bundle, as far as + // link flags go + std::string createFlags = + this->LookupFlags("CMAKE_SHARED_MODULE_CREATE_", lang, "_FLAGS", + "-bundle"); + if(!createFlags.empty()) + { + extraLinkOptions += " "; + extraLinkOptions += createFlags; + } + std::string plist = this->ComputeInfoPListLocation(target); + // Xcode will create the final version of Info.plist at build time, + // so let it replace the cfbundle name. This avoids creating + // a per-configuration Info.plist file. The cfbundle plist + // is very similar to the application bundle plist + this->CurrentLocalGenerator + ->GenerateAppleInfoPList(&target, "$(EXECUTABLE_NAME)", + plist.c_str()); + std::string path = + this->ConvertToRelativeForXCode(plist.c_str()); + buildSettings->AddAttribute("INFOPLIST_FILE", + this->CreateString(path.c_str())); + } + else if(this->XcodeVersion >= 22) { buildSettings->AddAttribute("MACH_O_TYPE", this->CreateString("mh_bundle")); @@ -1644,7 +1681,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, std::string plist = this->ComputeInfoPListLocation(target); // Xcode will create the final version of Info.plist at build time, - // so let it replace the framework name. This avoids creating + // so let it replace the framework name. This avoids creating // a per-configuration Info.plist file. this->CurrentLocalGenerator ->GenerateFrameworkInfoPList(&target, "$(EXECUTABLE_NAME)", @@ -2043,7 +2080,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget) case cmTarget::STATIC_LIBRARY: return "archive.ar"; case cmTarget::MODULE_LIBRARY: - return ((this->XcodeVersion >= 22)? + if (cmtarget.IsCFBundleOnApple()) + return "wrapper.plug-in"; + else + return ((this->XcodeVersion >= 22)? "compiled.mach-o.executable" : "compiled.mach-o.dylib"); case cmTarget::SHARED_LIBRARY: return (cmtarget.GetPropertyAsBool("FRAMEWORK")? @@ -2063,8 +2103,12 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget) case cmTarget::STATIC_LIBRARY: return "com.apple.product-type.library.static"; case cmTarget::MODULE_LIBRARY: - return ((this->XcodeVersion >= 22)? "com.apple.product-type.tool" : - "com.apple.product-type.library.dynamic"); + if (cmtarget.IsCFBundleOnApple()) + return "com.apple.product-type.bundle"; + else + return ((this->XcodeVersion >= 22)? + "com.apple.product-type.tool" : + "com.apple.product-type.library.dynamic"); case cmTarget::SHARED_LIBRARY: return (cmtarget.GetPropertyAsBool("FRAMEWORK")? "com.apple.product-type.framework" : @@ -2693,7 +2737,7 @@ void cmGlobalXCodeGenerator this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); const char* osxArch = this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES"); - if(strlen(osxArch) == 0) + if(!osxArch || strlen(osxArch) == 0) { if(this->XcodeVersion >= 32) { diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index bdb33bc..de95aa5 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -272,6 +272,12 @@ void cmGraphVizWriter::WriteConnections(const char* targetName, std::map<cmStdString, cmStdString>::const_iterator libNameIt = this->TargetNamesNodes.find(libName); + // can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used + if(libNameIt == this->TargetNamesNodes.end()) + { + continue; + } + std::string connectionName = myNodeName; connectionName += "-"; connectionName += libNameIt->second; diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h index 7f229fa..d215295 100644 --- a/Source/cmListCommand.h +++ b/Source/cmListCommand.h @@ -83,6 +83,14 @@ public: "REMOVE_DUPLICATES will remove duplicated items in the list.\n" "REVERSE reverses the contents of the list in-place.\n" "SORT sorts the list in-place alphabetically.\n" + "The list subcommands APPEND, INSERT, REMOVE_AT, REMOVE_ITEM, " + "REMOVE_DUPLICATES, REVERSE and SORT may create new values for " + "the list within the current CMake variable scope. Similar to " + "the SET command, the LIST command creates new variable values " + "in the current scope, even if the list itself is actually " + "defined in a parent scope. To propagate the results of these " + "operations upwards, use SET with PARENT_SCOPE, SET with CACHE " + "INTERNAL, or some other means of value propagation.\n" "NOTES: A list in cmake is a ; separated group of strings. " "To create a list the set command can be used. For example, " "set(var a b c d e) creates a list with a;b;c;d;e, and " diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d3cbc1f..cd265c1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1893,6 +1893,7 @@ bool cmLocalGenerator::GetRealDependency(const char* inName, { // This is a full path. Return it as given. dep = inName; + cmSystemTools::ConvertToUnixSlashes(dep); return true; } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 34756d8..700d92a 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -381,6 +381,11 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = "Use sse2 instructions", "2", 0}, {"EnableEnhancedInstructionSet", "arch:SSE", "Use sse instructions", "1", 0}, + {"FloatingPointModel", "fp:precise", + "Use precise floating point model", "0", 0}, + {"FloatingPointModel", "fp:strict", + "Use strict floating point model", "1", 0}, + {"FloatingPointModel", "fp:fast", "Use fast floating point model", "2", 0}, {"FavorSizeOrSpeed", "Ot", "Favor fast code", "1", 0}, {"FavorSizeOrSpeed", "Os", "Favor small code", "2", 0}, {"CompileAs", "TC", "Compile as c code", "1", 0}, @@ -451,8 +456,13 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = "Turn off Run time type information for c++", "FALSE", 0}, {"SmallerTypeCheck", "RTCc", "smaller type check", "TRUE", 0}, {"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "TRUE", 0}, + {"WholeProgramOptimization", "GL", + "Enables whole program optimization", "TRUE", 0}, + {"WholeProgramOptimization", "GL-", + "Disables whole program optimization", "FALSE", 0}, {"WarnAsError", "WX", "Treat warnings as errors", "TRUE", 0}, {"BrowseInformation", "FR", "Generate browse information", "1", 0}, + {"StringPooling", "GF", "Enable StringPooling", "TRUE", 0}, {0,0,0,0,0} }; @@ -466,6 +476,14 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE", 0}, {"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1", 0}, {"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2", 0}, + {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0}, + {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0}, + {"DataExecutionPrevention", "NXCOMPAT:NO", + "Not known to work with Windows Data Execution Prevention", "1", 0}, + {"DataExecutionPrevention", "NXCOMPAT", + "Known to work with Windows Data Execution Prevention", "2", 0}, + {"DelaySign", "DELAYSIGN:NO", "", "false", 0}, + {"DelaySign", "DELAYSIGN", "", "true", 0}, {"EntryPointSymbol", "ENTRY:", "sets the starting address", "", cmVS7FlagTable::UserValue}, {"IgnoreDefaultLibraryNames", "NODEFAULTLIB:", "default libs to ignore", "", @@ -478,8 +496,16 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"EnableCOMDATFolding", "OPT:NOICF", "Do not remove redundant COMDATs", "1", 0}, {"EnableCOMDATFolding", "OPT:ICF", "Remove redundant COMDATs", "2", 0}, + {"ResourceOnlyDLL", "NOENTRY", "Create DLL with no entry point", "true", 0}, {"OptimizeReferences", "OPT:NOREF", "Keep unreferenced data", "1", 0}, {"OptimizeReferences", "OPT:REF", "Eliminate unreferenced data", "2", 0}, + {"Profile", "PROFILE", "", "true", 0}, + {"RandomizedBaseAddress", "DYNAMICBASE:NO", + "Image may not be rebased at load-time", "1", 0}, + {"RandomizedBaseAddress", "DYNAMICBASE", + "Image may be rebased at load-time", "2", 0}, + {"SetChecksum", "RELEASE", "Enable setting checksum in header", "true", 0}, + {"SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0}, {"TargetMachine", "MACHINE:I386", "Machine x86", "1", 0}, {"TargetMachine", "MACHINE:X86", "Machine x86", "1", 0}, {"TargetMachine", "MACHINE:AM33", "Machine AM33", "2", 0}, @@ -498,6 +524,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"TargetMachine", "MACHINE:SH5", "Machine SH5", "15", 0}, {"TargetMachine", "MACHINE:THUMB", "Machine THUMB", "16", 0}, {"TargetMachine", "MACHINE:X64", "Machine x64", "17", 0}, + {"TurnOffAssemblyGeneration", "NOASSEMBLY", + "No assembly even if CLR information is present in objects.", "true", 0}, {"ModuleDefinitionFile", "DEF:", "add an export def file", "", cmVS7FlagTable::UserValue}, {"GenerateMapFile", "MAP", "enable generation of map file", "TRUE", 0}, @@ -755,7 +783,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, } fout << "\"\n"; targetOptions.OutputFlagMap(fout, "\t\t\t\t"); - targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n"); + targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX"); fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n"; fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n"; if(targetBuilds) @@ -789,7 +817,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, } // add the -D flags to the RC tool fout << "\""; - targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", ""); + targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "", "RC"); fout << "/>\n"; tool = "VCMIDLTool"; if(this->FortranProject) @@ -1462,6 +1490,7 @@ void cmLocalVisualStudio7Generator else if(!fcinfo.FileConfigMap.empty()) { const char* aCompilerTool = "VCCLCompilerTool"; + const char* lang = "CXX"; if(this->FortranProject) { aCompilerTool = "VFFortranCompilerTool"; @@ -1479,6 +1508,7 @@ void cmLocalVisualStudio7Generator if(ext == "rc") { aCompilerTool = "VCResourceCompilerTool"; + lang = "RC"; if(this->FortranProject) { aCompilerTool = "VFResourceCompilerTool"; @@ -1520,7 +1550,8 @@ void cmLocalVisualStudio7Generator fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n"); fileOptions.OutputFlagMap(fout, "\t\t\t\t\t"); fileOptions.OutputPreprocessorDefinitions(fout, - "\t\t\t\t\t", "\n"); + "\t\t\t\t\t", "\n", + lang); } if(!fc.AdditionalDeps.empty()) { diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 049a338..1e9a670 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -26,6 +26,12 @@ cmMakefileLibraryTargetGenerator ::cmMakefileLibraryTargetGenerator(cmTarget* target): cmMakefileTargetGenerator(target) { + if(this->Target->IsCFBundleOnApple()) + { + target->SetProperty("PREFIX", ""); + target->SetProperty("SUFFIX", ""); + } + this->CustomCommandDriver = OnDepends; this->Target->GetLibraryNames( this->TargetNameOut, this->TargetNameSO, this->TargetNameReal, @@ -41,6 +47,20 @@ cmMakefileLibraryTargetGenerator this->MacContentDirectory += this->FrameworkVersion; this->MacContentDirectory += "/"; } + else if(this->Target->IsCFBundleOnApple()) + { + this->MacContentDirectory = this->Target->GetDirectory(this->ConfigName); + this->MacContentDirectory += "/"; + this->MacContentDirectory += this->TargetNameOut; + this->MacContentDirectory += "."; + const char *ext = this->Target->GetProperty("BUNDLE_EXTENSION"); + if (!ext) + { + ext = "bundle"; + } + this->MacContentDirectory += ext; + this->MacContentDirectory += "/Contents/"; + } } //---------------------------------------------------------------------------- @@ -301,6 +321,27 @@ cmMakefileLibraryTargetGenerator } //---------------------------------------------------------------------------- +void +cmMakefileLibraryTargetGenerator::CreateCFBundle(std::string& targetName, + std::string& outpath) +{ + // Compute bundle directory names. + outpath = this->MacContentDirectory; + outpath += "MacOS"; + cmSystemTools::MakeDirectory(outpath.c_str()); + this->Makefile->AddCMakeOutputFile(outpath.c_str()); + outpath += "/"; + + // Configure the Info.plist file. Note that it needs the executable name + // to be set. + std::string plist = this->MacContentDirectory + "Info.plist"; + this->LocalGenerator->GenerateAppleInfoPList(this->Target, + targetName.c_str(), + plist.c_str()); + this->Makefile->AddCMakeOutputFile(plist.c_str()); +} + +//---------------------------------------------------------------------------- void cmMakefileLibraryTargetGenerator::WriteLibraryRules (const char* linkRuleVar, const char* extraFlags, bool relink) { @@ -354,6 +395,12 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules outpath = this->MacContentDirectory; this->CreateFramework(targetName); } + else if(this->Target->IsCFBundleOnApple()) + { + outpath = this->Target->GetDirectory(this->ConfigName); + outpath += "/"; + this->CreateCFBundle(targetName, outpath); + } else if(relink) { outpath = this->Makefile->GetStartOutputDirectory(); @@ -417,6 +464,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules buildEcho += " shared library "; break; case cmTarget::MODULE_LIBRARY: + if (this->Target->IsCFBundleOnApple()) + buildEcho += " CFBundle"; buildEcho += " shared module "; break; default: diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h index 2f085ad..f3c47db 100644 --- a/Source/cmMakefileLibraryTargetGenerator.h +++ b/Source/cmMakefileLibraryTargetGenerator.h @@ -33,6 +33,7 @@ protected: // MacOSX Framework support methods void WriteFrameworkRules(bool relink); void CreateFramework(std::string const& targetName); + void CreateCFBundle(std::string& targetName, std::string& outpath); // Store the computd framework version for OS X Frameworks. std::string FrameworkVersion; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index ed1da7b..42d3f06 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -482,17 +482,21 @@ void cmSourceFile::DefineProperties(cmake *cm) cm->DefineProperty ("MACOSX_PACKAGE_LOCATION", cmProperty::SOURCE_FILE, - "Place a source file inside a Mac OS X bundle or framework.", + "Place a source file inside a Mac OS X bundle, CFBundle, or framework.", "Executable targets with the MACOSX_BUNDLE property set are built " "as Mac OS X application bundles on Apple platforms. " "Shared library targets with the FRAMEWORK property set are built " "as Mac OS X frameworks on Apple platforms. " + "Module library targets with the BUNDLE property set are built " + "as Mac OS X CFBundle bundles on Apple platforms. " "Source files listed in the target with this property set will " "be copied to a directory inside the bundle or framework content " "folder specified by the property value. " "For bundles the content folder is \"<name>.app/Contents\". " "For frameworks the content folder is " "\"<name>.framework/Versions/<version>\". " + "For cfbundles the content folder is " + "\"<name>.bundle/Contents\" (unless the extension is changed). " "See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target " "properties for specifying files meant for Headers, PrivateHeaders, " "or Resources directories."); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 72efce3..75ff712 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -188,6 +188,22 @@ void cmTarget::DefineProperties(cmake *cm) "the target is built."); cm->DefineProperty + ("BUNDLE", cmProperty::TARGET, + "This target is a CFBundle on the Mac.", + "If a module library target has this property set to true it will " + "be built as a CFBundle when built on the mac. It will have the " + "directory structure required for a CFBundle and will be suitable " + "to be used for creating Browser Plugins or other application " + "resources."); + + cm->DefineProperty + ("BUNDLE_EXTENSION", cmProperty::TARGET, + "The file extension used to name a BUNDLE target on the Mac.", + "The default value is \"bundle\" - you can also use \"plugin\" or " + "whatever file extension is required by the host app for your " + "bundle."); + + cm->DefineProperty ("FRAMEWORK", cmProperty::TARGET, "This target is a framework on the Mac.", "If a shared library target has this property set to true it will " @@ -1211,6 +1227,14 @@ bool cmTarget::IsAppBundleOnApple() } //---------------------------------------------------------------------------- +bool cmTarget::IsCFBundleOnApple() +{ + return (this->GetType() == cmTarget::MODULE_LIBRARY && + this->Makefile->IsOn("APPLE") && + this->GetPropertyAsBool("BUNDLE")); +} + +//---------------------------------------------------------------------------- class cmTargetTraceDependencies { public: diff --git a/Source/cmTarget.h b/Source/cmTarget.h index f2b7d61..b0e20ba 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -430,6 +430,9 @@ public: Apple. */ bool IsFrameworkOnApple(); + /** Return whether this target is a CFBundle (plugin) on Apple. */ + bool IsCFBundleOnApple(); + /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple(); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 2d55e1e..4cb745e 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -717,6 +717,10 @@ void cmVisualStudio10TargetGenerator::WriteCLSources() // is ended on a new line this->WriteString("</ClCompile>\n", 2); } + else if(!header && rc && this->OutputSourceSpecificFlags(*source)) + { + this->WriteString("</ResourceCompile>\n", 2); + } else { (*this->BuildFileStream ) << " />\n"; @@ -853,8 +857,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); clOptions.OutputFlagMap(*this->BuildFileStream, " "); clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, - " ", "\n"); - + " ", "\n", lang); } } return hasFlags; @@ -1120,7 +1123,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( } clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ", - "\n"); + "\n", "CXX"); this->WriteString("<AssemblerListingLocation>", 3); *this->BuildFileStream << configName << "</AssemblerListingLocation>\n"; @@ -1155,7 +1158,7 @@ WriteRCOptions(std::string const& configName, this->WriteString("<ResourceCompile>\n", 2); Options& clOptions = *(this->ClOptions[configName]); clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ", - "\n"); + "\n", "RC"); this->OutputIncludes(includes); this->WriteString("</ResourceCompile>\n", 2); } diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 9acae0d..ed0d60c 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -204,7 +204,8 @@ void cmVisualStudioGeneratorOptions ::OutputPreprocessorDefinitions(std::ostream& fout, const char* prefix, - const char* suffix) + const char* suffix, + const char* lang) { if(this->Defines.empty()) { @@ -251,6 +252,11 @@ cmVisualStudioGeneratorOptions if(this->Version == 10) { define = cmVisualStudio10GeneratorOptionsEscapeForXML(define.c_str()); + + if(0 == strcmp(lang, "RC")) + { + cmSystemTools::ReplaceString(define, "\"", "\\\""); + } } else { diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h index 8619ba0..fadc4b5 100644 --- a/Source/cmVisualStudioGeneratorOptions.h +++ b/Source/cmVisualStudioGeneratorOptions.h @@ -54,7 +54,8 @@ public: // Write options to output. void OutputPreprocessorDefinitions(std::ostream& fout, const char* prefix, - const char* suffix); + const char* suffix, + const char* lang); void OutputFlagMap(std::ostream& fout, const char* indent); void OutputAdditionalOptions(std::ostream& fout, const char* prefix, diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bab0aaf..0c03b65 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -979,37 +979,39 @@ void CMakeCommandUsage(const char* program) errorStream << "Usage: " << program << " -E [command] [arguments ...]\n" << "Available commands: \n" + << " build build_dir - build the project in build_dir.\n" << " chdir dir cmd [args]... - run command in a given directory\n" - << " rename oldname newname - rename a file or directory " - "(on one volume)\n" + << " compare_files file1 file2 - check if file1 is same as file2\n" << " copy file destination - copy file to destination (either file " "or directory)\n" - << " copy_if_different in-file out-file - copy file if input has " - "changed\n" << " copy_directory source destination - copy directory 'source' " "content to directory 'destination'\n" - << " compare_files file1 file2 - check if file1 is same as file2\n" + << " copy_if_different in-file out-file - copy file if input has " + "changed\n" << " echo [string]... - displays arguments as text\n" << " echo_append [string]... - displays arguments as text but no new " "line\n" << " environment - display the current environment\n" << " make_directory dir - create a directory\n" << " md5sum file1 [...] - compute md5sum of files\n" - << " remove_directory dir - remove a directory and its contents\n" << " remove [-f] file1 file2 ... - remove the file(s), use -f to force " "it\n" + << " remove_directory dir - remove a directory and its contents\n" + << " rename oldname newname - rename a file or directory " + "(on one volume)\n" << " tar [cxt][vfz][cvfj] file.tar " "file/dir1 file/dir2 ... - create a tar " "archive\n" << " time command [args] ... - run command and return elapsed time\n" << " touch file - touch a file.\n" << " touch_nocreate file - touch a file but do not create it.\n" - << " build build_dir - build the project in build_dir.\n" #if defined(_WIN32) && !defined(__CYGWIN__) - << " write_regv key value - write registry value\n" - << " delete_regv key - delete registry value\n" + << "Available on Windows only:\n" << " comspec - on windows 9x use this for RunCommand\n" + << " delete_regv key - delete registry value\n" + << " write_regv key value - write registry value\n" #else + << "Available on UNIX only:\n" << " create_symlink old new - create a symbolic link new -> old\n" #endif ; @@ -1984,8 +1986,32 @@ int cmake::Configure() } +bool cmake::RejectUnsupportedPaths(const char* desc, std::string const& path) +{ + // Some characters are not well-supported by native build systems. + std::string::size_type pos = path.find_first_of("="); + if(pos == std::string::npos) + { + return false; + } + cmOStringStream e; + e << "The path to the " << desc << " directory:\n" + << " " << path << "\n" + << "contains unsupported character '" << path[pos] << "'.\n" + << "Please use a different " << desc << " directory name."; + cmListFileBacktrace bt; + this->IssueMessage(cmake::FATAL_ERROR, e.str(), bt); + return true; +} + int cmake::ActualConfigure() { + if(this->RejectUnsupportedPaths("source", this->cmHomeDirectory) || + this->RejectUnsupportedPaths("binary", this->HomeOutputDirectory)) + { + return 1; + } + // Construct right now our path conversion table before it's too late: this->UpdateConversionPathTable(); this->CleanupCommandsAndMacros(); diff --git a/Source/cmake.h b/Source/cmake.h index 1bb42d3..70fcaa8 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -451,6 +451,8 @@ protected: ///! Find the full path to one of the cmake programs like ctest, cpack, etc. std::string FindCMakeProgram(const char* name) const; + + bool RejectUnsupportedPaths(const char* desc, std::string const& path); private: cmake(const cmake&); // Not implemented. void operator=(const cmake&); // Not implemented. diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index a51673c..a5dca18 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -71,11 +71,13 @@ static const char * cmDocumentationOptions[][3] = {"-E", "CMake command mode.", "For true platform independence, CMake provides a list of commands " "that can be used on all systems. Run with -E help for the usage " - "information. Commands available are: chdir, copy, copy_if_different " - "copy_directory, compare_files, echo, echo_append, environment, " - "make_directory, md5sum, remove_directory, remove, tar, time, " - "touch, touch_nocreate, write_regv, delete_regv, comspec, " - "create_symlink."}, + "information. Commands available are: build, chdir, compare_files, copy, " + "copy_directory, copy_if_different, echo, echo_append, environment, " + "make_directory, md5sum, remove, remove_directory, rename, tar, time, " + "touch, touch_nocreate. In addition, some platform specific commands " + "are available. " + "On Windows: comspec, delete_regv, write_regv. " + "On UNIX: create_symlink."}, {"-i", "Run in wizard mode.", "Wizard mode runs cmake interactively without a GUI. The user is " "prompted to answer questions about the project configuration. " diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 96da856..8d4ad8b 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 01) +SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 28) +SET(KWSYS_DATE_STAMP_DAY 22) diff --git a/Tests/BundleTest/BundleLib.cxx b/Tests/BundleTest/BundleLib.cxx index bab745e..b68ee25 100644 --- a/Tests/BundleTest/BundleLib.cxx +++ b/Tests/BundleTest/BundleLib.cxx @@ -3,7 +3,7 @@ #include <stdlib.h> #include <unistd.h> -#include <Carbon/Carbon.h> +#include <CoreFoundation/CoreFoundation.h> int fileExists(char* filename) { @@ -51,7 +51,7 @@ int findBundleFile(char* exec, const char* file) int foo(char *exec) { - // Call a "Carbon" function... + // Call a CoreFoundation function... // CFBundleRef br = CFBundleGetMainBundle(); (void) br; diff --git a/Tests/BundleTest/BundleTest.cxx b/Tests/BundleTest/BundleTest.cxx index 29d17db..a66d601 100644 --- a/Tests/BundleTest/BundleTest.cxx +++ b/Tests/BundleTest/BundleTest.cxx @@ -1,6 +1,6 @@ #include <stdio.h> -#include <Carbon/Carbon.h> +#include <CoreFoundation/CoreFoundation.h> extern int foo(char* exec); @@ -8,8 +8,8 @@ int main(int argc, char* argv[]) { printf("Started with: %d arguments\n", argc); - // Call a "Carbon" function... but pull in the link dependency on "-framework - // Carbon" via CMake's dependency chaining mechanism. This code exists to + // Call a CoreFoundation function... but pull in the link dependency on "-framework + // CoreFoundation" via CMake's dependency chaining mechanism. This code exists to // verify that the chaining mechanism works with "-framework blah" style // link dependencies. // diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt index 5ccf2bf..5342f49 100644 --- a/Tests/BundleTest/CMakeLists.txt +++ b/Tests/BundleTest/CMakeLists.txt @@ -25,14 +25,14 @@ SET_SOURCE_FILES_PROPERTIES( SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar") # Test building a bundle linking to a shared library where the -# shared library links to Carbon, but the executable does not -# explicitly link to Carbon, but the executable does *depend* -# on Carbon. There should be a link failure for the executable +# shared library links to CoreFoundation, but the executable does not +# explicitly link to CoreFoundation, but the executable does *depend* +# on CoreFoundation. There should be a link failure for the executable # if CMake's dependency chaining for libraries with "-framework # blah" style dependencies gets broken... # ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx) -TARGET_LINK_LIBRARIES(BundleTestLib "-framework Carbon") +TARGET_LINK_LIBRARIES(BundleTestLib "-framework CoreFoundation") ADD_EXECUTABLE(BundleTest MACOSX_BUNDLE @@ -43,8 +43,8 @@ ADD_EXECUTABLE(BundleTest ) TARGET_LINK_LIBRARIES(BundleTest BundleTestLib) # -# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework Carbon") -# (see above comments about Carbon) +# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework CoreFoundation") +# (see above comments about CoreFoundation) # # Test bundle installation. diff --git a/Tests/CFBundleTest/CMakeLists.txt b/Tests/CFBundleTest/CMakeLists.txt new file mode 100644 index 0000000..8fd9efd --- /dev/null +++ b/Tests/CFBundleTest/CMakeLists.txt @@ -0,0 +1,56 @@ +#this is adapted from FireBreath (http://www.firebreath.org) + +cmake_minimum_required(VERSION 2.8) + +project(CFBundleTest) + +include(PluginConfig.cmake) + +message ("Creating Mac Browser Plugin project ${PROJECT_NAME}") +set(SOURCES + np_macmain.cpp + Localized.r + ${CMAKE_CURRENT_BINARY_DIR}/Info.plist + ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings + ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc +) + +add_library( ${PROJECT_NAME} MODULE + ${SOURCES} + ) + +set (RCFILES ${CMAKE_CURRENT_SOURCE_DIR}/Localized.r) + +configure_file(Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) +configure_file(InfoPlist.strings.in ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings) + +# Compile the resource file +find_program(RC_COMPILER Rez NO_DEFAULT_PATHS PATHS /Developer/Tools) +if(NOT RC_COMPILER) + message(FATAL_ERROR "could not find Rez to build resources from .r file...") +endif() + +execute_process(COMMAND + ${RC_COMPILER} ${RCFILES} -useDF -o ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc + ) + +set_source_files_properties( + ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc + PROPERTIES GENERATED 1 + ) +# note that for some reason, the makefile and xcode generators use a different +# property to indicate where the Info.plist file is :-/ For that reason, we +# specify it twice so it will work both places +set_target_properties(CFBundleTest PROPERTIES + BUNDLE 1 + BUNDLE_EXTENSION plugin + XCODE_ATTRIBUTE_WRAPPER_EXTENSION plugin #sets the extension to .plugin + XCODE_ATTRIBUTE_MACH_O_TYPE mh_bundle + XCODE_ATTRIBUTE_INFOPLIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/Info.plist + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist + LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_SOURCE_DIR}/ExportList_plugin.txt\"") + +set_source_files_properties( + ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings + ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc + PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/English.lproj") diff --git a/Tests/CFBundleTest/ExportList_plugin.txt b/Tests/CFBundleTest/ExportList_plugin.txt new file mode 100644 index 0000000..31d6f64 --- /dev/null +++ b/Tests/CFBundleTest/ExportList_plugin.txt @@ -0,0 +1,3 @@ +_NP_GetEntryPoints +_NP_Initialize +_NP_Shutdown diff --git a/Tests/CFBundleTest/Info.plist.in b/Tests/CFBundleTest/Info.plist.in new file mode 100644 index 0000000..638002f --- /dev/null +++ b/Tests/CFBundleTest/Info.plist.in @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>${PLUGIN_NAME}</string> + <key>CFBundleGetInfoString</key> + <string>${PLUGIN_NAME} ${FBSTRING_PLUGIN_VERSION}, ${FBSTRING_LegalCopyright}</string> + <key>CFBundleIdentifier</key> + <string>com.${ACTIVEX_PROGID}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>BRPL</string> + <key>CFBundleShortVersionString</key> + <string>${PLUGIN_NAME} ${FBSTRING_PLUGIN_VERSION}</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>${FBSTRING_PLUGIN_VERSION}</string> + <key>CFPlugInDynamicRegisterFunction</key> + <string></string> + <key>CFPlugInDynamicRegistration</key> + <string>NO</string> + <key>CFPlugInFactories</key> + <dict> + <key>00000000-0000-0000-0000-000000000000</key> + <string>MyFactoryFunction</string> + </dict> + <key>CFPlugInTypes</key> + <dict> + <key>00000000-0000-0000-0000-000000000000</key> + <array> + <string>00000000-0000-0000-0000-000000000000</string> + </array> + </dict> + <key>CFPlugInUnloadFunction</key> + <string></string> + <key>WebPluginName</key> + <string>${FBSTRING_ProductName}</string> + <key>WebPluginDescription</key> + <string>${FBSTRING_FileDescription}</string> + <key>WebPluginMIMETypes</key> + <dict> + <key>${FBSTRING_MIMEType}</key> + <dict> + <key>WebPluginTypeDescription</key> + <string>${FBSTRING_FileDescription}</string> + </dict> + </dict> +</dict> +</plist> diff --git a/Tests/CFBundleTest/InfoPlist.strings.in b/Tests/CFBundleTest/InfoPlist.strings.in new file mode 100644 index 0000000..790ead0 --- /dev/null +++ b/Tests/CFBundleTest/InfoPlist.strings.in @@ -0,0 +1,4 @@ +/* Localized versions of Info.plist keys */ + +CFBundleName = "${PLUGIN_NAME}.plugin"; +NSHumanReadableCopyright = "${FBSTRING_LegalCopyright}"; diff --git a/Tests/CFBundleTest/Localized.r b/Tests/CFBundleTest/Localized.r new file mode 100644 index 0000000..e988e26 --- /dev/null +++ b/Tests/CFBundleTest/Localized.r @@ -0,0 +1,18 @@ +#include <CoreServices/CoreServices.r> + +resource 'STR#' (126) +{ { + "${FBSTRING_LegalCopyright}", + "${FBSTRING_ProductName}" +} }; + +resource 'STR#' (127) +{ { + "${FBSTRING_FileDescription}" +} }; + +resource 'STR#' (128) +{ { + "${FBSTRING_MIMEType}", + "${FBSTRING_FileExtents}" +} }; diff --git a/Tests/CFBundleTest/Localized.rsrc b/Tests/CFBundleTest/Localized.rsrc Binary files differnew file mode 100644 index 0000000..cbf3523 --- /dev/null +++ b/Tests/CFBundleTest/Localized.rsrc diff --git a/Tests/CFBundleTest/PluginConfig.cmake b/Tests/CFBundleTest/PluginConfig.cmake new file mode 100644 index 0000000..763ddcc --- /dev/null +++ b/Tests/CFBundleTest/PluginConfig.cmake @@ -0,0 +1,21 @@ +#/**********************************************************\ +# Auto-Generated Plugin Configuration file +# for CFTestPlugin +#\**********************************************************/ + +set(PLUGIN_NAME "CFTestPlugin") +set(PLUGIN_PREFIX "CFTP") +set(COMPANY_NAME "FBDevTeam") + +set(MOZILLA_PLUGINID "@firebreath.googlecode.com/CFTestPlugin") + +# strings +set(FBSTRING_CompanyName "Firebreath Dev Team") +set(FBSTRING_FileDescription "CFBundle Test Plugin - Plugin for testing cmake patch to improve FireBreath project generation") +set(FBSTRING_PLUGIN_VERSION "1.0.0") +set(FBSTRING_LegalCopyright "Copyright 2010 Firebreath Dev Team") +set(FBSTRING_PluginFileName "np${PLUGIN_NAME}.dll") +set(FBSTRING_ProductName "CFTestPlugin") +set(FBSTRING_FileExtents "") +set(FBSTRING_PluginName "CFTestPlugin") +set(FBSTRING_MIMEType "application/x-fbtestplugin") diff --git a/Tests/CFBundleTest/README.txt b/Tests/CFBundleTest/README.txt new file mode 100644 index 0000000..248651b --- /dev/null +++ b/Tests/CFBundleTest/README.txt @@ -0,0 +1,16 @@ + +CFBundle test project. The generated .plugin/ bundle from either makefiles or XCode should look like this: + +./Contents +./Contents/Info.plist +./Contents/MacOS +./Contents/MacOS/CFBundleTest +./Contents/Resources +./Contents/Resources/English.lproj +./Contents/Resources/English.lproj/InfoPlist.strings +./Contents/Resources/English.lproj/Localized.rsrc + +file Contents/MacOS/CFBundleTest should return something like: +Contents/MacOS/CFBundleTest: Mach-O 64-bit bundle x86_64 + +It is okay if it is a 32 bit binary; if it is not Mach-O, or is spelled differently, it is not okay. diff --git a/Tests/CFBundleTest/VerifyResult.cmake b/Tests/CFBundleTest/VerifyResult.cmake new file mode 100644 index 0000000..e622900 --- /dev/null +++ b/Tests/CFBundleTest/VerifyResult.cmake @@ -0,0 +1,32 @@ +if(NOT DEFINED CTEST_CONFIGURATION_TYPE) + message(FATAL_ERROR "expected variable CTEST_CONFIGURATION_TYPE not defined") +endif() + +if(NOT DEFINED dir) + message(FATAL_ERROR "expected variable dir not defined") +endif() + +if(NOT DEFINED gen) + message(FATAL_ERROR "expected variable gen not defined") +endif() + +message(STATUS "CTEST_CONFIGURATION_TYPE='${CTEST_CONFIGURATION_TYPE}'") +message(STATUS "dir='${dir}'") +message(STATUS "gen='${gen}'") + +if(gen MATCHES "Make" OR + "${CTEST_CONFIGURATION_TYPE}" STREQUAL "" OR + "${CTEST_CONFIGURATION_TYPE}" STREQUAL "." OR + "${CTEST_CONFIGURATION_TYPE}" STREQUAL "NoConfig") + set(expected_filename "${dir}/CFBundleTest.plugin/Contents/MacOS/CFBundleTest") +else() + set(expected_filename "${dir}/${CTEST_CONFIGURATION_TYPE}/CFBundleTest.plugin/Contents/MacOS/CFBundleTest") +endif() + +if(NOT EXISTS "${expected_filename}") + message(FATAL_ERROR "test fails: expected output file does not exist [${expected_filename}]") +endif() + +file(COPY "${expected_filename}" + DESTINATION "${dir}/LatestBuildResult" + ) diff --git a/Tests/CFBundleTest/np_macmain.cpp b/Tests/CFBundleTest/np_macmain.cpp new file mode 100644 index 0000000..78004d0 --- /dev/null +++ b/Tests/CFBundleTest/np_macmain.cpp @@ -0,0 +1,49 @@ +/***********************************************************\ + Written by: Richard Bateman (taxilian) + + Based on the default np_macmain.cpp from FireBreath + http://firebreath.googlecode.com + + This file has been stripped to prevent it from accidently + doing anything useful. +\***********************************************************/ + + +#include <stdio.h> + +typedef void (*NPP_ShutdownProcPtr)(void); +typedef short NPError; + +#pragma GCC visibility push(default) + +struct NPNetscapeFuncs; +struct NPPluginFuncs; + +extern "C" { + NPError NP_Initialize(NPNetscapeFuncs *browserFuncs); + NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs); + NPError NP_Shutdown(void); +} + +#pragma GCC visibility pop + +void initPluginModule() +{ +} + +NPError NP_GetEntryPoints(NPPluginFuncs* pFuncs) +{ + printf("NP_GetEntryPoints()\n"); + return 0; +} + +NPError NP_Initialize(NPNetscapeFuncs* pFuncs) +{ + printf("NP_Initialize()\n"); + return 0; +} + +NPError NP_Shutdown() +{ + return 0; +} diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 959413d..4d4764f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -138,8 +138,8 @@ IF(BUILD_TESTING) SET(TEST_RESOURCES TRUE) ENDIF() # for borland and watcom there is no resource support - IF(("${CMAKE_TEST_GENERATOR}" MATCHES "WMake") OR - ("${CMAKE_TEST_GENERATOR}" MATCHES "Borland")) + IF("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR + "${CMAKE_TEST_GENERATOR}" MATCHES "Borland") SET(TEST_RESOURCES FALSE) ENDIF() IF(TEST_RESOURCES) @@ -563,30 +563,40 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ IF(CTEST_RUN_CPackComponentsForAll) set(CPackComponentsForAll_EXTRA_OPTIONS) - - set(CPackRun_CPackGen "-DCPackGen=ZIP") set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}") - set(CPackRun_CPackComponentWay "-DCPackComponentWay=default") - - ADD_TEST(CPackComponentsForAll-ZIP-default ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll" - "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-project CPackComponentsForAll - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-options - -DCPACK_BINARY_ZIP:BOOL=ON - ${CPackComponentsForAll_EXTRA_OPTIONS} - --graphviz=CPackComponentsForAll.dot - --test-command ${CMAKE_CMAKE_COMMAND} - "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent" - "${CPackRun_CPackCommand}" - "${CPackRun_CPackGen}" - "${CPackRun_CPackComponentWay}" - -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") - - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll") + # set up list of CPack generators + list(APPEND GENLST "ZIP") + # set up list of component packaging ways + list(APPEND CWAYLST "default") + list(APPEND CWAYLST "OnePackPerGroup") + list(APPEND CWAYLST "IgnoreGroup") + list(APPEND CWAYLST "AllInOne") + list(APPEND CWAYLST "AllGroupsInOne") + foreach(CPackGen ${GENLST}) + set(CPackRun_CPackGen "-DCPackGen=${CPackGen}") + foreach(CPackComponentWay ${CWAYLST}) + set(CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}") + ADD_TEST(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll" + "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" + --build-generator ${CMAKE_TEST_GENERATOR} + --build-project CPackComponentsForAll + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-options + -DCPACK_BINARY_${CPackGen}:BOOL=ON + ${CPackRun_CPackComponentWay} + ${CPackComponentsForAll_EXTRA_OPTIONS} + --graphviz=CPackComponentsForAll.dot + --test-command ${CMAKE_CMAKE_COMMAND} + "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" + "${CPackRun_CPackCommand}" + "${CPackRun_CPackGen}" + "${CPackRun_CPackComponentWay}" + -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") + LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}") + endforeach(CPackComponentWay) + endforeach(CPackGen) ENDIF(CTEST_RUN_CPackComponentsForAll) # By default, turn this test off (because it takes a long time...) @@ -805,11 +815,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CTEST_COMMAND} -V ) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject") - # The ExternalProject test takes 900 seconds on some machines! - GET_TEST_PROPERTY(ExternalProject TIMEOUT PREVIOUS_TIMEOUT) - IF("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - SET_TESTS_PROPERTIES(ExternalProject PROPERTIES TIMEOUT 1000) - ENDIF("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + SET_TESTS_PROPERTIES(ExternalProject PROPERTIES + TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) # do each of the tutorial steps FOREACH(STP RANGE 1 7) @@ -1134,6 +1141,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest") + ADD_TEST(CFBundleTest ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CFBundleTest" + "${CMake_BINARY_DIR}/Tests/CFBundleTest" + --build-two-config + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project CFBundleTest + --test-command + ${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=\${CTEST_CONFIGURATION_TYPE} + -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest + -Dgen=${CMAKE_TEST_GENERATOR} + -P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake) + LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") + ADD_TEST_MACRO(ObjC++ ObjC++) ENDIF (APPLE AND CMAKE_COMPILER_IS_GNUCXX) diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index 971b2dc..bcec509 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -107,14 +107,14 @@ set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full) # We may use the CPack specific config file in order -# to tailor CPack behavio on a CPack generator specific way +# to tailor CPack behavior on a CPack generator specific way # (Behavior would be different for RPM or TGZ or DEB ...) -if (USE_CPACK_PROJECT_CONFIG) +if (NOT ("${CPackComponentWay}" STREQUAL "default")) # Setup project specific CPack-time CPack Config file. - configure_file(${MyLib_SOURCE_DIR}/MyLibCPackConfig.cmake.in - ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake + configure_file(${CPackComponentsForAll_SOURCE_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake.in + ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake @ONLY) - set(CPACK_PROJECT_CONFIG_FILE ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake) -endif (USE_CPACK_PROJECT_CONFIG) + set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake) +endif (NOT ("${CPackComponentWay}" STREQUAL "default")) # Include CPack to introduce the appropriate targets include(CPack)
\ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in new file mode 100644 index 0000000..3a7119e --- /dev/null +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in @@ -0,0 +1,18 @@ +# +# Activate component packaging +# +if(CPACK_GENERATOR MATCHES "ZIP") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "ZIP") + +if(CPACK_GENERATOR MATCHES "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "RPM") + +# +# Choose grouping way +# +set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE 1) +#set(CPACK_COMPONENTS_GROUPING) +#set(CPACK_COMPONENTS_IGNORE_GROUPS 1) +#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in new file mode 100644 index 0000000..9a40293 --- /dev/null +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in @@ -0,0 +1,18 @@ +# +# Activate component packaging +# +if(CPACK_GENERATOR MATCHES "ZIP") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "ZIP") + +if(CPACK_GENERATOR MATCHES "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "RPM") + +# +# Choose grouping way +# +#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE 1) +#set(CPACK_COMPONENTS_GROUPING) +#set(CPACK_COMPONENTS_IGNORE_GROUPS 1) +set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in new file mode 100644 index 0000000..92a97a5 --- /dev/null +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -0,0 +1,18 @@ +# +# Activate component packaging +# +if(CPACK_GENERATOR MATCHES "ZIP") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "ZIP") + +if(CPACK_GENERATOR MATCHES "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "RPM") + +# +# Choose grouping way +# +#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE) +#set(CPACK_COMPONENTS_GROUPING) +set(CPACK_COMPONENTS_IGNORE_GROUPS 1) +#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
\ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in new file mode 100644 index 0000000..4180891 --- /dev/null +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in @@ -0,0 +1,18 @@ +# +# Activate component packaging +# +if(CPACK_GENERATOR MATCHES "ZIP") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "ZIP") + +if(CPACK_GENERATOR MATCHES "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "RPM") + +# +# Choose grouping way +# +#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE) +#set(CPACK_COMPONENTS_GROUPING) +#set(CPACK_COMPONENTS_IGNORE_GROUPS) +#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE)
\ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in deleted file mode 100644 index 7ffafae..0000000 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in +++ /dev/null @@ -1,7 +0,0 @@ -if(CPACK_GENERATOR MATCHES "ZIP") -# set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) -endif(CPACK_GENERATOR MATCHES "ZIP") - -if(CPACK_GENERATOR MATCHES "TGZ") - set(CPACK_MONOLITHIC_INSTALL 1) -endif(CPACK_GENERATOR MATCHES "TGZ") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 11f72ec..d5137bd 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -49,6 +49,18 @@ if(CPackGen MATCHES "ZIP") if (${CPackComponentWay} STREQUAL "default") set(expected_count 1) endif(${CPackComponentWay} STREQUAL "default") + if (${CPackComponentWay} STREQUAL "OnePackPerGroup") + set(expected_count 2) + endif (${CPackComponentWay} STREQUAL "OnePackPerGroup") + if (${CPackComponentWay} STREQUAL "IgnoreGroup") + set(expected_count 4) + endif (${CPackComponentWay} STREQUAL "IgnoreGroup") + if (${CPackComponentWay} STREQUAL "AllInOne") + set(expected_count 1) + endif (${CPackComponentWay} STREQUAL "AllInOne") + if (${CPackComponentWay} STREQUAL "AllGroupsInOne") + set(expected_count 1) + endif (${CPackComponentWay} STREQUAL "AllGroupsInOne") endif(CPackGen MATCHES "ZIP") # Now verify if the number of expected file is OK diff --git a/Tests/CTestTest2/test.cmake.in b/Tests/CTestTest2/test.cmake.in index f6ec198..b58b639 100644 --- a/Tests/CTestTest2/test.cmake.in +++ b/Tests/CTestTest2/test.cmake.in @@ -15,13 +15,12 @@ SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") -# for unix purify has to be used as a linker, and -# will not work with ctest. So disable it so -# that it is not attempted. -IF(UNIX) - IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify) - SET(CTEST_MEMORYCHECK_COMMAND) - ENDIF() + +# By default, CTESTTEST2_USE_PURIFY is not defined. If you want to run purify +# on CTestTest2, set CTESTTEST2_USE_PURIFY to ON in CMake's cache. +SET(CTESTTEST2_USE_PURIFY @CTESTTEST2_USE_PURIFY@) +IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify AND NOT CTESTTEST2_USE_PURIFY) + SET(CTEST_MEMORYCHECK_COMMAND) ENDIF() #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTest3/test.cmake.in b/Tests/CTestTest3/test.cmake.in deleted file mode 100644 index 1e8ea50..0000000 --- a/Tests/CTestTest3/test.cmake.in +++ /dev/null @@ -1,120 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) - -MACRO(PROJECT_START NAME) - MESSAGE("###################################################") - MESSAGE("") - MESSAGE("Start project: ${NAME}") - MESSAGE("") - MESSAGE("###################################################") -ENDMACRO(PROJECT_START) - -# Project 1 -PROJECT_START("KWSys from CVS") - -# Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest3") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest3-CVS") - -# --- -SET(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CVS/KWSys") -SET(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CVS/KWSysBin") -SET(CTEST_UPDATE_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") -# for unix purify has to be used as a linker, and -# will not work with ctest. So disable it so -# that it is not attempted. -IF(UNIX) - IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify) - SET(CTEST_MEMORYCHECK_COMMAND) - ENDIF() -ENDIF() -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") -SET(CTEST_CHECKOUT_COMMAND "\"${CTEST_UPDATE_COMMAND}\" -q -z3 \"-d:pserver:anoncvs@www.cmake.org:/cvsroot/KWSys\" co -r CTest-Testing-Tag KWSys") - -CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " -CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ -CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ -CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@ -CMAKE_CXX_COMPILER:STRING=@CMAKE_CXX_COMPILER@ -CMAKE_C_COMPILER_ARG1:STRING=@CMAKE_C_COMPILER_ARG1@ -CMAKE_CXX_COMPILER_ARG1:STRING=@CMAKE_CXX_COMPILER_ARG1@ - -# This one is needed for testing advanced ctest features -CTEST_TEST_KWSYS:BOOL=ON -") - -SET(CTEST_CUSTOM_WARNING_MATCH CommandLineArguments) - -CTEST_START(Nightly) -CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}") -CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5 SCHEDULE_RANDOM ON) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - -set(CTEST_DROP_METHOD "@protocol@") -set(CTEST_DROP_SITE "@server@") -set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") - -CTEST_SUBMIT(RETURN_VALUE res) - -#SET(svncommand "@SVNCOMMAND@") -set(svncommand FALSE) # turn this off until namic svn cmake is back -IF(svncommand) - # Project 2 - PROJECT_START("KWSys from SVN") - - # Settings: - SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest3") - SET(CTEST_SITE "@SITE@") - SET(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest3-SVN") - - # --- - SET(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/SVN/kwsys") - SET(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/SVN/kwsysBin") - SET(CTEST_UPDATE_COMMAND "@SVNCOMMAND@") - SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") - SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") - SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") - SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") - SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") - SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") - SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - SET(CTEST_CHECKOUT_COMMAND "\"${CTEST_UPDATE_COMMAND}\" co \"http://svn.na-mic.org:8000/svn/CMake/Source/kwsys/\" -r 500") - - CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - - FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " - CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ - CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ - CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@ - CMAKE_CXX_COMPILER:STRING=@CMAKE_CXX_COMPILER@ - CMAKE_C_COMPILER_ARG1:STRING=@CMAKE_C_COMPILER_ARG1@ - CMAKE_CXX_COMPILER_ARG1:STRING=@CMAKE_CXX_COMPILER_ARG1@ - - # This one is needed for testing advanced ctest features - CTEST_TEST_KWSYS:BOOL=ON - ") - - CTEST_START(Experimental) - CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) - CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5 SCHEDULE_RANDOM ON) - CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5) - CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - CTEST_SUBMIT(RETURN_VALUE res) - -ELSE(svncommand) - MESSAGE("Cannot find SVN command: ${svncommand}") -ENDIF(svncommand) diff --git a/Tests/CTestTestBadExe/test.cmake.in b/Tests/CTestTestBadExe/test.cmake.in index 743e835..5d22d35 100644 --- a/Tests/CTestTestBadExe/test.cmake.in +++ b/Tests/CTestTestBadExe/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadEx SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in index c3c41a5..8413544 100644 --- a/Tests/CTestTestChecksum/test.cmake.in +++ b/Tests/CTestTestChecksum/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParal SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in index ce4d60a..ca216e3 100644 --- a/Tests/CTestTestCostSerial/test.cmake.in +++ b/Tests/CTestTestCostSerial/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostS SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCrash/test.cmake.in b/Tests/CTestTestCrash/test.cmake.in index 259c8659..5cec594 100644 --- a/Tests/CTestTestCrash/test.cmake.in +++ b/Tests/CTestTestCrash/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCrash SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in index a17adca..201f604 100644 --- a/Tests/CTestTestCycle/test.cmake.in +++ b/Tests/CTestTestCycle/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in index ed4e182..36a1ebf 100644 --- a/Tests/CTestTestDepends/test.cmake.in +++ b/Tests/CTestTestDepends/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepen SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in index 9b581eb..b0e1632 100644 --- a/Tests/CTestTestFailedSubmits/test.cmake.in +++ b/Tests/CTestTestFailedSubmits/test.cmake.in @@ -22,9 +22,6 @@ SET(CTEST_BINARY_DIRECTORY "@build@") SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") @@ -39,7 +36,6 @@ CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" @ctest_coverage_labels_args@ RETURN_VALUE res) # ok to call ctest_submit - still avoids network activity because there is diff --git a/Tests/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in index b0bb039..7bc921a 100644 --- a/Tests/CTestTestFailure/testNoBuild.cmake.in +++ b/Tests/CTestTestFailure/testNoBuild.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailu SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in index 69d4f84..59c18d7 100644 --- a/Tests/CTestTestFailure/testNoExe.cmake.in +++ b/Tests/CTestTestFailure/testNoExe.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailu SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestParallel/test.cmake.in b/Tests/CTestTestParallel/test.cmake.in index 6ca15f6..83845de 100644 --- a/Tests/CTestTestParallel/test.cmake.in +++ b/Tests/CTestTestParallel/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParal SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in index 0f353b8..98c5901 100644 --- a/Tests/CTestTestResourceLock/test.cmake.in +++ b/Tests/CTestTestResourceLock/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResou SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in index 2a91829..505bd7c 100644 --- a/Tests/CTestTestScheduler/test.cmake.in +++ b/Tests/CTestTestScheduler/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSched SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in index 6a5534e..2d03686 100644 --- a/Tests/CTestTestStopTime/test.cmake.in +++ b/Tests/CTestTestStopTime/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopT SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestSubdir/test.cmake.in b/Tests/CTestTestSubdir/test.cmake.in index c8d4fda..f240473 100644 --- a/Tests/CTestTestSubdir/test.cmake.in +++ b/Tests/CTestTestSubdir/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSubdi SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in index 6ed11a4..8a8dc24 100644 --- a/Tests/CTestTestTimeout/test.cmake.in +++ b/Tests/CTestTestTimeout/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeo SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in index 0ff32a4..56bae9d 100644 --- a/Tests/CTestTestZeroTimeout/test.cmake.in +++ b/Tests/CTestTestZeroTimeout/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroT SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") SET(CTEST_TEST_TIMEOUT 2) diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt index 57cb712..36d32e4 100644 --- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt +++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt @@ -9,8 +9,8 @@ ADD_CUSTOM_COMMAND( ) SET_SOURCE_FILES_PROPERTIES( - "${TestWorkingDir_BINARY_DIR}/working.c" - "${TestWorkingDir_BINARY_DIR}/customTarget.c" + "${TestWorkingDir_BINARY_DIR}/customTarget.c" + "${TestWorkingDir_BINARY_DIR}/customTarget2.c" PROPERTIES GENERATED 1) ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c" @@ -23,3 +23,20 @@ ADD_CUSTOM_TARGET( ) ADD_DEPENDENCIES(working Custom) + +file(MAKE_DIRECTORY ${TestWorkingDir_BINARY_DIR}/work) +add_custom_command( + OUTPUT working2.c # Relative to build tree + COMMAND "${CMAKE_COMMAND}" -E copy ${TestWorkingDir_SOURCE_DIR}/working.c.in ../working2.c + DEPENDS ${TestWorkingDir_SOURCE_DIR}/working.c.in/ # trailing slash should be removed + WORKING_DIRECTORY work/ # Relative to build tree, trailing slash + ) +add_executable(working2 working2.c ${TestWorkingDir_BINARY_DIR}/customTarget2.c) + +add_custom_target( + Custom2 ALL + COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${TestWorkingDir_SOURCE_DIR}/customTarget.c ../customTarget2.c + WORKING_DIRECTORY work/ # Relative to build tree, trailing slash +) + +add_dependencies(working2 Custom2) diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt index e842955..5d7d14e 100644 --- a/Tests/VSResource/CMakeLists.txt +++ b/Tests/VSResource/CMakeLists.txt @@ -1,7 +1,37 @@ -cmake_minimum_required (VERSION 2.6) -project (VSResource) -add_definitions(/DCMAKE_RCDEFINE="test.txt") +cmake_minimum_required(VERSION 2.8.3.20110118) +project(VSResource) + string(REPLACE "/INCREMENTAL:YES" "" CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}") + +message(STATUS "CMAKE_RC_COMPILER='${CMAKE_RC_COMPILER}'") + +# Because of the following avoidance techniques required for windres and VS6, +# we recommend using a configured header file, and defining preprocessor +# symbols via #define code and including that header in the rc file. Using +# add_definitions is fine for simple definitions (with no spaces and no +# quoting), but requires avoidance or work-arounds beyond that... + +if(CMAKE_RC_COMPILER MATCHES windres) + # windres rc compiler does not properly define quoted /D values as strings + message(STATUS "CMAKE_RC_COMPILER MATCHES windres") + add_definitions(/DCMAKE_RCDEFINE=test.txt) + add_definitions(/DCMAKE_RCDEFINE_NO_QUOTED_STRINGS) +elseif(MSVC60) + # VS6 rc compiler does not deal well with spaces in a "/D" value, but it can + # handle the quoting + message(STATUS "MSVC60") + add_definitions(/DCMAKE_RCDEFINE="test.txt") +else() + # expected case -- rc compiler is "capable enough" + message(STATUS + "rc compiler handles quoted strings with spaces in values via /D") + set(TEXTFILE_FROM_SOURCE_DIR "textfile, spaces in name, from binary dir") + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test.txt + "${CMAKE_CURRENT_BINARY_DIR}/test with spaces.txt" @ONLY) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + add_definitions(/DCMAKE_RCDEFINE="test with spaces.txt") +endif() + add_executable(VSResource main.cpp test.rc) diff --git a/Tests/VSResource/main.cpp b/Tests/VSResource/main.cpp index 6f68df3..7ee0c74 100644 --- a/Tests/VSResource/main.cpp +++ b/Tests/VSResource/main.cpp @@ -1,10 +1,80 @@ #include <windows.h> +#include <stdio.h> -int main(int argc, char** argv) { - HRSRC hello = ::FindResource(0, "hello", "TEXT"); - if(hello) { - return 0; - } else { - return 1; - } +struct x +{ + const char *txt; +}; + +int main(int argc, char** argv) +{ + int ret = 1; + + fprintf(stdout, "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)\n"); + +#ifdef CMAKE_RCDEFINE + fprintf(stdout, "CMAKE_RCDEFINE defined\n"); +#endif + +#ifdef CMAKE_RCDEFINE_NO_QUOTED_STRINGS + // Expect CMAKE_RCDEFINE to preprocess to exactly test.txt + x test; + test.txt = "*exactly* test.txt"; + fprintf(stdout, "CMAKE_RCDEFINE_NO_QUOTED_STRINGS defined\n"); + fprintf(stdout, "CMAKE_RCDEFINE is %s, and is *not* a string constant\n", + CMAKE_RCDEFINE); +#else + // Expect CMAKE_RCDEFINE to be a string: + fprintf(stdout, "CMAKE_RCDEFINE='%s', and is a string constant\n", + CMAKE_RCDEFINE); +#endif + + HRSRC hello = ::FindResource(NULL, MAKEINTRESOURCE(1025), "TEXTFILE"); + if(hello) + { + fprintf(stdout, "FindResource worked\n"); + HGLOBAL hgbl = ::LoadResource(NULL, hello); + int datasize = (int) ::SizeofResource(NULL, hello); + if(hgbl && datasize>0) + { + fprintf(stdout, "LoadResource worked\n"); + fprintf(stdout, "SizeofResource returned datasize='%d'\n", datasize); + void *data = ::LockResource(hgbl); + if (data) + { + fprintf(stdout, "LockResource worked\n"); + char *str = (char *) malloc(datasize+4); + if (str) + { + memcpy(str, data, datasize); + str[datasize] = 'E'; + str[datasize+1] = 'O'; + str[datasize+2] = 'R'; + str[datasize+3] = 0; + fprintf(stdout, "str='%s'\n", str); + free(str); + + ret = 0; + +#ifdef CMAKE_RCDEFINE_NO_QUOTED_STRINGS + fprintf(stdout, "LoadString skipped\n"); +#else + char buf[256]; + if (::LoadString(NULL, 1026, buf, sizeof(buf)) > 0) + { + fprintf(stdout, "LoadString worked\n"); + fprintf(stdout, "buf='%s'\n", buf); + } + else + { + fprintf(stdout, "LoadString failed\n"); + ret = 1; + } +#endif + } + } + } + } + + return ret; } diff --git a/Tests/VSResource/test.rc b/Tests/VSResource/test.rc index 8aab8b7..4ce4b53 100644 --- a/Tests/VSResource/test.rc +++ b/Tests/VSResource/test.rc @@ -1,5 +1,17 @@ #ifdef CMAKE_RCDEFINE -hello TEXT DISCARDABLE CMAKE_RCDEFINE + +// This line can compile with either an unquoted or a quoted string +1025 TEXTFILE CMAKE_RCDEFINE + +#ifndef CMAKE_RCDEFINE_NO_QUOTED_STRINGS +// This block can only be compiled if CMAKE_RCDEFINE preprocesses +// to a double quoted string +STRINGTABLE +BEGIN + 1026 CMAKE_RCDEFINE +END +#endif + #else #error "resource compiler did not get defines from command line!" -#endif
\ No newline at end of file +#endif diff --git a/Tests/VSResource/test.txt b/Tests/VSResource/test.txt index 980a0d5..c27c68d 100644 --- a/Tests/VSResource/test.txt +++ b/Tests/VSResource/test.txt @@ -1 +1 @@ -Hello World! +Hello World! (@TEXTFILE_FROM_SOURCE_DIR@) diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index 6472ec5..08cda1e 100644 --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt @@ -274,7 +274,11 @@ LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) # # Find OpenSSL # -FIND_PACKAGE(OpenSSL) +IF(CMAKE_USE_OPENSSL) + FIND_PACKAGE(OpenSSL) +ELSE() + SET(OPENSSL_FOUND 0) +ENDIF() IF(OPENSSL_FOUND) INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) @@ -296,7 +300,11 @@ LA_CHECK_INCLUDE_FILE("sha256.h" HAVE_SHA256_H) # # Find MD5/RMD160/SHA library # -FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto) +IF(CMAKE_USE_OPENSSL) + FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto) +ELSE() + SET(CRYPTO_LIBRARY "") +ENDIF() IF(CRYPTO_LIBRARY) LIST(APPEND ADDITIONAL_LIBS ${CRYPTO_LIBRARY}) ELSE(CRYPTO_LIBRARY) diff --git a/Utilities/cmlibarchive/libarchive/archive_entry.c b/Utilities/cmlibarchive/libarchive/archive_entry.c index d75dde5..c304231 100644 --- a/Utilities/cmlibarchive/libarchive/archive_entry.c +++ b/Utilities/cmlibarchive/libarchive/archive_entry.c @@ -32,12 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4 #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef MAJOR_IN_MKDEV +#if MAJOR_IN_MKDEV #include <sys/mkdev.h> -#else -#ifdef MAJOR_IN_SYSMACROS +#define HAVE_MAJOR +#elif MAJOR_IN_SYSMACROS #include <sys/sysmacros.h> -#endif +#define HAVE_MAJOR #endif #ifdef HAVE_LIMITS_H #include <limits.h> @@ -75,6 +75,13 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4 #undef max #define max(a, b) ((a)>(b)?(a):(b)) +#if !defined(HAVE_MAJOR) && !defined(major) +/* Replacement for major/minor/makedev. */ +#define major(x) ((int)(0x00ff & ((x) >> 8))) +#define minor(x) ((int)(0xffff00ff & (x))) +#define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min))) +#endif + /* Play games to come up with a suitable makedev() definition. */ #ifdef __QNXNTO__ /* QNX. <sigh> */ diff --git a/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c b/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c index c35c7b3..28b8ff5 100644 --- a/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c +++ b/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c @@ -32,13 +32,6 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4 #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#ifdef MAJOR_IN_MKDEV -#include <sys/mkdev.h> -#else -#ifdef MAJOR_IN_SYSMACROS -#include <sys/sysmacros.h> -#endif -#endif #ifdef HAVE_LIMITS_H #include <limits.h> #endif diff --git a/Utilities/cmlibarchive/libarchive/archive_windows.h b/Utilities/cmlibarchive/libarchive/archive_windows.h index 17f5698..f85f3f0 100644 --- a/Utilities/cmlibarchive/libarchive/archive_windows.h +++ b/Utilities/cmlibarchive/libarchive/archive_windows.h @@ -94,11 +94,6 @@ #endif #endif -/* Replacement for major/minor/makedev. */ -#define major(x) ((int)(0x00ff & ((x) >> 8))) -#define minor(x) ((int)(0xffff00ff & (x))) -#define makedev(maj,min) ((0xff00 & ((maj)<<8))|(0xffff00ff & (min))) - /* Alias the Windows _function to the POSIX equivalent. */ #define access _access #define chdir __la_chdir @@ -666,9 +666,9 @@ if ${cmake_system_cygwin}; then cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import" fi -# Add Carbon framework on Darwin +# Add CoreFoundation framework on Darwin if ${cmake_system_darwin}; then - cmake_ld_flags="${LDFLAGS} -framework Carbon" + cmake_ld_flags="${LDFLAGS} -framework CoreFoundation" fi # Add BeOS toolkits... |