Find ogre directory with cmake findpackage

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

Find ogre directory with cmake findpackage

Post by themean »

I want my cmake script to copy all ogre plugins in my build directory. But with find_package i know only how to get binaries not directory of them or something else useful
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Find ogre directory with cmake findpackage

Post by jacmoe »

Code: Select all

if(UNIX)
    get_filename_component(OGRE_PLUGIN_DIR_LINUX ${OGRE_Plugin_OctreeSceneManager_LIBRARY_REL} PATH)
    set (OGRE_PLUGIN_DIR_LINUX ${OGRE_PLUGIN_DIR_LINUX} CACHE STRING "Ogre plugin dir (release)")
endif(UNIX)
That code uses the get_filename_component macro/function (?) to extract the path from OGRE_Plugin_OctreeSceneManager_LIBRARY_REL passing in the PATH argument, which results in a path.
You can probably derive something which solves your problem. ;)
/* 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: Find ogre directory with cmake findpackage

Post by themean »

Thanks it was useful for me :)
themean
Greenskin
Posts: 104
Joined: Wed Feb 29, 2012 11:50 am
x 1

Re: Find ogre directory with cmake findpackage

Post by themean »

Is it possible to get directly ogre plugins directory and list of plugins ??
themean
Greenskin
Posts: 104
Joined: Wed Feb 29, 2012 11:50 am
x 1

Re: Find ogre directory with cmake findpackage

Post by themean »

I found what i need in FindOGRE.cmake
Post Reply