CMake lifecyle phases
Hi guys,
I am new to CMake and tried to build my sample "hello world" app from src to final executable.
I found POST_BUILD step very useful to make executable bin from build output directly from CMake instead of using VS or etc.
But I didn't find the way to do it because no one command was triggered on POST_BUILD phase.
There is the CMakeLists.txt example:
cmake_minimum_required (VERSION 2.8)
project (sample)
set(SRC_FILES src/main.cc)
add_executable(${CMAKE_PROJECT_NAME} ${SRC_FILES})
add_custom_command(TARGET ${CMAKE_PROJECT_NAME}
PRE_BUILD
COMMAND echo "This is pre build"
)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME}
POST_BUILD
COMMAND echo "This is post build"
)
OS: Windows 10 x64
Compiler: MSVC 19.10.25019.0
Cmake: 3.9 v
Thanks.