[CMake] cmake vista tutorial?

Mike Jackson mike.jackson at bluequartz.net
Thu Aug 28 08:23:39 EDT 2008


Craig, here are some tips from using CMake that might help you get over the
"hump".
You _first_ need to have a valid CMakeLists.txt file. The simplest file
would be:

# Start CMakeLists.txt
project(HelloWorld)
add_executable(HelloWorld main.cpp)
#End CMakeLists.txt

Put that in a folder called "HelloWorld" on you drive.
Then also in that folder create your "main.cpp" source file:

// --- Start main.cpp

#include <iostream>
int main (int argc, char const *argv[])
{
  std::cout << "HelloWorld" << std::endl;
  return 0;
}

Create a Second folder _within_ the "HelloWorld" folder named "Build"

NOW run CMakeSetup.exe.

Fill in the text fields for "Where are the source files" with
C:/Path/to/HelloWorld
and "Where to build the project" with C:/Path/To/HelloWorld/Build

Click the "Configure" button. Select the "Visual Studio 2005 Project" as the
type of project files to generate.
When the is complete, click the "Generate" button. After that is complete,
cmakesetup.exe will quit. Look in the "Build" folder for "HelloWorld.sln"
which will be your VS solution file. Open that up and compile and run..

Let us know if that works.

Mike Jackson
www.bluequartz.net


On Thu, Aug 28, 2008 at 12:10 AM, Craig Miller <
craig.miller at spatialminds.com> wrote:

>  I've read good things about cmake and would like to start using it.  I
> spent the afternoon reading the online tutorials and trying to get a simple
> hello world c++ project setup and running.  I started with the documentation
> at http://www.cmake.org/HTML/Documentation.html and first followed the
> "Installing CMake" tutorial which was straight forward enough.  I then tried
> following the "Running CMake" tutorial and things started falling apart.
> There seemed to be a number of mandatory steps missing from the tutorial.
> Before I throw in the towel, is there a recent tutorial that walks through
> setting up an entire project from beginning to end using the latest cmake
> and running under Vista(VS 2005 via nmake)?
>
>
>
> As I know some will ask, a few of the items that weren't addressed in the
> tutorial included:
>
>
>
> -          Instructions to run the CMakeSetup.exe w/o having first created
> the CMakeLists.txt file in the src directory.
>
> -          No mention that CMake must be run in an environment where the
> Visual Studio vcvars.bat has been executed (which isn't likely if you are
> running the GUI from the start menu).
>
> -          No mention of security issues related to Vista.  After
> attempting to run several programs as Administrator and still failing, I
> gave up after spending a fair amount of time w/ google looking for answers.
> Vista seems to be introducing the most problems as a result of improved
> security.
>
> Any links to recent tutorials would be very appreciated.
>
>
> Thank you.
>
> Craig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080828/c63976de/attachment.htm>


More information about the CMake mailing list