summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineRCCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeDetermineRCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineRCCompiler.cmake15
1 files changed, 9 insertions, 6 deletions
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index f8d55a5..d22741b 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -30,16 +30,19 @@ if(NOT CMAKE_RC_COMPILER)
# finally list compilers to try
if(CMAKE_RC_COMPILER_INIT)
- set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
- else()
- set(CMAKE_RC_COMPILER_LIST rc)
+ set(_CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
+ set(_CMAKE_RC_COMPILER_FALLBACK ${CMAKE_RC_COMPILER_INIT})
+ elseif(NOT _CMAKE_RC_COMPILER_LIST)
+ set(_CMAKE_RC_COMPILER_LIST rc)
endif()
# Find the compiler.
- find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
- if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
- set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
+ find_program(CMAKE_RC_COMPILER NAMES ${_CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
+ if(_CMAKE_RC_COMPILER_FALLBACK AND NOT CMAKE_RC_COMPILER)
+ set(CMAKE_RC_COMPILER "${_CMAKE_RC_COMPILER_FALLBACK}" CACHE FILEPATH "RC compiler" FORCE)
endif()
+ unset(_CMAKE_RC_COMPILER_FALLBACK)
+ unset(_CMAKE_RC_COMPILER_LIST)
endif()
mark_as_advanced(CMAKE_RC_COMPILER)