summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* VS: Fix MSVC_IDE definition recently broken by refactoringBrad King2012-08-301-2/+2
| | | | | | In commit 485a940e (VS: Simplify MSVC version reporting, 2012-08-23) we accidentally flipped the 0/1 values of MSVC_IDE. Flip them back and teach the CheckCompilerRelatedVariables test to check the variable.
* Merge branch 'cmake-platform-info-version' into msvc-compiler-infoBrad King2012-08-3018-85/+119
|\ | | | | | | | | | | | | Conflicts: Modules/CMakeTestCCompiler.cmake Modules/CMakeTestCXXCompiler.cmake Modules/Platform/Windows-cl.cmake
| * Move CMAKE_<LANG>_COMPILER_WORKS to compiler information filesBrad King2012-08-247-72/+104
| | | | | | | | | | | | | | | | 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.
| * Make platform information files specific to the CMake versionBrad King2012-08-2415-29/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Modernize MSVC compiler information filesBrad King2012-08-304-99/+81
| | | | | | | | | | | | | | 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.
* | VS: Simplify MSVC version reportingBrad King2012-08-305-110/+42
| | | | | | | | | | | | | | | | | | 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.
* | VS: Remove support for "free" version 2003 toolsBrad King2012-08-233-60/+11
|/ | | | | | | 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.
* VS: Detect the compiler id and tool locationBrad King2012-08-226-9/+223
| | | | | | | 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.
* Xcode: Detect the compiler id and tool locationBrad King2012-08-227-1/+387
| | | | | | | | 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.
* CMakeDetermineCompilerId: Prepare to detect IDE compiler idBrad King2012-08-221-27/+43
| | | | | | | | | | | | | | | 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.
* Re-order C/C++/Fortran compiler determination logicBrad King2012-08-223-216/+207
| | | | | | | | | | | | 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.
* Remove trailing TAB from NSIS.template.inBrad King2012-08-141-1/+1
| | | | | | 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.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-13229-2811/+2811
| | | | | | | | | | | | | | | | | 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
* Convert CMake-language commands to lower caseKitware Robot2012-08-13322-10683/+10683
| | | | | | | | | | | | | | | | | 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
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-13158-880/+880
| | | | | | | | | | | | | | | | | 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/ \+$//'
* Merge topic 'watcom-compiler-version'Brad King2012-08-131-37/+24
|\ | | | | | | af42ae4 Watcom: Simplify compiler version detection (#11866)
| * Watcom: Simplify compiler version detection (#11866)Brad King2012-08-131-37/+24
| | | | | | | | | | | | | | | | 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.
* | Merge topic 'CPackRPM-fixRelocatablePrefix'David Cole2012-08-131-1/+20
|\ \ | | | | | | | | | | | | 822c1ea Do not include directories which are part of the package install prefix.
| * | Do not include directories which are part of the package install prefix.Andy Piper2012-08-071-1/+20
| |/ | | | | | | | | | | This fix bug #0013451. The bug prevents theorerically relocatable RPM package to be installed properly. Signed-off-by: Eric NOULARD <eric.noulard@gmail.com>
* | Merge topic 'fix-typo-13456'David Cole2012-08-131-1/+1
|\ \ | | | | | | | | | | | | 67f11cf FindSelfPackers: fix typo (#13456)
| * | FindSelfPackers: fix typo (#13456)Rolf Eike Beer2012-08-041-1/+1
| |/ | | | | | | Correction by Modestas Vainius.
* | Merge topic 'doc_fixes'David Cole2012-08-131-193/+193
|\ \ | | | | | | | | | | | | 76d6c59 Clean up documentation formatting so that it is rendered properly in HTML.
| * | Clean up documentation formatting so that it is rendered properly in HTML.Zack Galbreath2012-08-031-193/+193
| |/
* | Merge topic 'select-compiler'David Cole2012-08-139-93/+147
|\ \ | | | | | | | | | | | | | | | | | | 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
| * | Prefer generic system compilers by default for C, C++, and FortranBrad King2012-08-029-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach CMake to prefer the system default compiler automatically when no compiler is specified. By default use "cc" for C, "CC" for C++, and "f95" for Fortran. Load a new Platform/<os>-<lang>.cmake module to allow each platform to specify for each language its system compiler name(s) and/or exclude certain names. Create Platform/(CYGWIN|Darwin|Linux|Windows)-CXX.cmake modules to specify "c++" as the system C++ compiler name for these platforms. On systems that use case-insensitive filesystems exclude C++ compiler names that are distinguished from C compiler names only by case. This will change the default compiler selection for existing build scripts that do not specify a compiler when run on machines with separate system and GNU compilers both installed in the PATH. We do not make this change in default behavior lightly. However: (1) If a given build really needs specific compilers one should specify them explicitly e.g. by setting CC, CXX, and FC in the environment. (2) The motivating case is to prefer the system Clang on newer OS X systems over the older GNU compilers typically also installed. On such systems the names "cc" and "c++" link to Clang. This is the first platform known to CMake on which "c++" is not a GNU compiler. The old behavior selected "gcc" for C and "c++" C++ and therefore chooses GNU for C and Clang for C++ by default. The new behavior selects GNU or Clang consistently for both languages on older or newer OS X systems, respectively. (3) Other than the motivating OS X case the conditions under which the behavior changes do not tend to exist in default OS installations. They typically occur only on non-GNU systems with manually-installed GNU compilers. (4) The consequences of the new behavior are not dire. At worst the project fails to compile with the system compiler when it previously worked with the non-system GNU compiler. Such failure is easy to work around (see #1). In short this change creates a more sensible default behavior everywhere and fixes poor default behavior on a widely-used platform at the cost of a modest change in behavior in less-common conditions.
| * | Factor common code out of CMakeDetermine(ASM|C|CXX|Fortran)CompilerBrad King2012-08-025-86/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler candidate list selection and search code for C, C++, ASM, and Fortran languages was duplicated across four modules. To look for compilers adjacent to already-enabled languages the C and CXX modules each used _CMAKE_USER_(C|CXX)_COMPILER_PATH and the ASM module used _CMAKE_TOOLCHAIN_LOCATION. Since commit 4debb7ac (Bias Fortran compiler search with C/C++ compilers, 2009-09-09) CMake prefers Fortran compilers matching the vendor and directory of an enabled C or C++ compiler. Factor out the common functionality among the four languages into a new CMakeDetermineCompiler module. Generalize the Fortran implementation so that all languages may each use the vendor and directory of the other languages that have already been enabled. For now do not list any vendor-specific names for C, C++, or ASM so that only the directory preference is used for these languages (existing behavior).
| * | CMakeDetermine(C|CXX)Compiler: Consider Clang compilersBrad King2012-07-312-2/+2
| |/ | | | | | | | | | | Look for "clang" or "clang++" compiler executables so Clang will be used when it is the only compiler available. Prefer them last to avoid changing compiler default preferences for existing scripts.
* | Merge topic 'directory-typo'David Cole2012-08-132-2/+2
|\ \ | | | | | | | | | | | | 6c8722f Fix typo direcotry -> directory (and similar) [#13444]
| * | Fix typo direcotry -> directory (and similar) [#13444]Rolf Eike Beer2012-07-302-2/+2
| |/
* | Merge topic 'SelectLibraryConfiguration-multi-lib-per-var2'David Cole2012-08-131-8/+10
|\ \ | | | | | | | | | | | | 5797512 SelectLibraryConfiguration: generate correct output when input vars are lists
| * | SelectLibraryConfiguration: generate correct output when input vars are listsRolf Eike Beer2012-07-291-8/+10
| |/ | | | | | | | | | | | | | | | | | | In case that any of the input variables that hold the library names contains more than just a single library the "debug" or "optimized" keywords were only prepended to the first item, making all other libs appear in all configurations. Just treat both input variables as lists. Thanks to Philipp Berger <newsletters@philippberger.de> for pointing me at this.
* | Merge topic 'FindOpenSSL-improve'David Cole2012-08-131-35/+43
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | FindOpenSSL: remove leftover commentRolf Eike Beer2012-07-291-1/+0
| | |
| * | FindOpenSSL: cleanup path hintsRolf Eike Beer2012-07-291-19/+28
| | | | | | | | | | | | | | | | | | -only use Windows-specific paths on Windows -recode the contents of $ENV{PROGRAMFILES} to be a valid CMake path before using it
| * | FindOpenSSL: let CMake handle environment variable HINTSRolf Eike Beer2012-07-291-1/+1
| | | | | | | | | | | | This will automatically make sure the paths will get recoded to proper separators on Windows
| * | FindOpenSSL: use SelectLibraryConfigurationsRolf Eike Beer2012-07-291-13/+5
| | |
| * | FindOpenSSL: find cross-compiled OpenSSL from MinGW (#13431)Rolf Eike Beer2012-07-291-2/+10
| |/ | | | | | | Suggested-by: Dominik Schmidt <dev@dominik-schmidt.de>
* | Merge topic 'EclipseAddSupportForJuno'David Cole2012-08-131-1/+7
|\ \ | | | | | | | | | | | | | | | 53cc102 Eclipse: improve (fix ?) version detection on OSX bcccddc Eclipse: add support for the 4.2 Juno release (#13367)
| * | Eclipse: improve (fix ?) version detection on OSXAlex Neundorf2012-07-281-0/+3
| | | | | | | | | | | | | | | | | | | | | This is probably related to a framework installation I guess. This is part of the patch in #13367 from Nicholas Yue. Alex
| * | Eclipse: add support for the 4.2 Juno release (#13367)Alex Neundorf2012-07-281-1/+4
| |/ | | | | | | | | | | Thanks for the path to Nicholas Yue. Alex
* | Merge topic 'mixed-lib-to-lib64'David Cole2012-08-133-6/+4
|\ \ | |/ |/| | | | | | | | | | | | | 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
| * remove lib64 Unix paths if the respective lib path is also givenRolf Eike Beer2012-07-213-6/+4
| | | | | | | | If FIND_LIBRARY_USE_LIB64_PATHS is set both will be searched anyway.
* | Fixed: FindLAPACK does not find MKL 10.3 when using gcc 4.xAlexey Ozeritsky2012-07-181-4/+2
|/
* Merge topic 'ninja-rspfile-link-libraries'David Cole2012-07-121-1/+3
|\ | | | | | | | | | | | | | | | | | | 4bb94c9 Ninja: sysconf() is declared in unistd.h bb36759 Ninja: enable response file support on Mac (length 262144) 3a2c8e8 Ninja: disable work around when linking with mingw 3856e66 Ninja: error on missing rspfile_content 8c1e35c Ninja: remove some unused default arguments 7f647cf Ninja: also write link libraries to rsp file
| * Ninja: disable work around when linking with mingwPeter Kümmel2012-07-111-1/+3
| | | | | | | | | | | | | | The work around is only needed by older GCCs (only testet 4.4/4.7) Ninja is very new so chances are high that there is also a new mingw. Use slashes in link rsp file, because ar.exe can't handle \.
* | Merge topic 'aix-gnu-asm'David Cole2012-07-121-0/+2
|\ \ | | | | | | | | | | | | 7755283 Add ASM platform information for GNU compiler on AIX (#13390)
| * | Add ASM platform information for GNU compiler on AIX (#13390)Brad King2012-07-101-0/+2
| |/ | | | | | | | | | | | | Among other flags this sets RPATH flags correctly so that CMake knows how to treat CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH for the ASM language. This is the GNU compiler equivalent to commit a0bab7ae (Add ASM platform information for XL compiler on AIX, 2011-03-02), made for XL.
* | Merge topic 'aix-GNU-shared-libs'David Cole2012-07-121-1/+2
|\ \ | | | | | | | | | | | | 767a7ad AIX-GNU: Link shared libs with -brtl,-bnoipath (#13352)
| * | AIX-GNU: Link shared libs with -brtl,-bnoipath (#13352)Brad King2012-07-091-1/+2
| | | | | | | | | | | | We already use these flags with the XL toolchain. Use them for GNU too.
* | | Merge topic 'deploy-qt4-workaround-bug-13258'David Cole2012-07-121-1/+1
|\ \ \ | |_|/ |/| | | | | | | | 374b9b9 DeployQt4: workaround bug 13258 where ARGV1 is leaked into a sub function.