summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport/Import
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-08-11 20:23:10 (GMT)
committerBrad King <brad.king@kitware.com>2008-08-11 20:23:10 (GMT)
commit7b873cd951e72cdd73ead785e3fc2fdddf73292d (patch)
tree58b12b3cf54ee2616db402b9dfeb7aab25035c7d /Tests/ExportImport/Import
parente322d288af7a2e9f413a703e07399976377c7dd0 (diff)
downloadCMake-7b873cd951e72cdd73ead785e3fc2fdddf73292d.zip
CMake-7b873cd951e72cdd73ead785e3fc2fdddf73292d.tar.gz
CMake-7b873cd951e72cdd73ead785e3fc2fdddf73292d.tar.bz2
ENH: Test target_link_libraries INTERFACE option
Diffstat (limited to 'Tests/ExportImport/Import')
-rw-r--r--Tests/ExportImport/Import/CMakeLists.txt2
-rw-r--r--Tests/ExportImport/Import/imp_testExe1.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/Tests/ExportImport/Import/CMakeLists.txt b/Tests/ExportImport/Import/CMakeLists.txt
index 5a946ed..1ac9d3a 100644
--- a/Tests/ExportImport/Import/CMakeLists.txt
+++ b/Tests/ExportImport/Import/CMakeLists.txt
@@ -32,6 +32,7 @@ add_executable(imp_testExe1
# Try linking to a library imported from the install tree.
target_link_libraries(imp_testExe1 exp_testLib2 exp_testLib3 exp_testLib4)
+set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_DEBUG EXE_DBG)
# Try building a plugin to an executable imported from the install tree.
add_library(imp_mod1 MODULE imp_mod1.c)
@@ -57,6 +58,7 @@ add_executable(imp_testExe1b
# Try linking to a library imported from the build tree.
target_link_libraries(imp_testExe1b bld_testLib2 bld_testLib3 bld_testLib4)
+set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_DEBUG EXE_DBG)
# Try building a plugin to an executable imported from the build tree.
add_library(imp_mod1b MODULE imp_mod1.c)
diff --git a/Tests/ExportImport/Import/imp_testExe1.c b/Tests/ExportImport/Import/imp_testExe1.c
index 0fbb689..6424d33 100644
--- a/Tests/ExportImport/Import/imp_testExe1.c
+++ b/Tests/ExportImport/Import/imp_testExe1.c
@@ -3,9 +3,19 @@ extern int generated_by_testExe3();
extern int testLib2();
extern int testLib3();
extern int testLib4();
+extern int testLib4lib();
+
+/* Switch a symbol between debug and optimized builds to make sure the
+ proper library is found from the testLib4 link interface. */
+#ifdef EXE_DBG
+# define testLib4libcfg testLib4libdbg
+#else
+# define testLib4libcfg testLib4libopt
+#endif
+extern testLib4libcfg(void);
int main()
{
return (testLib2() + generated_by_testExe1() + testLib3() + testLib4()
- + generated_by_testExe3());
+ + generated_by_testExe3() + testLib4lib() + testLib4libcfg());
}