Fwd: [CMake] Re: FindSDL.cmake and mingw / msys

PA Galmes pagalmes.lists at gmail.com
Sat Mar 31 09:07:52 EST 2007


---------- Forwarded message ----------
From: PA Galmes <pagalmes.lists at gmail.com>
Date: Mar 31, 2007 4:07 PM
Subject: Re: [CMake] Re: FindSDL.cmake and mingw / msys
To: "E. Wing" <ewmailing at gmail.com>



On 3/28/07, E. Wing <ewmailing at gmail.com> wrote:
>
>
> So I'm concerned about breaking backwards compatibility. I think the
> public variables exported are the same ones that have been in use
> before I started mucking with things.


I agree, backward compatibility is something really important.
Thus, users of the new CMake shoudln't need to change their
existing scripts. That means we shouln't change the behavior
of exiting variables. But we can create new ones!


SDL_LIBRARY_FLAGS is an interesting idea, but the backwards
> compatibility thing bothers me here.


Maybe this could be implemented in a major release of CMake, thus
developers would be aware that changes are required to their scripts.
As soon as it is advertized enought, it's ok.


As for CMakeSetup requiring
> values, isn't it already the case that none of these values are
> actually required anyway?


Isn't that a function of the REQUIRED
> parameter of the FIND_PACKAGE command and not the FindSDL script
> itself. My expectation is that SDL_LIBRARY_TEMP would complain in this
> case.


Currenly, under Windows, when I click on the configure button in CMAKE, it
says:

- I did not found "qmake.exe",
- so I set the value for the QMAKE_EXECUTABE variable,
- click on configure one more time.

- It says, "I did not found SDLMAIN_INCLUDE, SDLMAIN_LIBRARY,
SDLIMAGE_INCLUDE, SDLIMAGE_LIBRARY"
- I set those variables,
- click on configure one more time.

...

And then the "Ok" button is not greyed anymore, so I can finish the setup.

To me, the fact that it asks for the variables means they are "required".
Thus, once I set all the "required" variables, things should compile.

Instead of all of this, what if we simply renamed SDL_LIBRARY_TEMP to
> SDL_LIBRARY_BOOTSTRAP or PUT_SDL_LIBRARY_HERE and just document that
> the user must fill the value if not found.
>

And what about calling that variable SDL_LIBRARY_DIR (with
for example the value "c:\My project\lib") and deducing from
that all the other variables.

I think that the name SDL_LIBRARY_DIR is clearer than
SDL_LIBRARY_BOOTSTRAP or PUT_SDL_LIBRARY_HERE ;-)


To conclude, we would have:

SDLMAIN_INCLUDE,
SDLMAIN_LIBRARY,
SDL_LIBRARY_DIR

Then the user would declare:

find_package(SDL REQUIRED)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
LINK_LIBRARIES(${SDL_LIBRARY} ${SDLMAIN_LIBRARY})

And that's it !

What do you think ?

BTW, why can't we just ask for:

- SDL_INCLUDE
- SDL_LIBRARY_DIR

instead of the the other variables ?

Note:

You should check that link also (and the answer in english):
http://www.c-plusplus.net/forum/viewtopic-var-t-is-162085.html
I had the same issue, and found the answer reading the article.

I think some more documentatation should be added,
because if you search on google for "findSDL" or
"find_package(SDL REQUIRED)" you won't find what
you are looking for.


Regards,
-- 
Pierre-André Galmes
Free Software consultant
StarXpert - www.starxpert.fr
6, rue Eugène Varlin - 75010 Paris


-- 
Pierre-André Galmes
Free Software consultant
StarXpert - www.starxpert.fr
6, rue Eugène Varlin - 75010 Paris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070331/82b029db/attachment-0001.html


More information about the CMake mailing list