[CMake] Post CMake step

Brandon Van Every bvanevery at gmail.com
Mon Oct 29 15:42:24 EDT 2007


On 10/29/07, Tal Blum <tblum at bbn.com> wrote:
>
> Is there a way to define a step in cmake that will do something after cmake
> is run? Since I needed MSVC several solution files I used different
> directories, each one with its own CMakeCashe.txt file. I want to create a
> shortcut or a soft link to these files is there a way to run that command
> from within a CMakeLists.txt file or should call it from a script outside of
> CMake?

You know the location of CMakeCache.txt file at configuration time,
it's in ${CMAKE_BINARY_DIRECTORY}.  If your "symbolic linker" can
point to files that don't exist yet, you can use EXECUTE_PROCESS to
create it at configuration time.

If your "symbolic linker" requires CMakeCache.txt to already exist,
then you can use ADD_CUSTOM_TARGET(targetname ALL ...) to create the
link the 1st time the generated build system is run.  You could
ADD_DEPENDENCIES to force it to always be built first no matter what.
I suppose this doesn't answer the problem of "I just finished CMake, I
don't know what to do next, there's no helpful link."  The user has to
know what to do next, how to get to the generated build system and run
it.  Is that a big deal?


Cheers,
Brandon Van Every


More information about the CMake mailing list