[Cmake-commits] CMake branch, next, updated. v2.8.12-3734-g3b257e0
Stephen Kelly
steveire at gmail.com
Wed Oct 9 18:34:17 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 3b257e09aab8a00e5395288485802def7d07d1a0 (commit)
via 617ee7c567128edaeba3a4947c48249182d345c5 (commit)
from 9e72c837076f3cb0040a52d75cb58fad58d17bc4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b257e09aab8a00e5395288485802def7d07d1a0
commit 3b257e09aab8a00e5395288485802def7d07d1a0
Merge: 9e72c83 617ee7c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 9 18:34:14 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Oct 9 18:34:14 2013 -0400
Merge topic 'INTERFACE_LIBRARY-SYSTEM-header' into next
617ee7c Add a test for SYSTEM headers in INTERFACE libraries.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=617ee7c567128edaeba3a4947c48249182d345c5
commit 617ee7c567128edaeba3a4947c48249182d345c5
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Sep 18 17:30:55 2013 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Oct 10 00:33:33 2013 +0200
Add a test for SYSTEM headers in INTERFACE libraries.
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
index aec6ff9..1f5c93b 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
@@ -17,3 +17,31 @@ target_include_directories(upstream SYSTEM PUBLIC
add_library(consumer consumer.cpp)
target_link_libraries(consumer upstream)
target_compile_options(consumer PRIVATE -Werror=unused-variable)
+
+add_library(iface IMPORTED INTERFACE)
+set_property(TARGET iface PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/systemlib_header_only")
+
+add_library(imported_consumer imported_consumer.cpp)
+target_link_libraries(imported_consumer iface)
+target_compile_options(imported_consumer PRIVATE -Werror=unused-variable)
+
+macro(do_try_compile error_option)
+ set(TC_ARGS
+ IFACE_TRY_COMPILE_${error_option}
+ "${CMAKE_CURRENT_BINARY_DIR}/try_compile_iface" "${CMAKE_CURRENT_SOURCE_DIR}/imported_consumer.cpp"
+ LINK_LIBRARIES iface
+ )
+ if (${error_option} STREQUAL WITH_ERROR)
+ list(APPEND TC_ARGS COMPILE_DEFINITIONS -Werror=unused-variable)
+ endif()
+ try_compile(${TC_ARGS})
+endmacro()
+
+do_try_compile(NO_ERROR)
+if (NOT IFACE_TRY_COMPILE_NO_ERROR)
+ message(SEND_ERROR "try_compile failed with imported target.")
+endif()
+do_try_compile(WITH_ERROR)
+if (NOT IFACE_TRY_COMPILE_WITH_ERROR)
+ message(SEND_ERROR "try_compile failed with imported target with error option.")
+endif()
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/imported_consumer.cpp b/Tests/IncludeDirectories/SystemIncludeDirectories/imported_consumer.cpp
new file mode 100644
index 0000000..1dbe819
--- /dev/null
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/imported_consumer.cpp
@@ -0,0 +1,7 @@
+
+#include "systemlib.h"
+
+int main()
+{
+ return systemlib();
+}
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/systemlib_header_only/systemlib.h b/Tests/IncludeDirectories/SystemIncludeDirectories/systemlib_header_only/systemlib.h
new file mode 100644
index 0000000..93622c4
--- /dev/null
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/systemlib_header_only/systemlib.h
@@ -0,0 +1,16 @@
+
+#ifndef SYSTEMLIB_H
+#define SYSTEMLIB_H
+
+int systemlib()
+{
+ return 0;
+}
+
+int unusedFunc()
+{
+ int unused;
+ return systemlib();
+}
+
+#endif
-----------------------------------------------------------------------
Summary of changes:
.../SystemIncludeDirectories/CMakeLists.txt | 28 ++++++++++++++++++++
.../SystemIncludeDirectories/imported_consumer.cpp | 7 +++++
.../systemlib_header_only/systemlib.h | 16 +++++++++++
3 files changed, 51 insertions(+), 0 deletions(-)
create mode 100644 Tests/IncludeDirectories/SystemIncludeDirectories/imported_consumer.cpp
create mode 100644 Tests/IncludeDirectories/SystemIncludeDirectories/systemlib_header_only/systemlib.h
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list