[CMake] install to CMAKE_BINARY_DIR fails if CC=icc

🐋 Jan Hegewald jan.hegewald at awi.de
Mon Mar 7 08:52:17 EST 2016


Dear CMakers,
I encountered a strange problem with my cmake setup:
In my CMakeLists.txt files there is a line

install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_BINARY_DIR})

Some of my projects use add_subdirectory, and with make install I "pull" them right to the build directory.
This used to work fine on several machines, even if the target is already built into the CMAKE_BINARY_DIR because I choose just to build this single CMakeLists.txt
Now this setup fails on a Red Hat Server, cmake 3.4.3 but ONLY if I switch the compiler form gcc to icc. In this case the target is removed during make install and make complains with

CMake Error at cmake_install.cmake:50 (file):
  file INSTALL cannot find "/foo/bar/installtest".

Is this an error, or is it not a good idea to specify the CMAKE_BINARY_DIR as install destination? Please share your thoughts about this.

Cheers,
Jan


More information about the CMake mailing list