I'm trying to migrate my Visual Studio solution to CMake.

I have two projects - generator (generator.exe generates C++ sources from text files) and myProj (includes some text files that have to be processed by generator.exe).  

What I want is: 

1. build generator project
2. use generator.exe from step1 to generate C++ source files from text files in project myProj
3. put those generated source files in resulting VS project for myProj

what I've so far:

```
###################################################################
# in root/generator/CMakeLists.txt:
set(SRC_LIST .... )
set(HDR_LIST .... )
add_executable(generator ${SRC_LIST} ${HDR_LIST})    

###################################################################
# in root/my_proj/CMakeLists.txt:

add_subdirectory(../generator/  ../generator/cmake_out)

# TRY TO BUILD GENERATOR.EXE. DON'T WORK, BECAUSE ../generator/cmake_out/ IS EMPTY YET
execute_process(COMMAND msbuild ../generator/cmake_out/generator.vcxproj)
# <copy generated files to ./src>

add_subdirectory(src)

###################################################################
# in root/my_proj/src/CMakeLists.txt:    

set(SRC_LIST SomeSource.cpp .... )
set(HDR_LIST SomeSource.h .... )

add_library(myProj STATIC ${SRC_LIST} ${HDR_LIST} )

```

So, what is wrong here? Why execute\_process() fails? Seems like CMake's order of execution is absolutely chaotic.