[CMake] Generating makefile from Visual Studio Project (Migrating to Eclipse)

Olumide 50295 at web.de
Thu Dec 6 21:06:53 EST 2007


Olumide wrote:
> The directory C:\Work\Demo\TestTexturePlugin\CMakeFiles now contains, 
> among other files, Makefile2, which I assume is the NMake Makefile, and 
> Makefile.cmake. Where can I find more information about these files. I'm 
> not sure which files I need to perform the migration to eclipse.

I see there is a Makefile in C:\Work\Demo\TestTexturePlugin.

Anyway here is the result of running nmake
C:\Work\Demo\TestTexturePlugin>nmake

Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

[100%] Building CXX object CMakeFiles/TestTexturePlugin.dir/pluginMain.obj
_WINDOWS
c1xx : fatal error C1083: Cannot open source file: '_WINDOWS': No such 
file or directory
_DEBUG
c1xx : fatal error C1083: Cannot open source file: '_DEBUG': No such 
file or directory
WIN32
c1xx : fatal error C1083: Cannot open source file: 'WIN32': No such file 
or directory
_DEBUG
c1xx : fatal error C1083: Cannot open source file: '_DEBUG': No such 
file or directory
_WINDOWS
c1xx : fatal error C1083: Cannot open source file: '_WINDOWS': No such 
file or directory
_AFXDLL
c1xx : fatal error C1083: Cannot open source file: '_AFXDLL': No such 
file or directory
_MBCS
c1xx : fatal error C1083: Cannot open source file: '_MBCS': No such file 
or directory
NT_PLUGIN
c1xx : fatal error C1083: Cannot open source file: 'NT_PLUGIN': No such 
file or directory
REQUIRE_IOSTREAM
c1xx : fatal error C1083: Cannot open source file: 'REQUIRE_IOSTREAM': 
No such file or directory
CMAKE_INTDIR=Debug
c1xx : fatal error C1083: Cannot open source file: 'CMAKE_INTDIR=Debug': 
No such file or directory
TestTexturePlugin_EXPORTS
c1xx : fatal error C1083: Cannot open source file: 
'TestTexturePlugin_EXPORTS': No such file or directory
pluginMain.cpp
C:\Program Files\Alias\Maya6.5\include\maya\MTypes.h(222) : error C2632: 
'char' followed by 'bool' is illegal
C:\Program Files\Alias\Maya6.5\include\maya\MTypes.h(222) : warning 
C4091: 'typedef ' : ignored on left of 'unsigned char' when no
variable is declared
C:\Program Files\Alias\Maya6.5\include\maya\MTypes.h(226) : error C2143: 
syntax error : missing '}' before 'constant'
C:\Program Files\Alias\Maya6.5\include\maya\MTypes.h(226) : error C2143: 
syntax error : missing ';' before '}'
C:\Program Files\Alias\Maya6.5\include\maya\MTypes.h(226) : error C2059: 
syntax error : '}'
C:\Program Files\Alias\Maya6.5\include\maya\MObject.h(88) : fatal error 
C1083: Cannot open include file: 'stdio.h': No such file or
  directory
Generating Code...
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~3.NET\Vc7\bin\cl.exe' : 
return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 
.NET 2003\Vc7\bin\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 
.NET 2003\Vc7\bin\nmake.exe"' : return code '0x2'
Stop.



Here is my CMakeLists.txt file, generated by Jesper's script (from my 
original visual studio project/solution). The _WINDOWS, _DEBUG, etc that 
nmake complains about are in the add definitions section.

#######################################################################

project( TestTexturePlugin )

set(SOURCES
   C:/Work/Demo/TestTexturePlugin/pluginMain.cpp
)

include_directories(
   "C:/Program Files/Alias/Maya6.5/include"
   C:/Work/Demo/TestTexturePlugin/
)

add_definitions(
   -DWIN32 _WINDOWS _DEBUG WIN32 _DEBUG _WINDOWS _AFXDLL _MBCS NT_PLUGIN 
REQUIRE_IOSTREAM CMAKE_INTDIR=Debug TestTexturePlugin_EXPORTS
)

add_library( TestTexturePlugin SHARED ${SOURCES} )

target_link_libraries( TestTexturePlugin $(NOINHERIT) kernel32 user32 
gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 
odbccp32 Foundation OpenMaya )


More information about the CMake mailing list