deeiip
deeiip

Reputation: 3379

.sln file is not being generated

I have a cpp project with logical folders. Now I want to work on the project in visual studio. So I've written a cmakelist like:

project(myapp)
cmake_minimum_required(VERSION 2.8)
file(GLOB myapp_SRC
    "*.h"
    "*.cpp"
)

add_executable(myapp ${myapp_SRC})

But after configuration at the build directory a file named CMakeCache and a directory named CMakeFiles is only being generated? what is going wrong? I'm beginner in CMake

Upvotes: 0

Views: 377

Answers (1)

Hugo Corrá
Hugo Corrá

Reputation: 14799

Probably the CMake doesn't know about your Visual Studio, try something like:

cmake . -G "VisualStudioVersion"

VisualStudioVersion should be replaced by one of the versions listed below (considering you are using the last CMake version):

  Visual Studio 10           
  Visual Studio 10 IA64      
  Visual Studio 10 Win64     
  Visual Studio 11           
  Visual Studio 11 ARM       
  Visual Studio 11 Win64     
  Visual Studio 6            
  Visual Studio 7            
  Visual Studio 7 .NET 2003  
  Visual Studio 8 2005       
  Visual Studio 8 2005 Win64 
  Visual Studio 9 2008       
  Visual Studio 9 2008 IA64         
  Visual Studio 9 2008 Win64 

...also, don't forget you should open the Visual Studio Command Prompt, instead of the normal cmd.exe (or you should export all environment variables).

Upvotes: 1

Related Questions