diff options
author | Brad King <brad.king@kitware.com> | 2019-09-19 14:10:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-19 14:42:51 (GMT) |
commit | c578caa68bf7ee55077a3efa25aba46e9e1f562a (patch) | |
tree | 7609ec94c8bb5e13e018b3d8fc08b3e362afea5b /Tests/Plugin/CMakeLists.txt | |
parent | 56879273dc87a69e1d1491a73e0f74cd4424494c (diff) | |
download | CMake-c578caa68bf7ee55077a3efa25aba46e9e1f562a.zip CMake-c578caa68bf7ee55077a3efa25aba46e9e1f562a.tar.gz CMake-c578caa68bf7ee55077a3efa25aba46e9e1f562a.tar.bz2 |
Tests: Decouple Plugin test from KWSys
KWSys now requires C++11 but we want this test to be able to run as
C++98. Copy the KWSys DynamicLoader implementation (with original
notice headers and license reference) and update it to work alone.
Diffstat (limited to 'Tests/Plugin/CMakeLists.txt')
-rw-r--r-- | Tests/Plugin/CMakeLists.txt | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index 8e8fa07..729bba3 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -10,14 +10,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/static) -# We need the dynamic loader support from KWSys to load the plugin in -# the executable. -set(KWSYS_NAMESPACE kwsys) -set(KWSYS_HEADER_ROOT ${Plugin_BINARY_DIR}/include) -set(KWSYS_USE_DynamicLoader 1) -set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) -add_subdirectory(${Plugin_SOURCE_DIR}/../../Source/kwsys src/kwsys) - # Configure the location of plugins. configure_file(${Plugin_SOURCE_DIR}/src/example_exe.h.in ${Plugin_BINARY_DIR}/include/example_exe.h @ONLY) @@ -36,14 +28,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND endif() # Create an executable that exports an API for use by plugins. -add_executable(example_exe src/example_exe.cxx) +add_executable(example_exe src/example_exe.cxx src/DynamicLoader.cxx) set_target_properties(example_exe PROPERTIES ENABLE_EXPORTS 1 OUTPUT_NAME example # Test placing exe import library in unique directory. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/exe ) -target_link_libraries(example_exe kwsys) +target_link_libraries(example_exe ${CMAKE_DL_LIBS}) # Create a plugin that uses the API provided by the executable. # This module "links" to the executable to use the symbols. |