cmake-3.9 adds non-existing -I"<project>_autogen/include" to compiler flags
This example shows the problem that since cmake 3.9 "_autogen/include" is added as -I to compiler flags, but not created (if empty).
It worked at least with (GIT tag) v3.8.2 and fails at least with v3.9.0, so I think it could be a kind of regression.
Example with cmake version 3.9.20170807-g3344d9:
$ sh b.sh
-- The C compiler identification is GNU 4.9.2
[...normal cmake output...]
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/cmake-autogen-inc/b
Scanning dependencies of target hello_world_autogen
[ 25%] Automatic MOC for target hello_world
Generating MOC compilation mocs_compilation.cpp
[ 25%] Built target hello_world_autogen
Scanning dependencies of target hello_world
[ 50%] Building CXX object CMakeFiles/hello_world.dir/main.cpp.o
cc1plus: error: /tmp/cmake-autogen-inc/b/hello_world_autogen/include: No such file or directory [-Werror]
cc1plus: all warnings being treated as errors
CMakeFiles/hello_world.dir/build.make:62: recipe for target 'CMakeFiles/hello_world.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/hello_world.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/hello_world.dir/all' failed
make[1]: *** [CMakeFiles/hello_world.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
```
This can be reproduced with the following minimal sample project.
CMakeLists.txt:
```cmake
cmake_minimum_required(VERSION 2.8.12)
project(HELLO_WORLD)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt4 4 REQUIRED QtCore)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-include-dirs -Werror")
set(HELLO_SOURCES main.cpp)
add_executable(hello_world ${HELLO_SOURCES})
```
main.cpp:
```cpp
#include <iostream>
int main()
{
std::cout << "Hello world with std::cout" << std::endl;
return 0;
}
```
Also attached as tarball [cmake-autogen-inc.tgz](/uploads/3128aed2172c87d414a1897f5cc1d202/cmake-autogen-inc.tgz).