12

I'm trying to run through the Firebreath tutorial, but I cannot get Cmake to work. Cmake does not register any version of Visual Studios under the Generators list. This is the list when running cmake --help:

Generators

The following generators are available on this platform:
  Unix Makefiles              = Generates standard UNIX makefiles.
  Ninja                       = Generates build.ninja files (experimental).
  CodeBlocks - Ninja          = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
  Eclipse CDT4 - Ninja        = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles
                              = Generates Eclipse CDT 4.0 project files.
  KDevelop3                   = Generates KDevelop 3 project files.
  KDevelop3 - Unix Makefiles  = Generates KDevelop 3 project files.
  Sublime Text 2 - Ninja      = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                              = Generates Sublime Text 2 project files.

I have re-installed CMake, installing Visual Studios 2010 and 2012 (Express and Professional editions), and even uninstalled and re-installed .NET 4.0 to 4.5 (from here). It works fine on my personal computer, as I got it running on the first go. However, my work laptop is just not registering Visual Studios.

I'm running it both on Windows 7 Enterprise SP1. Any help is appreciated.

Here is the exact error I am getting:

C:\code\tutorial2\TutorialTestPlugin>firebreath\prep2012.cmd . build
A subdirectory or file build already exists.
Using projects in: "C:\code\tutorial2\TutorialTestPlugin"
Generating build files in: "C:\code\tutorial2\TutorialTestPlugin\build"
NOTE: The build files in "C:\code\tutorial2\TutorialTestPlugin\build" should *NE
VER* be modified directly.
When needed, make project changes in cmake files and re-run this script.
  Project-specific cmake files are found in [plugin dir]\CMakeLists.txt and
  [plugin dir]\Win\projectDef.cmake.
Note that parameters for cmake should be enclosed in double quotes, e.g. "-DVERB
OSE=1"
CMAKE parameters:

C:\code\tutorial2\TutorialTestPlugin\build>cmake -G "Visual Studio 11" -DFB_PROJ
ECTS_DIR="C:\code\tutorial2\TutorialTestPlugin"  "C:\code\tutorial2\TutorialTest
Plugin\firebreath"
CMake Error: Could not create named generator Visual Studio 11
cygwin warning:
  MS-DOS style path detected: C:\code\tutorial2\TutorialTestPlugin\firebreath
  Preferred POSIX equivalent is: /cygdrive/c/code/tutorial2/TutorialTestPlugin/f
irebreath
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Community
  • 1
  • 1
bunndan
  • 2,717
  • 3
  • 18
  • 20
  • 1
    Are you talking about using a cygwin version of cmake and not the version downloaded for windows from cmake.org? – drescherjm Nov 11 '13 at 21:23
  • I just installed the cygwin version of cmake and it appears to not have generators for Visual Studio. Do you need to generate your visual studio project inside cygwin? – drescherjm Nov 11 '13 at 21:28
  • I downloaded and used `cmake-2.8.12.1-win32-x86.exe` off cmake.org. Used this installer on both machines and it works only on my personal computer. I'm unsure if I needed cygwin, as I am kind of new to these and was just following the tutorial. – bunndan Nov 11 '13 at 21:34
  • If you are running inside of cygwin. It will most likely use the cygwin version of cmake. – drescherjm Nov 11 '13 at 21:46
  • I was able to force my cygwin Termainal to use the windows version of cmake with the following command: /cygdrive/c/Program\ Files\ \(x86\)/CMake\ 2.8/bin/cmake.exe – drescherjm Nov 11 '13 at 21:47
  • I'm running the command inside a Command Prompt (cmd) – bunndan Nov 11 '13 at 21:50
  • You may want to use the cygwin setup program to remove its version of cmake. – drescherjm Nov 11 '13 at 21:56
  • Apologies, but how would I go about to use the Cygwin setup program to do that? – bunndan Nov 11 '13 at 22:00
  • 2
    Yeah - looks like @drescherjm is right about not using cygwin's version of CMake. Quote from the [docs in the OP](http://www.firebreath.org/display/documentation/Creating+a+New+Plugin+Project#CreatingaNewPluginProject-Generatingandopeningtheproject): "Note that the cygwin version of cmake has been reported to not work, so get the native platform version from the CMake website!" – Fraser Nov 12 '13 at 01:11
  • 1
    @bunndan. Hmm. I assumed that you installed cygwin by the setup program and understood how to add and remove packages. You download the setup program from here: http://cygwin.com/ do an internet install. I assume the folder is c:\cygwin. Then when you get to a screen with a search box at the top you type cmake. – drescherjm Nov 12 '13 at 13:06
  • 1
    After typing cmake in the search box. Open the Devel tree. Then find the line for cmake and click on the word Keep until it becomes uninstall. Then click next on the bottom of the dialog and cmake will be removed from cygwin. – drescherjm Nov 12 '13 at 13:30
  • Thanks, that worked! I'd like to have that as the accepted answer, if you'd like to add it. – bunndan Nov 13 '13 at 15:37

1 Answers1

16

The problem is you are using the cmake that is included in cygwin instead of the windows version of cmake. It appears that the current cygwin version is compiled without the generators for Visual Studio while the windows version has these.

In your case a simple way to get windows to use the windows version of cmake is to uninstall the cygwin cmake since it does not appear that you need that anyways.

An alternate method would have been adjusting your system path so that c:\cygwin\bin is after C:\Program Files (x86)\CMake 2.8\bin.

drescherjm
  • 10,365
  • 5
  • 44
  • 64
  • I believe you need to deselect that in the cygwin setup program. If this is not installed you can download it here: https://www.cygwin.com/ – drescherjm Dec 08 '16 at 14:14
  • 1
    I think its proper for `Cygwin cmake` to be compiled with `visual studio generators`. +1 for path setting. – Necktwi Jan 21 '17 at 05:12