[Cmake] CMAKE and Visual Studio .NET 2003

Brad King brad.king at kitware.com
Tue Jul 13 17:53:20 EDT 2004


Oliveira Marcelo wrote:
> Hi users !!!
>  
> I'm try to set my CmakeList with Visual Studio .NET 2003. So i create a 
> simple Window Form Aplication (.NET). VS 
> generated the following files - Form1.cpp, stdafx.cpp, 
> AssemblyInfo.cpp, Form1.h, resource.h, stdafx.h. Then i tryed to set the 
> CmakeList like this:
>  
> 
> PROJECT( teste )
>  
> ADD_DEFINITIONS(-D_AFXDLL)
>  
> SET(CMAKE_MFC_FLAG 6)
> 
> SET(teste_SRCS
>    Form1.cpp
>    AssemblyInfo.cpp    
>    app.rc    
>    stdafx.cpp
>    )
>  
> IF(WIN32)
>   LINK_LIBRARIES(
>     wsock32
>   )
> ENDIF(WIN32)
> 
> FIND_PACKAGE(ITK)
> IF(ITK_FOUND)
>    INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
>    MESSAGE(FATAL_ERROR
>            "Cannot build without ITK.  Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
>  
> INCLUDE_DIRECTORIES(C:/"Arquivos de programas/Microsoft Visual Studio 
> .NET 2003/Vc7/PlatformSDK/Include/")
> INCLUDE_DIRECTORIES(C:/"Arquivos de programas/Microsoft Visual Studio 
> .NET 2003/Vc7/Include/")
> LINK_LIBRARIES(C:/"Arquivos de programas/Microsoft Visual Studio .NET 
> 2003/Vc7/lib/")
>  
> ADD_EXECUTABLE (teste WIN32 ${teste_SRCS})
> TARGET_LINK_LIBRARIES(teste ${ITK_LIBRARIES} )
>  
>  Cmake execute without errors, but when i tryed to BUILD Solution,  the 
> sln made by Cmake,  this error happen (tank's a lot for your help)
>  
> Output Window
> 
>   	  	
> 
> Compiling...
> AssemblyInfo.cpp
> \Doutorado\teste\AssemblyInfo.cpp(3) : error C2653: 'System' : is not a class or namespace name

I do not know what is causing this error, but I can tell you that you do 
not need the two INCLUDE_DIRECTORIES or the last LINK_LIBRARIES lines to 
get an MFC application to build.  Those directories should be included 
in the build by default.

Does AssemblyInfo.cpp build in a native MSVC project?

-Brad


More information about the Cmake mailing list