[CMake] INSTALL and Up-to-date problem

Florian Stinglmayr fstinglmayr at gmail.com
Wed Aug 24 05:00:36 EDT 2011


Hello List!

I have a rather unusual setup of graphic files:

someexe/gfx/
-- *.png
-- variant1
-- -- subvariant1
-- -- -- *.png
-- variant1
-- -- subvariant2
-- -- --*.png
-- variant2
etc.

So I have a general graphics folder, and for specific variants of the
software -- and its sub variants -- specific folders containing only a
few graphics that differ in that very specific variant. Due to space
restrictions on the target hardware, we currently copy the specific
graphics (e.g. those in variant1/subvariant2) over the generic ones we
install first. File names are the same, say you may have a generic
"background1.png", and in a sub variant you have a specific
"background1.png" that differs somehow (be it dimensions, colours
etc.). I mirrored this behaviour in cmake like this:

# Generic ones
FILE(GLOB GFX1 "${TARGET}/gfx/*.*")
# Specific ones
FILE(GLOB GFX2 "${TARGET}/gfx/${VARIANT}/${SUBVARIANT}/*.*")

INSTALL(FILES ${GFX1} ${GFX2}
             DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET}/gfx")

Now what happens: cmake installs the generic files, and when it
supposed to install the specific ones it says "Up-to-date:".

I have checked, both ${VARIANT} and ${SUBVARIANT} are properly set.
I have also checked: cmake installs only the generic ones.

Is there anyway to force installation of certain specific files,
regardless if cmake things they are "Up-to-date"?
Or should I just reverse installation order, so cmake says on the
generic ones that they are "Up-to-date"?

Thanks in advance,
Florian Stinglmayr


More information about the CMake mailing list