diff options
author | Ruslan Baratov <ruslan_baratov@yahoo.com> | 2017-03-08 03:25:47 (GMT) |
---|---|---|
committer | Ruslan Baratov <ruslan_baratov@yahoo.com> | 2017-03-08 20:28:01 (GMT) |
commit | b9d36826c5676bf3d0bb55fb47c6ce62f4f3470d (patch) | |
tree | 1f4f75b27fcc1d51852a7909e34ddbe22b95c955 /Modules | |
parent | 52d39264b49c18f6f1e98a2348e69cd679e389bc (diff) | |
download | CMake-b9d36826c5676bf3d0bb55fb47c6ce62f4f3470d.zip CMake-b9d36826c5676bf3d0bb55fb47c6ce62f4f3470d.tar.gz CMake-b9d36826c5676bf3d0bb55fb47c6ce62f4f3470d.tar.bz2 |
Add 'CMAKE_GCC_AR' and 'CMAKE_GCC_RANLIB' variables
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeASMCompiler.cmake.in | 2 | ||||
-rw-r--r-- | Modules/CMakeCCompiler.cmake.in | 2 | ||||
-rw-r--r-- | Modules/CMakeCXXCompiler.cmake.in | 2 | ||||
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 4 | ||||
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 4 | ||||
-rw-r--r-- | Modules/CMakeDetermineFortranCompiler.cmake | 3 | ||||
-rw-r--r-- | Modules/CMakeFortranCompiler.cmake.in | 2 | ||||
-rw-r--r-- | Modules/Compiler/GNU-FindBinUtils.cmake | 27 |
8 files changed, 46 insertions, 0 deletions
diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in index 8e58307..ad65698 100644 --- a/Modules/CMakeASMCompiler.cmake.in +++ b/Modules/CMakeASMCompiler.cmake.in @@ -1,7 +1,9 @@ set(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@") set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@") set(CMAKE_AR "@CMAKE_AR@") +set(CMAKE_GCC_AR "@CMAKE_GCC_AR@") set(CMAKE_RANLIB "@CMAKE_RANLIB@") +set(CMAKE_GCC_RANLIB "@CMAKE_GCC_RANLIB@") set(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1) set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@") diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index 50b12f2..ab068a2 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -14,7 +14,9 @@ set(CMAKE_C_SIMULATE_ID "@CMAKE_C_SIMULATE_ID@") set(CMAKE_C_SIMULATE_VERSION "@CMAKE_C_SIMULATE_VERSION@") @SET_MSVC_C_ARCHITECTURE_ID@ set(CMAKE_AR "@CMAKE_AR@") +set(CMAKE_GCC_AR "@CMAKE_GCC_AR@") set(CMAKE_RANLIB "@CMAKE_RANLIB@") +set(CMAKE_GCC_RANLIB "@CMAKE_GCC_RANLIB@") set(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@) set(CMAKE_C_COMPILER_LOADED 1) diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 6d56488..27c8881 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -15,7 +15,9 @@ set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@") set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@") @SET_MSVC_CXX_ARCHITECTURE_ID@ set(CMAKE_AR "@CMAKE_AR@") +set(CMAKE_GCC_AR "@CMAKE_GCC_AR@") set(CMAKE_RANLIB "@CMAKE_RANLIB@") +set(CMAKE_GCC_RANLIB "@CMAKE_GCC_RANLIB@") set(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@) set(CMAKE_CXX_COMPILER_LOADED 1) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 4a315e0..5d9850d 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -166,6 +166,10 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) endif () include(CMakeFindBinUtils) +set(_CMAKE_PROCESSING_LANGUAGE "C") +include(Compiler/${CMAKE_C_COMPILER_ID}-FindBinUtils OPTIONAL) +unset(_CMAKE_PROCESSING_LANGUAGE) + if(MSVC_C_ARCHITECTURE_ID) set(SET_MSVC_C_ARCHITECTURE_ID "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})") diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index f2e0bb2..4d85150 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -161,6 +161,10 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) endif () include(CMakeFindBinUtils) +set(_CMAKE_PROCESSING_LANGUAGE "CXX") +include(Compiler/${CMAKE_CXX_COMPILER_ID}-FindBinUtils OPTIONAL) +unset(_CMAKE_PROCESSING_LANGUAGE) + if(MSVC_CXX_ARCHITECTURE_ID) set(SET_MSVC_CXX_ARCHITECTURE_ID "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})") diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 484fa66..9e9770a 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -255,6 +255,9 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) endif () include(CMakeFindBinUtils) +set(_CMAKE_PROCESSING_LANGUAGE "Fortran") +include(Compiler/${CMAKE_Fortran_COMPILER_ID}-FindBinUtils OPTIONAL) +unset(_CMAKE_PROCESSING_LANGUAGE) if(MSVC_Fortran_ARCHITECTURE_ID) set(SET_MSVC_Fortran_ARCHITECTURE_ID diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 69800d7..c49621b 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -8,7 +8,9 @@ set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@") set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@") @SET_MSVC_Fortran_ARCHITECTURE_ID@ set(CMAKE_AR "@CMAKE_AR@") +set(CMAKE_GCC_AR "@CMAKE_GCC_AR@") set(CMAKE_RANLIB "@CMAKE_RANLIB@") +set(CMAKE_GCC_RANLIB "@CMAKE_GCC_RANLIB@") set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@) set(CMAKE_Fortran_COMPILER_LOADED 1) set(CMAKE_Fortran_COMPILER_WORKS @CMAKE_Fortran_COMPILER_WORKS@) diff --git a/Modules/Compiler/GNU-FindBinUtils.cmake b/Modules/Compiler/GNU-FindBinUtils.cmake new file mode 100644 index 0000000..e314eb9 --- /dev/null +++ b/Modules/Compiler/GNU-FindBinUtils.cmake @@ -0,0 +1,27 @@ +cmake_policy(SET CMP0054 NEW) + +if("${_CMAKE_PROCESSING_LANGUAGE}" STREQUAL "") + message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set") +endif() + +string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y + "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}") + +# Try to find tools in the same directory as GCC itself +get_filename_component(__gcc_hints "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY) + +# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ar.1.html +find_program(CMAKE_GCC_AR NAMES + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar" + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x_y}" + HINTS ${__gcc_hints} + DOC "A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler" +) + +# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ranlib.1.html +find_program(CMAKE_GCC_RANLIB NAMES + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib" + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x_y}" + HINTS ${__gcc_hints} + DOC "A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler" +) |