make project under windows with cmake

Get answers to all your basic programming questions. No Ogre questions, please!
themean
Greenskin
Posts: 104
Joined: Wed Feb 29, 2012 11:50 am
x 1

make project under windows with cmake

Post by themean »

I want to use cmake instead of qmake. But can't find good ide that support cmake.
My question is how people made his projects under windows.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: make project under windows with cmake

Post by jacmoe »

Look in wiki..
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
themean
Greenskin
Posts: 104
Joined: Wed Feb 29, 2012 11:50 am
x 1

Re: make project under windows with cmake

Post by themean »

In wiki I found only how to build ogre with cmake.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: make project under windows with cmake

Post by jacmoe »

Many of the Setting Up An Application pages deal with CMake in combination with IDEs. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
themean
Greenskin
Posts: 104
Joined: Wed Feb 29, 2012 11:50 am
x 1

Re: make project under windows with cmake

Post by themean »

I make my project with qt creator that work very fine with cmake.
I copy/paste FindOgre.cmake and his dependency in my project but cmake cant find ogre.
Is need to set some environment variable?
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: make project under windows with cmake

Post by Transporter »

themean wrote:Is need to set some environment variable?
Yes! Have a look at FindOgre.cmake.
# Get path, convert backslashes as ${ENV_${var}}
getenv_path(OGRE_HOME)
getenv_path(OGRE_SDK)
getenv_path(OGRE_SOURCE)
getenv_path(OGRE_BUILD)
getenv_path(OGRE_DEPENDENCIES_DIR)
getenv_path(PROGRAMFILES)
I don't like these environmental dependency, because I don't have admin rights on all my computers at work and It's not possible to work with different ogre versions. I've built a workaround for Visual Studio. Let's see how to create one for cmake.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: make project under windows with cmake

Post by jacmoe »

Transporter you are wrong. ;)

If you need to work as a non-admin, then you can set the environment variables for your account only (user environment variables).

rundll32 sysdm.cpl,EditEnvironmentVariables is something you can paste into a shortcut.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58

Re: make project under windows with cmake

Post by CABAListic »

Besides, you don't even need to set them as environment variables. You can just as well set them in CMake as a CMake variable. The Find script uses either one if present.
themean
Greenskin
Posts: 104
Joined: Wed Feb 29, 2012 11:50 am
x 1

Re: make project under windows with cmake

Post by themean »

Thanks.
I create new win 7 environment variable OGRE_HOME with value path/2/ogre and now all is ok