CMake as Crossplatform solution? testers?

From CMake site:

Generates native build files (e.g., makefiles on Unix; workspaces/projects on MS Visual C++). Therefore, standard tools can be used on any platform/compiler configuration.

Cmake can generate Codeblocks, Eclipse and Xcode projects too.

I’ve created some CMake Build files for Openframeworks. I currently have the libs/openframeworks and im working on the addons. Im open to help create a CMake solution for 0.06. If you are interested in the CMake build files for testing just reply. I promise i will polish them until they fully work on every platform.

Edit:
I have tested the automated generation of a Kdevelop project, compiled and ran flawlessly.
And i have tested CMake integration within Eclipse Ganymede. It also works fine.
Naturally, i have tested the simple Makefiles generation, and works fine.

hey sounds great - I’d love to see that in action. we’ve been looking at different cross patform makefile generators, and not had the time to get a handle on them. I would love to give cmake a try. I think they could really simplify our development process.

you can try this release of OF (mac link)
http://www.openframeworks.cc/files/0058-…-de-Fat.zip
arturo has the linux version done, pc is on the way.

thanks!
zach

Perhaps if you can wait a few days i can polish the CMake stuff and you can release a generic cmake based. I will start with your code right now.

CMake can handle really large projects, it’s already handling the KDE project.

[quote author=“zach”]
you can try this release of OF (mac link)
http://www.openframeworks.cc/files/0058-…-de-Fat.zip
zach[/quote]

Sorry but i downloaded twice and on a second machine, it seems the ZIP is damaged:

  
$ file 0058-Poco-Xcode-Fat.zip   
0058-Poco-Xcode-Fat.zip: Zip archive data, at least v2.0 to extract  
  
$ unzip 0058-Poco-Xcode-Fat.zip   
Archive:  0058-Poco-Xcode-Fat.zip  
  End-of-central-directory signature not found.  Either this file is not  
  a zipfile, or it constitutes one disk of a multi-part archive.  In the  
  latter case the central directory and zipfile comment will be found on  
  the last disk(s) of this archive.  
unzip:  cannot find zipfile directory in one of 0058-Poco-Xcode-Fat.zip or  
        0058-Poco-Xcode-Fat.zip.zip, and cannot find 0058-Poco-Xcode-Fat.zip.ZIP, period.  

would you upload the file again?

hi

I would like to help you on your task. I am using

os x 10.5.4
eclipse 3.4.0

Great, so, let’s just wait until zach gives us the correct link to 0058 (0.05.8?) so no work is wasted and 0.06 could have CMake ready.

Maybe a couple of hours?

I’m sorry - we’ll up it shortly (both theo and I are traveling right now)… in the meantime, can you try the svn?

http://svn.openframeworks.cc/browser/li-…-rameworks-

–> svn co http://svn.openframeworks.cc/OF/trunk

it’s up to date, you’ll need the poco library to link / compile against. it might be a little tricky on pc, but there are mac versinos of poco around. Also, this might be useful (is earlier, but the svn+this would be close to a mac release):

http://www.openframeworks.cc/files/0057-Poco-Xcode.zip

hope that helps!!
zach

Great idea! I’d like to help out with testing, etc, too. I’m on OSX10.4+XCode and Ubuntu+CodeBlocks

I also use CMake, so can help out too.

Cheers,
P.

[quote author=“zach”]I’m sorry - we’ll up it shortly (both theo and I are traveling right now)… in the meantime, can you try the svn?

http://svn.openframeworks.cc/browser/li-…-rameworks-

–> svn co http://svn.openframeworks.cc/OF/trunk

it’s up to date, you’ll need the poco library to link / compile against. it might be a little tricky on pc, but there are mac versinos of poco around. Also, this might be useful (is earlier, but the svn+this would be close to a mac release):

http://www.openframeworks.cc/files/0057-Poco-Xcode.zip

hope that helps!!
zach[/quote]
Something is wrong in the SVN, the first link goes to the SVN browser which is rev 164, the other one

–> svn co http://svn.openframeworks.cc/OF/trunk

Should check it out (rev 164), but insted it checks out revision 110 which does not have Events. WTF?

