summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeCommands/target_link_libraries/CMakeLists.txt17
-rw-r--r--Tests/CMakeCommands/target_link_libraries/depB.cpp6
-rw-r--r--Tests/CMakeCommands/target_link_libraries/libgenex.cpp7
-rw-r--r--Tests/CMakeCommands/target_link_libraries/libgenex.h12
-rw-r--r--Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt5
-rw-r--r--Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.cpp7
-rw-r--r--Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.h12
-rw-r--r--Tests/CMakeCommands/target_link_libraries/targetA.cpp6
-rw-r--r--Tests/Qt4Targets/CMakeLists.txt11
-rw-r--r--Tests/Qt4Targets/main.cpp8
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/load_command/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/load_command/LoadCommandDeprecated-stderr.txt6
-rw-r--r--Tests/RunCMake/load_command/LoadCommandDeprecated.cmake1
-rw-r--r--Tests/RunCMake/load_command/RunCMakeTest.cmake3
15 files changed, 87 insertions, 18 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 60b36fc..746d30c 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -29,11 +29,21 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_library(depA SHARED depA.cpp)
generate_export_header(depA)
+add_library(importedlib UNKNOWN IMPORTED)
+target_link_libraries(importedlib LINK_INTERFACE_LIBRARIES depA)
+
add_library(depB SHARED depB.cpp)
generate_export_header(depB)
target_link_libraries(depB LINK_PRIVATE depA)
+add_library(libgenex SHARED libgenex.cpp)
+generate_export_header(libgenex)
+
+set_property(TARGET depB APPEND PROPERTY
+ LINK_LIBRARIES $<1:libgenex>
+)
+
add_library(depC SHARED depC.cpp)
generate_export_header(depC)
@@ -53,6 +63,13 @@ set_target_properties(targetA PROPERTIES LINK_INTERFACE_LIBRARIES "")
assert_property(targetA LINK_INTERFACE_LIBRARIES "")
+add_subdirectory(subdir)
+target_link_libraries(targetA subdirlib)
+set_property(TARGET targetA APPEND PROPERTY
+ INCLUDE_DIRECTORIES
+ $<TARGET_PROPERTY:subdirlib,INTERFACE_INCLUDE_DIRECTORIES>
+)
+
target_link_libraries(targetA depB depC)
assert_property(targetA LINK_INTERFACE_LIBRARIES "")
diff --git a/Tests/CMakeCommands/target_link_libraries/depB.cpp b/Tests/CMakeCommands/target_link_libraries/depB.cpp
index 1bbe38b..4f46552 100644
--- a/Tests/CMakeCommands/target_link_libraries/depB.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/depB.cpp
@@ -3,9 +3,13 @@
#include "depA.h"
+#include "libgenex.h"
+
int DepB::foo()
{
DepA a;
- return a.foo();
+ LibGenex lg;
+
+ return a.foo() + lg.foo();
}
diff --git a/Tests/CMakeCommands/target_link_libraries/libgenex.cpp b/Tests/CMakeCommands/target_link_libraries/libgenex.cpp
new file mode 100644
index 0000000..c925c08
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/libgenex.cpp
@@ -0,0 +1,7 @@
+
+#include "libgenex.h"
+
+int LibGenex::foo()
+{
+ return 0;
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/libgenex.h b/Tests/CMakeCommands/target_link_libraries/libgenex.h
new file mode 100644
index 0000000..733f9b6
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/libgenex.h
@@ -0,0 +1,12 @@
+
+#include "libgenex_export.h"
+
+#ifndef LIBGENEX_H
+#define LIBGENEX_H
+
+struct LIBGENEX_EXPORT LibGenex
+{
+ int foo();
+};
+
+#endif
diff --git a/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt
new file mode 100644
index 0000000..61a1a59
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/subdir/CMakeLists.txt
@@ -0,0 +1,5 @@
+
+set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
+
+add_library(subdirlib SHARED subdirlib.cpp)
+generate_export_header(subdirlib)
diff --git a/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.cpp b/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.cpp
new file mode 100644
index 0000000..cd2f1a2
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.cpp
@@ -0,0 +1,7 @@
+
+#include "subdirlib.h"
+
+int SubDirLibObject::foo() const
+{
+ return 0;
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.h b/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.h
new file mode 100644
index 0000000..e386f87
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/subdir/subdirlib.h
@@ -0,0 +1,12 @@
+
+#ifndef SUBDIRLIB_H
+#define SUBDIRLIB_H
+
+#include "subdirlib_export.h"
+
+struct SUBDIRLIB_EXPORT SubDirLibObject
+{
+ int foo() const;
+};
+
+#endif
diff --git a/Tests/CMakeCommands/target_link_libraries/targetA.cpp b/Tests/CMakeCommands/target_link_libraries/targetA.cpp
index 6ff65b1..559aef7 100644
--- a/Tests/CMakeCommands/target_link_libraries/targetA.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/targetA.cpp
@@ -3,6 +3,8 @@
#include "depC.h"
#include "depIfaceOnly.h"
+#include "subdirlib.h"
+
int main(int argc, char **argv)
{
DepA a;
@@ -11,5 +13,7 @@ int main(int argc, char **argv)
DepIfaceOnly iface_only;
- return a.foo() + b.foo() + c.foo() + iface_only.foo();
+ SubDirLibObject sd;
+
+ return a.foo() + b.foo() + c.foo() + iface_only.foo() + sd.foo();
}
diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt
index 3adff48..9bd7a64 100644
--- a/Tests/Qt4Targets/CMakeLists.txt
+++ b/Tests/Qt4Targets/CMakeLists.txt
@@ -4,11 +4,18 @@ project(Qt4Targets)
find_package(Qt4 REQUIRED)
-include_directories(${QT_INCLUDES})
-
add_executable(Qt4Targets WIN32 main.cpp)
target_link_libraries(Qt4Targets Qt4::QtGui)
if (WIN32)
target_link_libraries(Qt4Targets Qt4::qtmain)
endif()
+
+set_property(TARGET Qt4Targets APPEND PROPERTY
+ INCLUDE_DIRECTORIES
+ $<TARGET_PROPERTY:Qt4::QtGui,INTERFACE_INCLUDE_DIRECTORIES>
+)
+set_property(TARGET Qt4Targets APPEND PROPERTY
+ COMPILE_DEFINITIONS
+ $<TARGET_PROPERTY:Qt4::QtGui,INTERFACE_COMPILE_DEFINITIONS>
+)
diff --git a/Tests/Qt4Targets/main.cpp b/Tests/Qt4Targets/main.cpp
index f4890fa..3c98c99 100644
--- a/Tests/Qt4Targets/main.cpp
+++ b/Tests/Qt4Targets/main.cpp
@@ -4,6 +4,14 @@
#include <QString>
+#ifndef QT_CORE_LIB
+#error Expected QT_CORE_LIB
+#endif
+
+#ifndef QT_GUI_LIB
+#error Expected QT_GUI_LIB
+#endif
+
int main(int argc, char **argv)
{
QApplication app(argc, argv);
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index cc544a3..fec64b5 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -56,7 +56,6 @@ add_RunCMake_test(find_package)
add_RunCMake_test(include)
add_RunCMake_test(include_directories)
add_RunCMake_test(list)
-add_RunCMake_test(load_command)
if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]")
add_RunCMake_test(include_external_msproject)
diff --git a/Tests/RunCMake/load_command/CMakeLists.txt b/Tests/RunCMake/load_command/CMakeLists.txt
deleted file mode 100644
index e8db6b0..0000000
--- a/Tests/RunCMake/load_command/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-project(${RunCMake_TEST} NONE)
-include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/load_command/LoadCommandDeprecated-stderr.txt b/Tests/RunCMake/load_command/LoadCommandDeprecated-stderr.txt
deleted file mode 100644
index 7d374b2..0000000
--- a/Tests/RunCMake/load_command/LoadCommandDeprecated-stderr.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-CMake Warning \(dev\) at LoadCommandDeprecated.cmake:1 \(load_command\):
- The "load_command" command will be removed in CMake 3.0. See command
- documentation for details.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/load_command/LoadCommandDeprecated.cmake b/Tests/RunCMake/load_command/LoadCommandDeprecated.cmake
deleted file mode 100644
index 9e9b1f4..0000000
--- a/Tests/RunCMake/load_command/LoadCommandDeprecated.cmake
+++ /dev/null
@@ -1 +0,0 @@
-load_command()
diff --git a/Tests/RunCMake/load_command/RunCMakeTest.cmake b/Tests/RunCMake/load_command/RunCMakeTest.cmake
deleted file mode 100644
index 9a0f98d..0000000
--- a/Tests/RunCMake/load_command/RunCMakeTest.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-include(RunCMake)
-
-run_cmake(LoadCommandDeprecated)