MantisBT - CMake
View Issue Details
0014019CMakeCMakepublic2013-03-15 10:062016-06-10 14:31
Luc J. Bourhis 
Kitware Robot 
normalfeatureN/A
closedmoved 
CMake 2.8.10 
 
0014019: ExternalProject_Add: please support python setup.py style of install
Many python extensions are installed by relying on a distutils scheme. They ship with a Python script setup.py and the installation proceeds with python setup.py install in the simplest case. The most general scheme is a two-step process: python setup.py build [options] (or build_ext instead) and then python setup.py install [options]. Performing the latter without options always does the right thing.

It would be nice if ExternalProject_Add supported new arguments to set it up out of the box.
I propose the following:

ExternalProject_Add(
...
  PYTHON_SETUP 1 # switch distutils style of installing on/off
  PYTHON_EXECUTABLE path # which Python interpreter to use
                                            # default: ${PYTHON_EXECUTABLE} as found by FindPython
  PYTHON_BUILD_COMMAND # arguments passed to python setup.py for the build stage
                                                # default: build
  PYTHON_INSTALL_COMMAND # arguments passed to python setup.py for the install stage
                                                 # default: install
)
No tags attached.
Issue History
2013-03-15 10:06Luc J. BourhisNew Issue
2013-03-15 11:53David ColeNote Added: 0032640
2013-03-15 12:00Luc J. BourhisNote Added: 0032641
2016-06-10 14:28Kitware RobotNote Added: 0042251
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0032640)
David Cole   
2013-03-15 11:53   
Isn't this just as simple, and already out of the box?

    find_package(PythonInterp REQUIRED)

    ExternalProject_Add(
      # ... download stuff for the project ...
      CONFIGURE_COMMAND ""
      BUILD_COMMAND ${PYTHON_EXECUTABLE} setup.py build
      INSTALL_COMMAND ${PYTHON_EXECUTABLE} setup.py install

      BUILD_IN_SOURCE 1
        # I assume for python setup.py to work, the source directory
        # and the build directory must be the same?
    )

Why complicate ExternalProject with special keywords for python projects?

Should it also support Ruby gems, and Java jar files, and other languages too, each with their own special case keywords and default build and install command lines?
(0032641)
Luc J. Bourhis   
2013-03-15 12:00   
You are correct about BUILD_IN_SOURCE. Then that's 4 lines when it could be just 1. For a project with a significant number of external dependencies of this kind to install (I have got one with more than a dozen), that matters in term of readability. As for supporting for Ruby gems and Java jar files, why not indeed, if somebody requests it. The strong point of CMake is to cater for common scenarios out-of-the-box imho.
(0042251)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.