if the browser is ok, then the url should be /trunk/openFrameworks/ but i can’t check that out with svn.** Are there two SVN servers???** :shock:

  
$ svn list  [http://svn.openframeworks.cc/OF/trunk](http://svn.openframeworks.cc/OF/trunk)  
app/  
communication/  
graphics/  
ofAddons.h  
ofMain.h  
sound/  
utils/  
video/  

  
$ svn co -r 164 [http://svn.openframeworks.cc/OF/trunk/](http://svn.openframeworks.cc/OF/trunk/) openFrameworks  
svn: requerimiento REPORT falló en '/OF/!svn/bc/110/trunk'  
svn: No such revision 164  

Okay i reply myself just to leave it documented. After inspecting the-script-for-eclipse i noticed the corrrect svn URL:

  
svn co [http://svn.openframeworks.cc/openFrameworks/trunk/openFrameworks](http://svn.openframeworks.cc/openFrameworks/trunk/openFrameworks)  

  
svn list [http://svn.openframeworks.cc/openFrameworks/trunk/openFrameworks](http://svn.openframeworks.cc/openFrameworks/trunk/openFrameworks)  
app/  
communication/  
events/  
graphics/  
ofMain.h  
sound/  
utils/  
video/  
  

yeah I’m sorry -

svn co http://svn.openframeworks.cc/openFrameworks/trunk

should be the right one, used to be OF, we’ve been restructuring the svn and I think have kept OF as a reference.

thanks!
zach

This are the needed files for building rev 164 with CMake.

http://zarzamora.com.mx/of/openFramewor-…–CMake.zip

The ZIP contains a tree with the needed files, be sure to put each where it belongs, should be easy.

How to use CMake (at least on Linux)

Generate Makefiles:

  
1. cd libs/openFrameworks  
2. mkdir build  
3. cmake ../  
4. make  
  

Generate KDevelop project:

  
1. cd libs/openFrameworks  
2. mkdir build  
3. cmake ../ -G KDevelop3  
4. (Kdevelop project is generated in build/ folder)  
  

In either case, after compilation the libs will be saved in openFrameworks/libs

In all cases ignore the warnings of

  
../fmodex/inc/fmod_errors.h  

Ultra simple use?
For KDevelop and Makefiles i created scripts that automate the task. But if you inspect them you will see they are extremely simple, just the above 3 lines.

The idea is to create a special folder named build and generate the Makefiles/KDevelop-project there to avoid spilling lots of files in the tree.

Remeber that rev164 requires POCO libraries.

Want to test it on other platforms?
Check the generators-avaiable-in-your-platform-here. But the list is incomplete because KDevelop is not listed and works.

Finally
These are just the openFrameworks CMake files almost as a proof-of-concept, i accept comments and, better, your testing and critics to enhance them and hopefully prepare them for v0.06.

I currently use OF,CMake and Kdevelop widely for a personal project.

UPDATE:

I’m testing with Visual Studio 2005. It currently generates a Solution with a lot of projects. But i got my first glitch. In the original bundle the Linux version has Glut in a folder named glut-3.7.6 but in the windows bundle it is named just glut. I think the correct is to name it just glut and to symlink on linux.

A similar issue with GLee, in linux there is GLee and on windows there is GLee/include.

I guess i’ll update the ZIP file as soon as i find & fix all the glitches, hope none has used it yet or if you use it beware i am using the linux FAT file of 0.05 + libs/openframeworks from SVN rev 164, the directory structure in both is a bit different.

Dont worry on linux it should work perfectly.

And to generate Code::blocks et. al. you need CMake 2.6.

With CMake 2.4 you can only generate Makefiles and KDevelop projects, which should enable you to work on Eclipse Ganymede & CDT too. Check-this and follow the screenshots to get a CMake building system integrated in Eclipse.

A standarization of library locations is urgent !!

testing!

Trying with CMake 2.6 for XCode. I get this:

[localhost]$ cmake …/ -G XCode
CMake Error: Could not create named generator XCode

I’m guessing something needs to be configured, but after googling around a little I have no leads on how to do that.

[quote author=“joshuajnoble”]Trying with CMake 2.6 for XCode. I get this:

[localhost]$ cmake …/ -G XCode
CMake Error: Could not create named generator XCode

I’m guessing something needs to be configured, but after googling around a little I have no leads on how to do that.[/quote]

Check that your CMake version has support for XCode, the easiest way is to run the OSX’s CMake version.

Ooops. Forgot to post about that. Right after I wrote my earlier post I figured out how to actually use CMake, and it built the XCode project, but after opening the project all the dylib references were in the project but none the dylibs were built, so XCode couldn’t actually run the project. Seems like either the XCode project needs to be built out configured so that it can compile all those libs in its build, or maybe CMake could compile them ahead of time so the project could link to them.

hi josh,

can you post a zip of what you did, I’m interested in testing on the mac side…

looks like there is some good info here:
http://www.cmake.org/Wiki/CMake:MacOSX-Frameworks
http://www.cmake.org/Wiki/CMake:Bundles-And-Frameworks

thanks!
zach

here it is…Definitely could be something I’ve misconfigured or otherwise, I’ve not had much time to check too closely into what’s up with it and how it works.

http://thefactoryfactory.com/openFrameworks.zip