Anyway just to answer myself, I managed to solve all my problems.
Now I first generate at cmake file a file with some paths, and from
these paths I generate all the targets that I need.

I also create a list with all the targets to make it easy from other targets to depend on them.

Here below the simplified code (if there are better ways I'm all hears)


foreach (egg ${egg_list})
  get_filename(${egg})
  set(egg_install ${RESULT_VAR}_install)
  add_custom_target(${egg_install})
  # generate the list of targets to create more easily dependencies
  list(APPEND target_install_list ${egg_install})

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

endforeach ()

add_custom_target(install_all_eggs ALL
  DEPENDS ${target_install_list}
  )

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to