Commit Graph

19245 Commits

Author SHA1 Message Date
Brad King 32b7c72623 Merge branch 'cmake-platform-info-version' into msvc-compiler-info
Conflicts:
	Modules/CMakeTestCCompiler.cmake
	Modules/CMakeTestCXXCompiler.cmake
	Modules/Platform/Windows-cl.cmake
2012-08-30 09:45:17 -04:00
Brad King f3ddfef137 Modernize MSVC compiler information files
Remove the old-style "Windows-cl.cmake" and its helper "cl.cmake".  Load
the information through new-style "Platform/Windows-MSVC-<lang>.cmake"
files.  Factor information common to C and CXX into a helper file
"Platform/Windows-MSVC.cmake" loaded from the per-language files.
2012-08-30 09:42:49 -04:00
Brad King 485a940e4c VS: Simplify MSVC version reporting
Teach Windows-cl.cmake to use CMAKE_(C|CXX)_COMPILER_VERSION to set the
"MSVC##" and MSVC_VERSION variables.  It no longer needs the IDE generator
to dictate the version or to detect the version by running the
command-line tool for NMake and Ninja generators.  Drop configuration of
CMakeCPlatform.cmake and CMakeCXXPlatform.cmake from Windows-cl.cmake.in
because all the results it saved are now cheap to compute every time.
2012-08-30 09:42:40 -04:00
Brad King 3df81b4912 Move CMAKE_<LANG>_COMPILER_WORKS to compiler information files
Since the parent commit this test result is specific to the version of
CMake.  Store it in the version-specific compiler information files
instead of CMakeCache.txt so testing can be re-done to meet the
requirements of the current version of CMake even if another version of
CMake was already used to configure the build tree.
2012-08-24 10:52:23 -04:00
Brad King 7195aca54f Make platform information files specific to the CMake version
At the top of a build tree we configure inside the CMakeFiles directory
files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to
save information detected about the system and compilers in use.  The
method of detection and the exact results store varies across CMake
versions as things improve.  This leads to problems when loading files
configured by a different version of CMake.  Previously we ignored such
existing files only if the major.minor part of the CMake version
component changed, and depended on the CMakeCache.txt to tell us the
last version of CMake that wrote the files.  This led to problems if the
user deletes the CMakeCache.txt or we add required information to the
files in a patch-level release of CMake (still a "feature point" release
by modern CMake versioning convention).

Ensure that we always have version-consistent platform information files
by storing them in a subdirectory named with the CMake version.  Every
version of CMake will do its own system and compiler identification
checks even when a build tree has already been configured by another
version of CMake.  Stored results will not clobber those from other
versions of CMake which may be run again on the same tree in the future.
Loaded results will match what the system and language modules expect.

Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to
CMAKE_PLATFORM_INFO_DIR to clarify its purpose.  The new variable points
at the version-specific directory while the old variable did not.
2012-08-24 10:52:23 -04:00
Brad King 32db033b27 VS: Remove support for "free" version 2003 tools
Several more recent Visual Studio Express editions are now available and
they support debug builds.  Simplify our VS platform files by removing
support for these old tools.  If anyone still uses them we can restore
support with a more modern way to test for them.
2012-08-23 10:51:27 -04:00
Brad King ec22a9b521 Cleanly enable a language in multiple subdirectories
When a language is not enabled at the top level of a project but is
enabled in multiple disjoint subdirectories we should re-use the
CMake<lang>Compiler.cmake file from the first directory.  Load the file
whenever it exists and is not left from a different version of CMake.
2012-08-22 16:35:54 -04:00
Brad King 403ead6594 Document CMAKE_<LANG>_COMPILER_(ID|VERSION) values
These values are now available almost everywhere and are tested.
Document them for general use and list possible ID values.
2012-08-22 16:35:54 -04:00
Brad King 66cb3356f5 VS: Detect the compiler id and tool location
Configure a hand-generated Visual Studio project to build the compiler id
source file since we cannot run the compiler command-line tool directly.
Add a post-build command to print out the full path to the compiler tool.
Parse the full path to the compiler tool from the build output.
2012-08-22 16:35:54 -04:00
Brad King 8be51f6694 Test variables CMAKE_(C|CXX|Fortran)_COMPILER(|_ID|_VERSION)
Add tests CMakeOnly.CompilerId(C|CXX|Fortran) to check that the basic
compiler tool path, vendor, and version variables have been set as
expected.
2012-08-22 16:35:54 -04:00
Brad King 89595d6bce VS10: Define CMAKE_VS_PLATFORM_TOOLSET variable
When the VS 10 generator selects a non-default PlatformToolset to
specify for MSBuild, report the selected name in this variable.
2012-08-22 16:35:46 -04:00
Brad King 965a69dcaa Xcode: Detect the compiler id and tool location
Configure a hand-generated Xcode project to build the compiler id source
file since we cannot run the compiler command-line tool directly.  Add a
post-build shell script phase to print out the compiler toolset build
setting.  Run xcodebuild to compile the identification binary.  Parse
the full path to the compiler tool from the xcodebuild output.
2012-08-22 15:14:33 -04:00
Brad King 9a9e1ee98d CMakeDetermineCompilerId: Prepare to detect IDE compiler id
Teach CMAKE_DETERMINE_COMPILER_ID to check for variable
CMAKE_${lang}_COMPILER_ID_TOOL after CMAKE_DETERMINE_COMPILER_ID_BUILD
to use as CMAKE_${lang}_COMPILER since it will not be known until after
the IDE runs.

