I have problems to add an external github project in Cmake. The aim is to use the github package ACADO in a ROS (Catkin) project. The installation instructions can be found here: http://acado.github.io/install_linux.html
Please download the toolkit code. Our suggestion is to always clone stable branch:
git clone https://github.com/acado/acado.git -b stable ACADOtoolkit
Go to ACADOtoolkit folder and create a build folder for an out-of-source build:
cd ACADOtoolkit mkdir build cd build
Run CMake to generate makefiles and start the building process:
cmake .. make
To use this package, I want to download the ACADOtoolkit to the folder and build it there:
catkin_ws/src/myProj/thirdparty/
For this reason I add the ACADOtoolkit as an external Project. I have to git clone the Project into the thirdparty folder, so that I get:
catkin_ws/src/myProj/thirdparty/ACADOtoolkit
afterwards I have to create a build folder catkin_ws/src/myProj/thirdparty/ACADOtoolkit/build and than build the project:
cd catkin_ws/src/myProj/thirdparty/ACADOtoolkit/build
cmake ..
make
I can succesfully download the project to catkin_ws/src/myProj/thirdparty/ by using:
ExternalProject_Add(acadooo
DOWNLOAD_COMMAND git clone https://github.com/acado/acado.git -b stable ACADOtoolkit
DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/
)
Unfortunately I cannot build the system afterwards with
ExternalProject_Add(acado
DOWNLOAD_COMMAND git clone https://github.com/acado/acado.git -b stable ACADOtoolkit
DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/
BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/ACADOtoolkit/build/
BUILD_COMMAND make
)
as the build folder should be created within the ACACADOtoolkit folder and therefore I receive
destination path 'ACADOtoolkit' already exists and is not an empty directory.
Also building in source ends in the same error.
ExternalProject_Add(acado
DOWNLOAD_COMMAND git clone https://github.com/acado/acado.git -b stable ACADOtoolkit
DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/build/
BUILD_COMMAND make
BUILD_IN_SOURCE 1
)
Furthermore each time I want to build the project, the directory has to be deleted before. Any ideas how to resolve these Issues and build in source?