I'm trying to add an external project, that doesn't use cmake, to my project that does use cmake:
include(ExternalProject)
ExternalProject_Add( MatrixSSL
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/matrixssl
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matrixssl
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh
BUILD_COMMAND echo "Built!"
INSTALL_COMMAND echo "Installing!"
)
Here the script ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh
will do
whatever is required to configure that external project (aka, generate the Makefile's).
My problem is that when I edit configure_matrixssl.sh
and re-run 'make', then
the configure step is not repeated. Therefore I want to add a dependency of
the 'configure step' on my script; when the modification time of my script is newer
than the modification time of the configure timestamp file, it should redo the
configuration step.
I tried,
ExternalProject_Add_Step( MatrixSSL configure
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh
)
but this has no effect.
Then I tried,
ExternalProject_Add_Step( MatrixSSL configure
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh
)
but that gives me the error
CMake Error: Attempt to add a custom rule to output "/home/carlo/projects/aicxx/ai-evio-testsuite/ai-evio-testsuite-objdir/evio/matrixssl/src/MatrixSSL-stamp/MatrixSSL-configure.rule" which already has a custom rule.
Removing the CONFIGURE_COMMAND
from the ExternalProject_Add
has no effect.
How can I do this?