[AIX] Can't install only one target using CMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON
I'm trying to build and install only one target of a large project containing >100 build units (targets). Therefore i made a simple demo project for testing (https://github.com/dops-at/cmake_sample) to be faster to analyse.
Running the test on linux (centos 5.11, cmake version 3.13.0) all fine and only hello2
get's build and installed.
(rm -rf build; cmake -S . -B build -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON;cmake --build build --target hello2;cmake --build build --target install)
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /opt/gcc-6.4.0/bin/gcc
-- Check for working C compiler: /opt/gcc-6.4.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/gcc-6.4.0/bin/c++
-- Check for working CXX compiler: /opt/gcc-6.4.0/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/labuser/compile/hello/build
Scanning dependencies of target hello2
[ 50%] Building CXX object hello2/CMakeFiles/hello2.dir/cpp/hello2.cpp.o
[100%] Linking CXX executable hello2
[100%] Built target hello2
Install the project...
-- Install configuration: ""
-- Installing: /home/labuser/compile/hello/build/bin/hello2
-- Set runtime path of "/home/labuser/compile/hello/build/bin/hello2" to "$ORIGIN"
but running this on AIX (7.1, cmake version 3.13.0) i'm not able to run the command with success.
(rm -rf build; cmake -S . -B build -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON;cmake --build build --target hello2;cmake --build build --target install)
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/jenkins/ando/hello/build
Scanning dependencies of target hello2
[ 33%] Building CXX object hello2/CMakeFiles/hello2.dir/cpp/hello2.cpp.o
[ 66%] Linking CXX executable hello2
[100%] Built target hello2
Building CXX object sayhello/CMakeFiles/sayhello.dir/cpp/sayhello.cpp.o
Linking CXX shared library CMakeFiles/CMakeRelink.dir/libsayhello.so
Building CXX object hello/CMakeFiles/hello.dir/cpp/hello.cpp.o
gmake[2]: *** No rule to make target 'sayhello/libsayhello.so', needed by 'hello/CMakeFiles/CMakeRelink.dir/hello'. Stop.
gmake[1]: *** [CMakeFiles/Makefile2:179: hello/CMakeFiles/hello.dir/preinstall] Error 2
gmake: *** [Makefile:146: preinstall] Error 2
if i omit -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON
on AIX everything get's build and installed with success but i only want to install hello2
.
Thx for any hint about that!