September 2018
Intermediate to advanced
606 pages
14h 32m
English
Let us take a closer look at the invocation of add_custom_target:
add_custom_target(unpack-eigen ALL COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/eigen-eigen-5a0156e40feb.tar.gz COMMAND ${CMAKE_COMMAND} -E rename eigen-eigen-5a0156e40feb eigen-3.3.4 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Unpacking Eigen3 in ${CMAKE_CURRENT_BINARY_DIR}/eigen-3.3.4" )
We are introducing a target called unpack-eigen into our build system. The target will always be executed since we passed the ALL argument. The COMMAND argument lets you specify what commands to execute. In this example, we wish to extract the archive and rename the extracted directory to eigen-3.3.4. This is achieved with these two commands:
Read now
Unlock full access