[CMake] more targets to run in parallel

Andrea Crotti andrea.crotti.0 at gmail.com
Mon Feb 20 11:48:27 EST 2012


Going back to the original question, I realised that my approach could 
not work.

In short the list of targets and commands that I need to generate depend 
on a file,
which is generated from a python script.

So I thought I could use execute_process before the foreach:

execute_process(
   OUTPUT_FILE ${INSTALLED_EGGS_LIST}
   COMMAND "${PYTHON_EXECUTABLE} ${GEN_DEPENDENCY_SCRIPT} 
${BUILD_APP_OPTIONS}"
   )

foreach (egg ${INSTALLED_EGGS_LIST})
   set(egg_install ${egg}_install)
   set(egg_unzip ${egg}_unzip)
   add_custom_target(${egg_install})
   add_custom_target(${egg_unzip})

   add_custom_command(
     TARGET ${egg_install}
     COMMAND ${PYTHON_EXECUTABLE} ${egg} setup.py bdist_egg -d 
${DESTINATION}
     WORKING_DIRECTORY ${egg}
     )

   add_custom_target(
     TARGET ${egg_unzip}
     COMMAND ${PYTHON_EXECUTABLE}
     )
endforeach ()


But now *why* the process is actually not executed every time I run 
"cmake", as I was expecting?


More information about the CMake mailing list