diff options
author | CheesyNacho10 <67198608+CheesyNacho10@users.noreply.github.com> | 2023-03-07 11:40:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-08 21:39:38 (GMT) |
commit | e36e455b7cdb50beb7c9cd16db8e27ecc1eaca70 (patch) | |
tree | 76526b2773c8f6eff40590ac042aa45eb014e58e /Tests/FindwxWidgets | |
parent | 42c84b1e2ef86afa5a82e34096cf4e9aa7da05c3 (diff) | |
download | CMake-e36e455b7cdb50beb7c9cd16db8e27ecc1eaca70.zip CMake-e36e455b7cdb50beb7c9cd16db8e27ecc1eaca70.tar.gz CMake-e36e455b7cdb50beb7c9cd16db8e27ecc1eaca70.tar.bz2 |
FindwxWidgets: Add an imported target
Diffstat (limited to 'Tests/FindwxWidgets')
-rw-r--r-- | Tests/FindwxWidgets/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindwxWidgets/Test/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/FindwxWidgets/Test/main.cpp | 7 |
3 files changed, 34 insertions, 0 deletions
diff --git a/Tests/FindwxWidgets/CMakeLists.txt b/Tests/FindwxWidgets/CMakeLists.txt new file mode 100644 index 0000000..b66f838 --- /dev/null +++ b/Tests/FindwxWidgets/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindwxWidgets.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindwxWidgets/Test" + "${CMake_BINARY_DIR}/Tests/FindwxWidgets/Test" + ${build_generator_args} + --build-project TestFindwxWidgets + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindwxWidgets/Test/CMakeLists.txt b/Tests/FindwxWidgets/Test/CMakeLists.txt new file mode 100644 index 0000000..ecc9c36 --- /dev/null +++ b/Tests/FindwxWidgets/Test/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.26) +project(TestFindwxWidgets CXX) +include(CTest) + +find_package(wxWidgets REQUIRED) + +add_executable(test_tgt main.cpp) +target_link_libraries(test_tgt wxWidgets::wxWidgets) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.cpp) +target_link_libraries(test_var PRIVATE ${wxWidgets_LIBRARIES}) +target_link_directories(test_var PRIVATE ${wxWidgets_LIBRARY_DIRS}) +target_include_directories(test_var PRIVATE ${wxWidgets_INCLUDE_DIRS}) +target_compile_options(test_var PRIVATE ${wxWidgets_CONFIG_OPTIONS}) +target_compile_definitions(test_var PRIVATE ${wxWidgets_DEFINITIONS}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindwxWidgets/Test/main.cpp b/Tests/FindwxWidgets/Test/main.cpp new file mode 100644 index 0000000..0e576cf --- /dev/null +++ b/Tests/FindwxWidgets/Test/main.cpp @@ -0,0 +1,7 @@ +#include <wx/filefn.h> + +int main() +{ + wxGetCwd(); + return 0; +} |