Calling CMake functions at build time
Is there a way to call CMake functions at build time. This is similar to this
install(CODE "MESSAGE(\"Sample install message.\")")
call_during_build(CODE "MESSAGE(\"Sample install message.\")")
The use case for this would be to say perform operations in a cross platform during build, say hard linking executables like (clang <-> clang++). I understand we can create a symlink between them with cmake -E create_symlink
during build. But there is no way to create a hardlink with this approach. We could generate a CMake script during configure, and then call the script with cmake -P
.
Thank You, Sibi Siddharthan