summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport/Export
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-05-17 08:12:02 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-05-18 08:00:48 (GMT)
commitb5d6f5dd5b894ea6dcd8f87e1925db5551f3ffc0 (patch)
tree59dd309a90bfd35c5117e6132ef6c7622fb7cdbf /Tests/ExportImport/Export
parentedeabd18e6db5a52b2191ea9d3b09ee8bd090af6 (diff)
downloadCMake-b5d6f5dd5b894ea6dcd8f87e1925db5551f3ffc0.zip
CMake-b5d6f5dd5b894ea6dcd8f87e1925db5551f3ffc0.tar.gz
CMake-b5d6f5dd5b894ea6dcd8f87e1925db5551f3ffc0.tar.bz2
Add EXPORT_NAME property.
This allows for example, the buildsystem to use names like 'boost_any' instead of the overly generic 'any', and still be able to generate IMPORTED targets called 'boost::any'.
Diffstat (limited to 'Tests/ExportImport/Export')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt11
-rw-r--r--Tests/ExportImport/Export/renamed/CMakeLists.txt20
-rw-r--r--Tests/ExportImport/Export/renamed/renamed.cxx7
-rw-r--r--Tests/ExportImport/Export/renamed/renamed.h12
-rw-r--r--Tests/ExportImport/Export/testSharedLibDepends.cpp3
-rw-r--r--Tests/ExportImport/Export/testSharedLibDepends.h1
6 files changed, 48 insertions, 6 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index be48483..e3f23b8 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -165,6 +165,8 @@ set_property(TARGET testLibRequired APPEND PROPERTY
include(GenerateExportHeader)
+add_subdirectory(renamed)
+
add_library(testSharedLibRequired SHARED testSharedLibRequired.cpp)
generate_export_header(testSharedLibRequired)
set_property(TARGET testSharedLibRequired
@@ -219,13 +221,12 @@ set_property(TARGET testSharedLibDepends APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/testSharedLibDepends>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
)
-set_property(TARGET testSharedLibDepends APPEND PROPERTY
- LINK_INTERFACE_LIBRARIES
- $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:$<TARGET_NAME:testSharedLibRequired>>
-)
# LINK_PRIVATE because the LINK_INTERFACE_LIBRARIES is specified above.
target_link_libraries(testSharedLibDepends LINK_PRIVATE testSharedLibRequired)
+target_link_libraries(testSharedLibDepends LINK_PUBLIC renamed_on_export)
+target_link_libraries(testSharedLibDepends LINK_INTERFACE_LIBRARIES
+ $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:$<TARGET_NAME:testSharedLibRequired>>)
install(TARGETS testLibRequired
testLibIncludeRequired1
@@ -310,7 +311,7 @@ add_subdirectory(sublib) # For CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE test.
# Export from build tree.
export(TARGETS testExe1 testLib1 testLib2 testLib3
testExe2libImp testLib3Imp testLib3ImpDep subdirlib
- testSharedLibRequired testSharedLibDepends
+ testSharedLibRequired testSharedLibDepends renamed_on_export
NAMESPACE bld_
FILE ExportBuildTree.cmake
)
diff --git a/Tests/ExportImport/Export/renamed/CMakeLists.txt b/Tests/ExportImport/Export/renamed/CMakeLists.txt
new file mode 100644
index 0000000..a763251
--- /dev/null
+++ b/Tests/ExportImport/Export/renamed/CMakeLists.txt
@@ -0,0 +1,20 @@
+
+add_library(renamed_on_export SHARED renamed.cxx)
+generate_export_header(renamed_on_export)
+target_include_directories(renamed_on_export
+ PUBLIC "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/renamed>"
+ "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
+)
+set_property(TARGET renamed_on_export
+ PROPERTY
+ EXPORT_NAME renamed
+)
+
+install(FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/renamed.h"
+ "${CMAKE_CURRENT_BINARY_DIR}/renamed_on_export_export.h"
+ DESTINATION include/renamed
+)
+
+install(TARGETS renamed_on_export
+ EXPORT exp DESTINATION lib )
diff --git a/Tests/ExportImport/Export/renamed/renamed.cxx b/Tests/ExportImport/Export/renamed/renamed.cxx
new file mode 100644
index 0000000..b3e3e7e
--- /dev/null
+++ b/Tests/ExportImport/Export/renamed/renamed.cxx
@@ -0,0 +1,7 @@
+
+#include "renamed.h"
+
+int Renamed::foo()
+{
+ return 0;
+}
diff --git a/Tests/ExportImport/Export/renamed/renamed.h b/Tests/ExportImport/Export/renamed/renamed.h
new file mode 100644
index 0000000..06ac601
--- /dev/null
+++ b/Tests/ExportImport/Export/renamed/renamed.h
@@ -0,0 +1,12 @@
+
+#ifndef RENAMED_H
+#define RENAMED_H
+
+#include "renamed_on_export_export.h"
+
+struct RENAMED_ON_EXPORT_EXPORT Renamed
+{
+ int foo();
+};
+
+#endif
diff --git a/Tests/ExportImport/Export/testSharedLibDepends.cpp b/Tests/ExportImport/Export/testSharedLibDepends.cpp
index e279207..962223f 100644
--- a/Tests/ExportImport/Export/testSharedLibDepends.cpp
+++ b/Tests/ExportImport/Export/testSharedLibDepends.cpp
@@ -4,5 +4,6 @@
int TestSharedLibDepends::foo()
{
TestSharedLibRequired req;
- return req.foo();
+ Renamed renamed;
+ return req.foo() + renamed.foo();
}
diff --git a/Tests/ExportImport/Export/testSharedLibDepends.h b/Tests/ExportImport/Export/testSharedLibDepends.h
index b93143a..8b2f84e 100644
--- a/Tests/ExportImport/Export/testSharedLibDepends.h
+++ b/Tests/ExportImport/Export/testSharedLibDepends.h
@@ -5,6 +5,7 @@
#include "testsharedlibdepends_export.h"
#include "testSharedLibRequired.h"
+#include "renamed.h"
struct TESTSHAREDLIBDEPENDS_EXPORT TestSharedLibDepends
{