MantisBT - CMake
View Issue Details
0014302CMakeCMakepublic2013-07-19 07:042013-12-02 08:51
Jason Spiro 
Brad King 
normaltrivialN/A
closedfixed 
Wine1.4.1
CMake 2.8.11.2 
CMake 2.8.12CMake 2.8.12 
0014302: [PATCH] Find MinGW even if it came included with the Code::Blocks IDE and is installed inside the Code::Blocks directory
I installed MinGW not using the MinGW installer, but using the Code::Blocks IDE installer (http://prdownload.berlios.de/codeblocks/codeblocks-12.11mingw-setup.exe [^]). So my copy of MinGW isn't in "c:\MinGW". Instead, it's in "c:\Program Files\CodeBlocks\MinGW".

The problem is that, as shipped, CMake doesn't look there to find MinGW.

The following trivial patch enhances CMake on Windows so that it will check in the Code::Blocks directory while trying to find MinGW.


Signed-off-by: Jason Spiro <jasonspiro4@gmail.com>
---
 Modules/CMakeMinGWFindMake.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake
index efba20a..9d289ee 100644
--- a/Modules/CMakeMinGWFindMake.cmake
+++ b/Modules/CMakeMinGWFindMake.cmake
@@ -14,7 +14,8 @@
 
 find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
- c:/MinGW/bin /MinGW/bin)
+ c:/MinGW/bin /MinGW/bin
+ "[HKEY_CURRENT_USER\\Software\\CodeBlocks;Path]/MinGW/bin")
 find_program(CMAKE_SH sh.exe )
 if(CMAKE_SH)
   message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
mingw, patch
Issue History
2013-07-19 07:04Jason SpiroNew Issue
2013-07-19 07:06Jason SpiroTag Attached: mingw
2013-07-19 07:06Jason SpiroTag Attached: patch
2013-07-19 08:01Brad KingNote Added: 0033573
2013-07-19 08:01Brad KingAssigned To => Brad King
2013-07-19 08:01Brad KingStatusnew => resolved
2013-07-19 08:01Brad KingResolutionopen => fixed
2013-07-19 08:01Brad KingFixed in Version => CMake 2.8.12
2013-07-19 08:01Brad KingTarget Version => CMake 2.8.12
2013-12-02 08:51Robert MaynardNote Added: 0034651
2013-12-02 08:51Robert MaynardStatusresolved => closed

Notes
(0033573)
Brad King   
2013-07-19 08:01   
Applied, thanks!

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9cdc5e6b [^]
(0034651)
Robert Maynard   
2013-12-02 08:51   
Closing resolved issues that have not been updated in more than 4 months.