From db924e00b4ddb7c068103e43f314042b154f38ac Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Apr 2014 10:08:17 -0400 Subject: [PATCH 1/2] CMakeRCInformation: Do not mention 'Fortran' in documentation This module is for the Windows Resource Compiler, not Fortran. --- Modules/CMakeRCInformation.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake index 8ffe50aba..68994576b 100644 --- a/Modules/CMakeRCInformation.cmake +++ b/Modules/CMakeRCInformation.cmake @@ -13,7 +13,7 @@ # License text for the above reference.) -# This file sets the basic flags for the Fortran language in CMake. +# This file sets the basic flags for the Windows Resource Compiler. # It also loads the available platform file for the system-compiler # if it exists. @@ -30,7 +30,7 @@ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING - "Flags for Fortran compiler.") + "Flags for Windows Resource Compiler.") # These are the only types of flags that should be passed to the rc # command, if COMPILE_FLAGS is used on a target this will be used From 7147ed5ce45ac6ae9d5f4e6e45bce2c66be39be3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Apr 2014 10:10:39 -0400 Subject: [PATCH 2/2] CMakeRCInformation: Recognize 'windres' tools with '.' in name (#14865) A 64-bit MinGW windres is named "i686-w64-mingw32.shared-windres". The get_filename_component NAME_WE mode may strip the ".shared-windres" part and cause the result to no longer contain "windres". Instead, match the "windres" name in the full CMAKE_RC_COMPILER value first, and use the get_filename_component code path only for other resource compilers. --- Modules/CMakeRCInformation.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake index 68994576b..6bb2636f1 100644 --- a/Modules/CMakeRCInformation.cmake +++ b/Modules/CMakeRCInformation.cmake @@ -19,9 +19,10 @@ # make sure we don't use CMAKE_BASE_NAME from somewhere else set(CMAKE_BASE_NAME) -get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE) -if("${CMAKE_BASE_NAME}" MATCHES "windres") - set(CMAKE_BASE_NAME "windres") +if(CMAKE_RC_COMPILER MATCHES "windres[^/]*$") + set(CMAKE_BASE_NAME "windres") +else() + get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE) endif() set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)