1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/bin/sh
set -exu
cd "$AUTOPKGTEST_TMP"
component=$1
shift
echo "CmakeLists.txt:"
tee CMakeLists.txt << END
cmake_minimum_required(VERSION 3.7)
project(autopkgtest_$component)
find_package(catkin REQUIRED COMPONENTS $component)
include_directories(include \${catkin_INCLUDE_DIRS})
add_executable(main main.cc)
target_link_libraries(main \${catkin_LIBRARIES})
END
echo "main.cc:"
for incl in $@; do
echo "#include <$incl>" | tee -a main.cc
done
echo "int main(int argc, char* argv[]) { return 0; }" | tee -a main.cc
mkdir build
cmake -H. -Bbuild
cmake --build build
|