[Kde-games-devel] KGoldrunner update
Parker Coates
parker.coates at gmail.com
Mon Apr 27 05:44:52 CEST 2009
On Sun, Apr 26, 2009 at 10:25 PM, Ian Wadham wrote:
> BTW, are wildcards acceptable in CMake?
>
> If so, I could make my list of game-data files read "game_*.txt hi_*.dat
> rec_*.txt" and the problem should never happen again. Similarly with
> lists of files for graphics and sound themes.
CMake has a GLOB function that allows you to get a list of all files
matching a certain expression. However, it's use is generally
discourages, because it doesn't play well with caching.
Example:
- Your CMakeLists.txt installs all text files with "*.txt"
- You run cmake. It expands the pattern to a list of files and stores
these in the cache. Everything works great.
- You add a new .txt file, but don't update CMakeLists.txt because the
existing pattern should handle it.
- You rerun cmake, but because the CMakeLists.txt hasn't changed,
CMake just uses the existing CMakeCache.txt.
- You build and install, but your new file doesn't get installed,
because CMake doesn't know it's there.
So if you use GLOB you had better get use to doing "cb; rm
CMakeCache.txt; cs". For example libkdegames/carddecks/decks uses
globs, which makes adding new card backs a bit of a hassle.
Parker
More information about the kde-games-devel
mailing list