diff options
Diffstat (limited to 'Tests/IncludeDirectories/CMP0021')
-rw-r--r-- | Tests/IncludeDirectories/CMP0021/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/IncludeDirectories/CMP0021/includes/cmp0021/cmp0021.h | 2 | ||||
-rw-r--r-- | Tests/IncludeDirectories/CMP0021/main.cpp | 11 |
3 files changed, 27 insertions, 0 deletions
diff --git a/Tests/IncludeDirectories/CMP0021/CMakeLists.txt b/Tests/IncludeDirectories/CMP0021/CMakeLists.txt new file mode 100644 index 0000000..0b9aee8 --- /dev/null +++ b/Tests/IncludeDirectories/CMP0021/CMakeLists.txt @@ -0,0 +1,14 @@ + +cmake_policy(SET CMP0021 OLD) +add_executable(cmp0021exe main.cpp) + +if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/includes") + execute_process(COMMAND ${CMAKE_COMMAND} -E + copy_directory + "${CMAKE_CURRENT_SOURCE_DIR}/includes" + "${CMAKE_CURRENT_BINARY_DIR}/includes" + ) +endif() +set_property(TARGET cmp0021exe PROPERTY + INCLUDE_DIRECTORIES includes/cmp0021) diff --git a/Tests/IncludeDirectories/CMP0021/includes/cmp0021/cmp0021.h b/Tests/IncludeDirectories/CMP0021/includes/cmp0021/cmp0021.h new file mode 100644 index 0000000..3d49b31 --- /dev/null +++ b/Tests/IncludeDirectories/CMP0021/includes/cmp0021/cmp0021.h @@ -0,0 +1,2 @@ + +#define CMP0021_DEFINE diff --git a/Tests/IncludeDirectories/CMP0021/main.cpp b/Tests/IncludeDirectories/CMP0021/main.cpp new file mode 100644 index 0000000..f886c46 --- /dev/null +++ b/Tests/IncludeDirectories/CMP0021/main.cpp @@ -0,0 +1,11 @@ + +#include "cmp0021.h" + +#ifndef CMP0021_DEFINE +#error Expected CMP0021_DEFINE +#endif + +int main(int, char **) +{ + return 0; +} |