summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/ExportImport')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt15
-rw-r--r--Tests/ExportImport/Export/include/abs/1a/testLibAbs1a.h1
-rw-r--r--Tests/ExportImport/Export/include/abs/1b/testLibAbs1b.h1
-rw-r--r--Tests/ExportImport/Export/include/abs/testLibAbs1.h1
-rw-r--r--Tests/ExportImport/Export/testLibAbs1.c1
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt10
-rw-r--r--Tests/ExportImport/Import/A/imp_testExeAbs1.c15
7 files changed, 44 insertions, 0 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index febdfe6..e130eca 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -508,3 +508,18 @@ export(TARGETS testExe2 testLib4 testLib5 testLib6 testExe3 testExe2lib
)
add_subdirectory(Interface)
+
+#-----------------------------------------------------------------------------
+# Install export with absolute destination but relative pieces.
+add_library(testLibAbs1 STATIC testLibAbs1.c)
+target_include_directories(testLibAbs1 INTERFACE
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/abs/1a;include/abs/1b>"
+ )
+install(
+ TARGETS testLibAbs1
+ EXPORT expAbs
+ ARCHIVE DESTINATION lib
+ INCLUDES DESTINATION include/abs
+ )
+install(DIRECTORY include/abs DESTINATION include)
+install(EXPORT expAbs NAMESPACE expAbs_ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/expAbs)
diff --git a/Tests/ExportImport/Export/include/abs/1a/testLibAbs1a.h b/Tests/ExportImport/Export/include/abs/1a/testLibAbs1a.h
new file mode 100644
index 0000000..4421227
--- /dev/null
+++ b/Tests/ExportImport/Export/include/abs/1a/testLibAbs1a.h
@@ -0,0 +1 @@
+#define testLibAbs1a
diff --git a/Tests/ExportImport/Export/include/abs/1b/testLibAbs1b.h b/Tests/ExportImport/Export/include/abs/1b/testLibAbs1b.h
new file mode 100644
index 0000000..00a2a29
--- /dev/null
+++ b/Tests/ExportImport/Export/include/abs/1b/testLibAbs1b.h
@@ -0,0 +1 @@
+#define testLibAbs1b
diff --git a/Tests/ExportImport/Export/include/abs/testLibAbs1.h b/Tests/ExportImport/Export/include/abs/testLibAbs1.h
new file mode 100644
index 0000000..19d80a5
--- /dev/null
+++ b/Tests/ExportImport/Export/include/abs/testLibAbs1.h
@@ -0,0 +1 @@
+extern int testLibAbs1(void);
diff --git a/Tests/ExportImport/Export/testLibAbs1.c b/Tests/ExportImport/Export/testLibAbs1.c
new file mode 100644
index 0000000..34aec75
--- /dev/null
+++ b/Tests/ExportImport/Export/testLibAbs1.c
@@ -0,0 +1 @@
+int testLibAbs1(void) { return 0; }
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index eb0bbf8..9450c82 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -96,6 +96,16 @@ foreach(c DEBUG RELWITHDEBINFO)
endforeach()
#-----------------------------------------------------------------------------
+include(${CMAKE_INSTALL_PREFIX}/lib/expAbs/expAbs.cmake)
+
+add_executable(imp_testExeAbs1
+ imp_testExeAbs1.c
+ )
+target_link_libraries(imp_testExeAbs1
+ expAbs_testLibAbs1
+ )
+
+#-----------------------------------------------------------------------------
# Create a custom target to generate a header for the libraries below.
# Drive the header generation through an indirect chain of imported
# target dependencies.
diff --git a/Tests/ExportImport/Import/A/imp_testExeAbs1.c b/Tests/ExportImport/Import/A/imp_testExeAbs1.c
new file mode 100644
index 0000000..069c3f0
--- /dev/null
+++ b/Tests/ExportImport/Import/A/imp_testExeAbs1.c
@@ -0,0 +1,15 @@
+#include "testLibAbs1.h"
+#include "testLibAbs1a.h"
+#include "testLibAbs1b.h"
+#ifndef testLibAbs1a
+# error "testLibAbs1a not defined"
+#endif
+#ifndef testLibAbs1b
+# error "testLibAbs1b not defined"
+#endif
+int main()
+{
+ return 0
+ + testLibAbs1()
+ ;
+}