summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'ide-compiler-id'David Cole2012-08-241-58/+57
|\ | | | | | | | | | | | | | | | | | | | | | | 403ead6 Document CMAKE_<LANG>_COMPILER_(ID|VERSION) values 8be51f6 Test variables CMAKE_(C|CXX|Fortran)_COMPILER(|_ID|_VERSION) ec22a9b Cleanly enable a language in multiple subdirectories 66cb335 VS: Detect the compiler id and tool location 89595d6 VS10: Define CMAKE_VS_PLATFORM_TOOLSET variable 965a69d Xcode: Detect the compiler id and tool location 9a9e1ee CMakeDetermineCompilerId: Prepare to detect IDE compiler id b8b5c83 Re-order C/C++/Fortran compiler determination logic
| * VS: Detect the compiler id and tool locationBrad King2012-08-221-4/+0
| | | | | | | | | | | | | | 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-221-0/+2
| | | | | | | | | | | | | | | | 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.
| * Re-order C/C++/Fortran compiler determination logicBrad King2012-08-221-58/+59
| | | | | | | | | | | | | | | | | | | | | | | | 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 CMake multiline block-end command argumentsMarcin Wojdyr2012-08-151-3/+1
|/ | | | removing arguments omitted in 9db3116226cb99fcf54e936c833953abcde9b729
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-18/+18
| | | | | | | | | | | | | | | | | 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-131-81/+81
| | | | | | | | | | | | | | | | | 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
* Prefer generic system compilers by default for C, C++, and FortranBrad King2012-08-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-021-12/+5
| | | | | | | | | | | | | | | | | 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-311-1/+1
| | | | | | 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.
* CMakeDetermineCCompiler: Fix typo "_CXX_" -> "_C_" (#13330)Brad King2012-06-201-1/+1
| | | | | Initialize CMAKE_C_COMPILER_INIT before using it, rather than CMAKE_CXX_COMPILER_INIT.
* Ninja: allow spaces in source pathPeter Kuemmel2012-06-081-3/+1
| | | | And make /showIncude prefix visible for all build rules
* Set CMAKE_<lang>_COMPILER_ID for VS generatorsBrad King2011-09-021-4/+1
| | | | | | | | | | | | | Currently the VS generators do not support Intel C/C++ .icproj files and the MS tools do not include a Fortran compiler. Therefore we can always set the C and CXX compiler IDs to "MSVC" and the Fortran ID to "Intel". This fixes a regression in support for the Intel Fortran compiler under the VS plugin introduced by commit cd43636c (Modernize Intel compiler info on Windows, 2010-12-16). The commit moved the compiler information into platform files that only load when the proper compiler id is set. It worked for the NMake Makefiles generator but not for the VS IDE generator because it did not set the compiler id.
* Fix parsing of compiler name with a version numberAlex Neundorf2011-01-261-3/+4
| | | | | | | This fixes #11679, the toolchain prefix was not correctly detected for arm-eabi-gcc-4.5.2 Alex
* Strip trailing whitespace.Alex Neundorf2011-01-261-14/+14
| | | | Alex
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Change the way 32/64 bit compiles are detected with MSVC and intel makefile ↵Bill Hoffman2009-11-201-3/+5
| | | | builds. Use the platform ID preprocessor approach.
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-0/+13
| | | | | | | This adds copyright/license notification blocks CMake's non-find modules. Most of the modules had no notices at all. Some had notices referring to the BSD license already. This commit normalizes existing notices and adds missing notices.
* ENH: Identify HP C compilerBrad King2009-07-081-0/+3
| | | | | This compiler does not enable ANSI mode by default. When identifying the C compiler we try passing -Aa in case it is the HP compiler.
* BUG: only check for a toolchain prefix (e.g. "arm-linux-" inAlexander Neundorf2008-09-081-21/+27
| | | | | | "arm-linux-gcc") if we are cross compiling and the compiler is gcc Alex
* BUG: #7359 make llvm-gcc work, by explicitely excluding "llvm-" from ↵Alexander Neundorf2008-09-071-1/+8
| | | | | | | | _CMAKE_TOOLCHAIN_PREFIX (use the (relatively) new CMAKE_MATCH_x variables set by all regex operations) Alex
* BUG: make the toolchain-prefix recognition work with prefixes which containAlexander Neundorf2008-05-151-7/+10
| | | | | | | dots (as in arm-unknown-nto-qnx6.3.0-gcc.exe), NAME_WE returns only up to the 6, instead of everything in front of the .exe Alex
* ENH: Improvied compiler identification robustnessBrad King2008-02-251-1/+3
| | | | | | | | - Write a single source file into the compiler id directory - This avoid requiring the compiler to behave correctly with respect to include rules and the current working directory - Helps to identify cross-compiling toolchains with unusual default behavior
* ENH: When detecting the compiler id try compiling only to an object file.Brad King2008-02-111-0/+8
|
* BUG: When configuring compiler information files into the CMakeFiles ↵Brad King2008-02-041-2/+3
| | | | directory in the project build tree, use IMMEDIATE option for CONFIGURE_FILE explicitly. It is needed in case the user sets CMAKE_BACKWARDS_COMPATIBILITY to 2.0 or lower.
* BUG: When forcing the C and CXX compilers do not try to detect the ABI ↵Brad King2008-02-031-2/+3
| | | | information. Cleanup configured language compiler info files by always using @ONLY. This addresses bug#6297.
* ENH: if CMAKE_(C|CXX)_COMPILER is preset to a list of two elements, use theAlexander Neundorf2007-07-181-1/+9
| | | | | | first one as the compiler and the second one as ARG1 for the compiler Alex
* ENH: remove support for presetting CMAKE_SYSTEM_INFO_FILE,Alexander Neundorf2007-07-021-15/+1
| | | | | | | | | | | | | | | | CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE, CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE, CMAKE_SYSTEM_AND_C_COMPILER_AND_PROCESSOR_INFO_FILE and CMAKE_SYSTEM_AND_CXX_COMPILER_AND_PROCESSOR_INFO_FILE Instead of presetting these variables to arbitrary filenames, users should set up CMAKE_SYSTEM_NAME and the compilers correctly and also create a Platform/ directory so these files will all follow the official cmake style, which should make it easier to understand and debug project which have their own platform/toolchain support files. -remove support for a suffix to MS crosscompilers, since this is not (yet) supported by cmake and might confuse users Alex
* ENH: check for CMAKE_HOST_SYSTEM_NAME to decide whether to loadAlexander Neundorf2007-06-261-1/+1
| | | | | | | | | CMakeDetermineSystem.cmake, since CMAKE_SYSTEM_NAME might already be preset when using cmake for cross compiling use type STRING instead of FILEPATH since otherwise a strange filename was generated Alex
* ENH: split cmGlobalGenerator::SetLanguageEnabled() in two parts, where theAlexander Neundorf2007-06-111-11/+0
| | | | | | | | second part copies the values from the cmake variables into internal maps. So this can now be done after the compiler-specific information has been loaded, which can now overwrite more settings. Alex
* ENH: add compiler id for IAR compiler (http://www.iar.com/)Alexander Neundorf2007-05-241-0/+1
| | | | | | ENH: don't run endian test again if the variable is already set Alex
* STYLE: use a separate source file for generating CMakeSystem.cmake if ↵Alexander Neundorf2007-05-211-0/+3
| | | | | | CMAKE_TOOLCHAIN_FILE is used Alex
* BUG: don't fail if a compiler is given in CMAKE_C/CXX_COMPILER but it can'tAlexander Neundorf2007-05-211-2/+7
| | | | | | be found in the path Alex
* ENH: merge CMake-CrossCompileBasic to HEADAlexander Neundorf2007-05-171-15/+71
| | | | | | | | | | | | | | | | | | | | | | | | -add a RESULT_VARIABLE to INCLUDE() -add CMAKE_TOOLCHAIN_FILE for specifiying your (potentially crosscompiling) toolchain -have TRY_RUN() complain if you try to use it in crosscompiling mode (which were compiled but cannot run on this system) -use CMAKE_EXECUTABLE_SUFFIX in TRY_RUN(), probably TRY_RUN won't be able to run the executables if they have a different suffix because they are probably crosscompiled, but nevertheless it should be able to find them -make several cmake variables presettable by the user: CMAKE_C/CXX_COMPILER, CMAKE_C/CXX_OUTPUT_EXTENSION, CMAKE_SYSTEM_NAME, CMAKE_SYSTEM_INFO_FILE -support prefix for GNU toolchains (arm-elf-gcc, arm-elf-ar, arm-elf-strip etc.) -move ranlib on OSX from the file command to a command in executed in cmake_install.cmake -add support for stripping during install in cmake_install.cmake -split out cl.cmake from Windows-cl.cmake, first (very incomplete) step to support MS crosscompiling tools -remove stdio.h from the simple C program which checks if the compiler works, since this may not exist for some embedded platforms -create a new CMakeFindBinUtils.cmake which collects the search fro ar, ranlib, strip, ld, link, install_name_tool and other tools like these -add support for CMAKE_FIND_ROOT_PATH for all FIND_XXX commands, which is a list of directories which will be prepended to all search directories, right now as a cmake variable, turning it into a global cmake property may need some more work -remove cmTestTestHandler::TryExecutable(), it's unused -split cmFileCommand::HandleInstall() into slightly smaller functions Alex
* ENH: Merging CompilerId updates from branch CMake-Modules-CompilerId to the ↵Brad King2007-05-031-1/+1
| | | | main tree. Changes between CMake-Modules-CompilerId-mp1 and CMake-Modules-CompilerId-mp2 are included.
* ENH: Merging CompilerId implementation from branch CMake-Modules-CompilerId ↵Brad King2007-04-281-32/+23
| | | | to the main tree. Changes between CMake-Modules-CompilerId-bp and CMake-Modules-CompilerId-mp1 are included.
* BUG: Search for the compiler only once and store a full path to it in the ↵Brad King2006-08-291-10/+11
| | | | cache. This avoids problems with the case of locations in the PATH variable on Windows that change the compiler name when CMake is re-run. CMakeFiles/CMake*Compiler.cmake files should hold the full path to the compiler always.
* ENH: centralized locaiton of CMakeFiles settingKen Martin2006-06-141-2/+2
|
* ENH: Makefile performance improvementsKen Martin2006-05-021-1/+1
|
* ENH: better finding of mingw from msys, and delete CMakeFiles directory when ↵Bill Hoffman2006-02-211-1/+4
| | | | cache is deleted
* ENH: fix more than one argument passed in to compilers via environmentBill Hoffman2006-01-251-1/+1
|
* ENH: fix borland make clean targets before build, add new generators for ↵Bill Hoffman2005-12-221-1/+1
| | | | msys and mingw
* ENH: add documentation support for modulesBill Hoffman2005-12-141-0/+1
|
* ENH: put cmake files intoa CMakeFiles subdir to clean up bin treeKen Martin2005-07-291-3/+3
|
* ENH: make sure flags set in CC or CXX environment variables stay with the ↵Bill Hoffman2005-07-201-0/+3
| | | | compiler
* ENH: stuff to keep compiler tests from re-running all the timeBill Hoffman2005-01-201-0/+1
|
* ENH: do not check for gnu for visual studioKen Martin2004-09-151-0/+6
|
* ENH: more uniform approach to enable language, one step closer to being able ↵Bill Hoffman2004-08-261-1/+1
| | | | to enable a language without modifing cmake source code
* ENH: use CFLAGS for testing for gnuBill Hoffman2004-01-231-1/+7
|
* BUG: use the flags when testing for type of gnu compilerBill Hoffman2004-01-131-1/+1
|