I am trying to run a script after completing the installation of CMake. I found this thread on SO , but it still does not work, because my script depends on the goals set.
Basically, my script runs before the goals are set. This is because CMake seems to put code that sets the goals of the subdirectories at the end of cmake_install.cmake
Here is an example illustrating the problem; CMake file subdirectory:
Top Level CMake File:
# Top-level CMakeLists.txt cmake_minimum_required(VERSION 2.8) add_subdirectory(src) install(CODE "execute_process(COMMAND ls ${CMAKE_INSTALL_PREFIX}/bin/foo)")
Running make install gives:
-- Install configuration: "debug" ls: cannot access /tmp/dummy/bin/foo: No such file or directory -- Installing: /tmp/dummy/bin/foo
Any idea how I can get around this behavior? Thanks!
source share