[CMake] FindSDL

Asmodehn Shade asmodehn at gmail.com
Tue Aug 16 23:48:27 EDT 2005


Hi everyone,

This is my first shot with CMake, after a short time spent working
with autotools. And so far I find it great :-) I am trying to port my
software to a full Cmake buildchain...

Thank devs for that nice tool, BUT I still want more :-)

So my first question is : 

- Once I have done my "FIND_PACKAGE( SDL REQUIRED )" What should I do
to add the include and the link directories and libraries ? something,
or everything should be ready ?
I just want to be sure I dont miss anything
And btw where should I post the bug I can find on a module ?

and the second one :

- On windows, there is no actual test for that library. So nothing is
found, but still the VS project files are created... without the
dependency. ( I am using last release )

Now what I want is : if the library is not found, then try_download it
and try_build it. Yeah it looks like a dumb package system on windows
:-) I just want that in the case where there is no other package
system. if there is, the build mechanism for the package system should
prevent somehow the "try_download and try_build" from cmake to happen.
The check for "required" should be done after the try_build...

Let's say that I want to build it like any other dependency with
cmake. How can I do that ?

I was thinking about making my own FindSDL.cmake that :
- call the default one (how ?)
- then check if it has been found or not.
- if found, set the usefull variable and return (which variables?)
- If it is not found then I download the source (how ?)
- copy my CMakelists.txt for SDL to the folder where the source is.
- build it simply as a dependency.
- set the useful variables and return.

Can you confirm this is the good way to do it ?
thanks if you can help for the obvious steps that I have missed if any.

Another Idea ? (Maybe a GET_PACKAGE command, or another option in
FIND_PACKAGE...)

Thank you very much for the help ;)

--
AlexV


More information about the CMake mailing list