I want to use ExternalProject_Add
function to install cmake enabled projects. I need to control the building and installation processes. More specifically, I want that cmake build and install in specific directories.
There is an option to select a path where to put the source directory: SOURCE_DIR
. Is there something equivalent for BUILD_DIR
and INSTALL_DIR
? I did not see anything alike.
There is a PREFIX
option:
Root dir for entire project
What does it mean exactly? An how does cmake's ExternalProject_Add do the installation?
Edit:
This work, but I have no control over source directory and it does not install the library:
ExternalProject_Add(
wjelement-project
GIT_REPOSITORY "https://github.com/netmail-open/wjelement.git"
GIT_TAG "v1.2"
UPDATE_COMMAND ""
PATCH_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
#SOURCE_DIR "${MY_SOURCE_ROOT}/wjelement"
BINARY_DIR "${MY_BUILD_DIR}/wjelement"
INSTALL_DIR "${CCT_INSTALL_DIR}/wjelement"
)
- If I uncomment
SOURCE_DIR
, it does not clone fromGIT_CLONE
but try to get source fromSOURCE_DIR
(and it fails because that's not what I expected...) - If I comment
INSTALL_COMMAND ""
, then it try to install in C:/Program Files/wjelement, the default (apparently) and not inINSTALL_DIR
- default path for source files seem to be
${CMAKE_BINARY_DIR}/wjelement-project-prefix/src
Another Stackoverflow question report problem (or at least non intuitive behavior) with INSTALL_DIR
.