mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 00:00:39 -05:00
ENH: Automatic include directories should not be done by default as was just implemented. Instead a project may now set CMAKE_INCLUDE_CURRENT_DIR to get this behavior. The current source and binary directories are added automatically to the beginning of the include path in every directory. This simulates in-source behavior for double-quote includes when there are generated sources and headers in the directory.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
# Simulate in-source build include-file behavior for out-of-source
|
||||
# builds.
|
||||
SET(CMAKE_INCLUDE_CURRENT_DIR 1)
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} ARGS -E
|
||||
@@ -5,6 +9,5 @@ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/generated.h
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR})
|
||||
ADD_LIBRARY(GeneratedHeader main.cpp)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user