In CMAKE_DETERMINE_COMPILER_ID_BUILD prepare a cascading "if" so we can
use a generator-specific method to compile the identification source
file.  Leave "if(0)" as a placeholder for now and put the direct
compiler invocation in "else()".  After running the compiler to build
the compiler identification source we file(GLOB) the list of output
files as candidates for extracting the compiler information.  An IDE may
create directories, so exclude exclude directories from this list.
2012-08-22 15:14:33 -04:00
Brad King b8b5c8342a Re-order C/C++/Fortran compiler determination logic
Re-organize CMakeDetermine(C|CXX|Fortran)Compiler.cmake to search for
the compiler command-line tool only under generators for which it makes
sense.  For the Visual Studio generators we do not expect to find the
compiler tool from the environment, nor would we use the result anyway.

Furthermore, set CMAKE_${lang}_COMPILER_ID_TEST_FLAGS only when it has a
chance to be used.  Extract _CMAKE_TOOLCHAIN_LOCATION from the compiler
path after running the compiler id step so in the future that step can
help find the path to the compiler.
2012-08-22 15:14:33 -04:00
Patrick Gansterer 2c7a451de0 VS: Cleanup AddPlatformDefinitions() of Visual Studio generators
Move adding of definitions into cmGlobalVisualStudioGenerator to
share code and avoid duplicate architecture string literals.
2012-08-22 15:08:40 -04:00
Kitware Robot addefc2ae3 CMake Nightly Date Stamp 2012-08-15 00:01:03 -04:00
Brad King cd3bd23266 Merge topic 'cleanup-style'
68bc863 Merge branch 'master' into cleanup-style
a05eba5 CMakeVersion.bash: Update sed expression for lower-case 'set'
3c0488d Fix WarnUnusedUnusedViaUnset test pass/fail regex
6c2c483 Remove trailing TAB from NSIS.template.in
9db3116 Remove CMake-language block-end command arguments
77543bd Convert CMake-language commands to lower case
7bbaa42 Remove trailing whitespace from most CMake and C/C++ code
be9db98 Merge topic 'watcom-compiler-version'
af42ae4 Watcom: Simplify compiler version detection (#11866)
2012-08-14 08:31:45 -04:00
Brad King 68bc863d5b Merge branch 'master' into cleanup-style
Conflicts:
	Source/CMakeVersion.cmake
2012-08-14 08:27:23 -04:00
Brad King a05eba57b5 CMakeVersion.bash: Update sed expression for lower-case 'set'
Since commit 77543bde (Convert CMake-language commands to lower case,
2012-08-13) the CMakeVersion.cmake file contains lower-case 'set'
commands.  Teach CMakeVersion.bash to replace the lower-case name
instead of the old upper-case 'SET'.
2012-08-14 08:25:51 -04:00
Brad King 3c0488d7d3 Fix WarnUnusedUnusedViaUnset test pass/fail regex
After conversion of Modules .cmake files to lower case the
FAIL_REGULAR_EXPRESSION for this test matched warnings in modules other
than the test line itself.  Make the pass and fail regular expressions
specific to the file containing the lines they are testing.
2012-08-14 08:06:19 -04:00
Brad King 6c2c483ef9 Remove trailing TAB from NSIS.template.in
This was missed by commit 7bbaa428 (Remove trailing whitespace from most
CMake and C/C++ code, 2012-08-13) which only removed trailing spaces,
not TABs.
2012-08-14 08:05:41 -04:00
Kitware Robot 9acb4f118c CMake Nightly Date Stamp 2012-08-14 00:01:08 -04:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Kitware Robot 77543bde41 Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:

cmake --help-command-list |
grep -v "cmake version" |
while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Kitware Robot 7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
Brad King be9db98946 Merge topic 'watcom-compiler-version'
af42ae4 Watcom: Simplify compiler version detection (#11866)
2012-08-13 14:18:28 -04:00
David Cole f0295575d7 Merge topic 'xcode-select'
e88bae7 Xcode: Run xcode-select to find Xcode version file (#13463)
2012-08-13 13:28:49 -04:00
David Cole e0f7d7fe5a Merge topic 'CPackRPM-fixRelocatablePrefix'
822c1ea Do not include directories which are part of the package install prefix.
2012-08-13 13:28:36 -04:00
David Cole 1f793ab6ba Merge topic 'fix-typo-13456'
67f11cf FindSelfPackers: fix typo (#13456)
2012-08-13 13:28:25 -04:00
David Cole 396bc28477 Merge topic 'doc_fixes'
76d6c59 Clean up documentation formatting so that it is rendered properly in HTML.
2012-08-13 13:28:16 -04:00
David Cole c1163632de Merge topic 'xcode-object-dir'
b237dbd Xcode: Fix object library references in multi-project trees (#13452)
2012-08-13 13:28:07 -04:00
David Cole 0d28661999 Merge topic 'select-compiler'
7e58e5b Prefer generic system compilers by default for C, C++, and Fortran
796e337 Factor common code out of CMakeDetermine(ASM|C|CXX|Fortran)Compiler
b708f1a CMakeDetermine(C|CXX)Compiler: Consider Clang compilers
2012-08-13 13:27:57 -04:00
David Cole 4bdbdfbfef Merge topic 'directory-typo'
6c8722f Fix typo direcotry -> directory (and similar) [#13444]
2012-08-13 13:27:48 -04:00
David Cole 92b11383d9 Merge topic 'SelectLibraryConfiguration-multi-lib-per-var2'
5797512 SelectLibraryConfiguration: generate correct output when input vars are lists
2012-08-13 13:27:39 -04:00
David Cole 11a9ea35de Merge topic 'FindOpenSSL-improve'
3cfb68d FindOpenSSL: remove leftover comment
fc798ed FindOpenSSL: cleanup path hints
c78a7d1 FindOpenSSL: let CMake handle environment variable HINTS
7464519 FindOpenSSL: use SelectLibraryConfigurations
4b793ad FindOpenSSL: find cross-compiled OpenSSL from MinGW (#13431)
2012-08-13 13:27:31 -04:00
David Cole 20f56a7eed Merge topic 'EclipseFixBadLinkedResources'
4ea5dc5 Eclipse: fix #13358: don't create bad linked resources
2012-08-13 13:27:17 -04:00
David Cole 1b9684562b Merge topic 'EclipseAddSupportForJuno'
53cc102 Eclipse: improve (fix ?) version detection on OSX
bcccddc Eclipse: add support for the 4.2 Juno release (#13367)
2012-08-13 13:27:07 -04:00
David Cole 85f843a7b4 Merge topic 'mixed-lib-to-lib64'
af80da3 remove lib64 Unix paths if the respective lib path is also given
733726e find_library: Fix mixed lib->lib64 (non-)conversion cases (#13419)
54add62 find_library: Simplify lib->lib<arch> expansion
6ca2f82 find_library: Refactor lib->lib64 conversion
1fe4b82 find_library: Add test covering lib->lib64 cases
2012-08-13 13:26:57 -04:00
David Cole e93d9c5c2b Merge topic 'use_normal_ouput_with_chdir'
4ddd3b9 Use OUTPUT_NORMAL instead of OUTPUT_MERGE for cmake -E chdir.
2012-08-13 13:26:48 -04:00
David Cole e856509093 Merge topic 'release-script-fixes'
214589b Add ability to run as a ctest -S script also
2012-08-13 13:26:39 -04:00
David Cole bed44c2cc1 Merge topic 'exclude-ExternalProject-test-for-cygwin-release-script'
3a17311 Release: Temporarily exclude ExternalProject test on cygwin
2012-08-13 13:26:30 -04:00
Brad King af42ae4f81 Watcom: Simplify compiler version detection (#11866)
Since commit c198730b (Detect Watcom compiler version with its id,
2011-12-07) the CMAKE_(C|CXX)_COMPILER_VERSION variables are set for the
Watcom compiler.  Use these in Windows-wcl386.cmake to set the old
WATCOM1* version variables.  This avoids using the old EXECUTE_PROCESS
command which failed due to extra quotes anyway.
2012-08-13 08:19:23 -04:00
Kitware Robot 408c04e734 CMake Nightly Date Stamp 2012-08-13 00:01:02 -04:00
Kitware Robot ee1ee20905 CMake Nightly Date Stamp 2012-08-12 00:01:02 -04:00
Kitware Robot 95e8636711 CMake Nightly Date Stamp 2012-08-11 00:01:02 -04:00
Brad King e88bae77c3 Xcode: Run xcode-select to find Xcode version file (#13463)
Multiple versions of Xcode may be installed in different locations.
Run "xcode-select --print-path" to detect the active Xcode location
and parse its Contents/version.plist file.  Note that the Xcode.app
directory name may vary in developer versions.
2012-08-10 12:58:22 -04:00
Kitware Robot 539cc289ba CMake Nightly Date Stamp 2012-08-10 00:01:04 -04:00
David Cole b3b43a420d Begin post-2.8.9 development 2012-08-09 16:28:18 -04:00
David Cole c462aafcfa CMake 2.8.9 2012-08-09 13:57:02 -04:00
David Cole 22d7094966 Merge branch 'release' 2012-08-09 13:54:45 -04:00