Error in your CMakeLists.txt

Find any bugs in Vega Strike? See if someone has already found it, or report them here!

Error in your CMakeLists.txt

Postby strook » Sun Apr 17, 2011 6:57 am

You have an error in your CMakeLists.txt.

you link to libraries with the command add_library(...),
but with no effect.

to reduce compile time by putting long time not modified sources into a lib,
you must do this:

define your headers:
SET(MY_HEADERS /src/bla.h
/src/bla2.h)

define the sources:
SET(MY_SOURCES /src/bla.cpp
/src/bla2.cpp)

define a lib(Must Be static):

add_library(MY_LIB STATIC ${MY_HEADERS} ${MY_SOURCES} )

and include the headers and the lib into the project:

add_executable(my_app ${MY_HEADERS} ${OTHER_SOURCES} )
target_link_libraries(my_app MY_LIB)

note that the sources ${MY_SOURCES} are now excluded from your app. they are in the lib and don't need to be included in your app a second time.
note that MY_LIB is not a variable name like ${MY_LIB} in target_link_libraries()
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Error in your CMakeLists.txt

Postby klauss » Mon Apr 18, 2011 4:49 pm

Interesting...

I'll try to look into it when I have the time - which lately is scarce, but seems simple enough ;)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Error in your CMakeLists.txt

Postby safemode » Mon Apr 25, 2011 12:19 pm

I'm guessing he is misreading the file.

nothing is compiled twice and linked twice and no libraries are compiled and never linked and no source is missing during compile. So either give some line numbers and examples or I would just attribute this to not correctly following the flow of the cmake file.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Re: Error in your CMakeLists.txt

Postby strook » Mon Apr 25, 2011 3:44 pm

hmmm i was shure you included them twice, cause you didn't include the headers.
on macosx it is needed to specify them in order that xcode can see them.

but yet, this isn't that importatant anyway, cause i'm going to move to eclipse on osx, cause i'll use distcc.

ok sorry. my fault. :oops:
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Re: Error in your CMakeLists.txt

Postby safemode » Tue Apr 26, 2011 9:08 am

Well if cmake isn't functioning correctly in mac I would be clueless. I dont use mac and everyone who has done a mac build and lived to tell the tale has made me ever more grateful that i never do any developing on macs. It's certainly possible things aren't working correctly on mac... I dont know and likely nobody else does cuz you can count the number of mac users that build VS on one hand on 3 fingers or less :)
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Re: Error in your CMakeLists.txt

Postby strook » Wed Apr 27, 2011 11:29 am

It isn't cmake, it is Xcode.
Cause in eclipse you see a copy of the filesystem beginning from the root folder of your project and eventually included subtrees.
In Xcode, you only see the files you specified in the CMakeLists.txt.

Compiling in Macosx is nearly the same as in Linux ( if you forget all the incompatibilities, special #ifdefs, etc.)
But it is hard enough to compile it without OpenGL and with ogre.
The vs GUI sources must be completely written anew.
And the other remaining vs sources...
I didn't compile them yet except those I already included.
I don't know wether I get the mission selector and vssetup running cause I didn't get gtk, gdk, and glibc running on Macosx.
Also I want get distcc running cause I got too many source files.
For this, I'll have to move to eclipse.
Also I'll have to check about cross compiling.
I have set up a minimal Linux system on Macosx with fink, but I must compile all the dependencies anew on Macosx to Linux libs to get it running with Macosx eclipse and distcc.
I have already set up a scaleable CMakeLists.txt that let's choose the libs to compile.
a minimal app is running.
You have seen it in pics.

I'm feeling a bit overwhelmed about the tasks to do.

I think I'll do a fallback and use the Mac just for compiling and make a bundle with all the libs included to run the vegaogre app as Linux app on Macosx, not as native app.

This way I could include a brunch of unmodified vs code and go over to developing the flight and including ogre into the app.
Also I'll use also OpenGL directly including it as a second render system as I intended it in the beginning.
It is advanced ogre programming, but doable.
This is the easiest way.

Else I would have to do too much modifications on old code.
El
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Re: Error in your CMakeLists.txt

Postby klauss » Fri Apr 29, 2011 4:58 pm

Wait... why do you need to build without OpenGL?

OpenGL is pretty standard is it not?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Error in your CMakeLists.txt

Postby strook » Fri Apr 29, 2011 5:09 pm

We will have ogre instead of OpenGL.
You know ogre can use OpenGL.
But I don't need to use the sdl and other incompatible libs like glut, glew, then.

Also it's because two render systems won't work.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Re: Error in your CMakeLists.txt

Postby klauss » Fri Apr 29, 2011 5:13 pm

IIRC, we still need SDL for joystick support.

So you should look into handing Ogre the SDL window, which I remember was possible (a bit awkward, but possible).

Done like that, you can actually mix Ogre and plain OpenGL - it's a tad tricky, but less tricky than rewriting everything IMO.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Error in your CMakeLists.txt

Postby strook » Fri Apr 29, 2011 5:15 pm

No I included ois :p
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Re: Error in your CMakeLists.txt

Postby klauss » Fri Apr 29, 2011 5:22 pm

strook wrote:No I included ois :p

Nice, I forgot about ois...

Still... wouldn't it make your life easier being able to mix Ogre and OpenGL?
At least it would make the transition possible in smaller steps.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Error in your CMakeLists.txt

Postby strook » Fri Apr 29, 2011 5:31 pm

It doesn't work. You would have to execute OpenGL and ogre draw functions after the other.
Ok, if using OpenGL for 2d and somehow switching to ogre and all is handled by another lib..... Maybe, but I'll better rewrite the gui source files(.cpp) to be handled by cegui.
It is a real ogre gui and has many possibilities (render-to-texture,btw, too).
Also, it is already set up and running.
All I have to do now is correct some errors. And rewrite some hanleable brunches of code.
I'm good experienced with vs and ogre now.
It won't last long to get a programming prototype of vs.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Re: Error in your CMakeLists.txt

Postby strook » Sat Apr 30, 2011 2:46 am

i'm using sdl now for the vs sound code.
installing the sdl dependencies was total uncritical :)
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am



Return to Bug Triage

Who is online

Users browsing this forum: No registered users and 2 guests