summaryrefslogtreecommitdiffstats
path: root/Tests/Plugin/src
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-04-17 17:52:50 (GMT)
committerBrad King <brad.king@kitware.com>2007-04-17 17:52:50 (GMT)
commitc1a6e4dcc666c548c182bc6cf8617815b330d977 (patch)
tree30299accf90d34188bcc82efe82c0e6b85c03f36 /Tests/Plugin/src
parentaabcf981e22a7c39bcd828bff1a4fb4345e658c9 (diff)
downloadCMake-c1a6e4dcc666c548c182bc6cf8617815b330d977.zip
CMake-c1a6e4dcc666c548c182bc6cf8617815b330d977.tar.gz
CMake-c1a6e4dcc666c548c182bc6cf8617815b330d977.tar.bz2
ENH: Configure location of plugin files so that the executable can run with any current working directory.
Diffstat (limited to 'Tests/Plugin/src')
-rw-r--r--Tests/Plugin/src/example_exe.cxx4
-rw-r--r--Tests/Plugin/src/example_exe.h.in6
2 files changed, 9 insertions, 1 deletions
diff --git a/Tests/Plugin/src/example_exe.cxx b/Tests/Plugin/src/example_exe.cxx
index 59f1e0b..96566d5 100644
--- a/Tests/Plugin/src/example_exe.cxx
+++ b/Tests/Plugin/src/example_exe.cxx
@@ -1,5 +1,7 @@
#include <example.h>
+#include <example_exe.h>
+
#include <kwsys/DynamicLoader.hxx>
#include <kwsys/ios/iostream>
#include <kwsys/stl/string>
@@ -21,7 +23,7 @@ extern "C" int example_exe_function()
int main()
{
- kwsys_stl::string libName = "lib/plugin" CONFIG_DIR "/";
+ kwsys_stl::string libName = EXAMPLE_EXE_PLUGIN_DIR CONFIG_DIR "/";
libName += kwsys::DynamicLoader::LibPrefix();
libName += "example_mod_1";
libName += kwsys::DynamicLoader::LibExtension();
diff --git a/Tests/Plugin/src/example_exe.h.in b/Tests/Plugin/src/example_exe.h.in
new file mode 100644
index 0000000..62f0d9f
--- /dev/null
+++ b/Tests/Plugin/src/example_exe.h.in
@@ -0,0 +1,6 @@
+#ifndef example_exe_h
+#define example_exe_h
+
+#define EXAMPLE_EXE_PLUGIN_DIR "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@"
+
+#endif