CMAKE_AUTOMOC doesn't respect CMAKE_CXX_COMPILER_ARG1
I'm trying to build a project which uses CMAKE_AUTOMOC set to ON. Additionaly I'm using ccache so CMAKE_CXX_COMPILER points to /usr/bin/ccache executable while CMAKE_CXX_COMPILER_ARG1 points to /usr/bin/c++.
Such combination doesn't work for me. When I try to build project I get:
[1/12] Automatic MOC for target main FAILED: CMakeFiles/main_autogen main_autogen/mocs_compilation.cpp cd /home/michal/projects/builds/NKTest && /usr/bin/cmake -E cmake_autogen /home/michal/projects/builds/NKTest/CMakeFiles/main_autogen.dir "" Generating MOC predefs moc_predefs.h AutoMoc: Error: moc predefs generation command failed AutoMoc: Command: /usr/bin/ccache -dM -E -c /usr/share/cmake-3.9/Modules/CMakeCXXCompilerABI.cpp -I/home/michal/projects/builds/NKTest/main_autogen/include -I/home/michal/projects/sources/NKTest/. -I/home/michal/projects/sources/NKTest/Quiz -I/usr/include/qt -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtGui -I/usr/include/qt/QtCore -I/usr/lib/qt/mkspecs/linux-g++ -I/usr/include -DBOOST_ALL_DYN_LINK -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB AutoMoc: Command output: /usr/bin/ccache: invalid option -- 'd'
As you can see /usr/bin/c++ was not used together with ccache.