diff options
author | Brad King <brad.king@kitware.com> | 2016-08-16 20:56:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-31 13:05:14 (GMT) |
commit | e56aa462976f80762712519a4cf653b8c45bf3db (patch) | |
tree | f743e2300d75e9294d090318f7e450d9baaf457d /Tests/FindLibUV | |
parent | 551d5aedbffc0020793c2b6b374f1fa2be3e91d8 (diff) | |
download | CMake-e56aa462976f80762712519a4cf653b8c45bf3db.zip CMake-e56aa462976f80762712519a4cf653b8c45bf3db.tar.gz CMake-e56aa462976f80762712519a4cf653b8c45bf3db.tar.bz2 |
FindLibUV: Add module to find libuv package
Add it to a private source directory that is not installed so that we
can use it for building CMake itself. This will allow it to mature
before being distributed publicly.
Diffstat (limited to 'Tests/FindLibUV')
-rw-r--r-- | Tests/FindLibUV/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindLibUV/Test/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/FindLibUV/Test/main.c | 7 |
3 files changed, 34 insertions, 0 deletions
diff --git a/Tests/FindLibUV/CMakeLists.txt b/Tests/FindLibUV/CMakeLists.txt new file mode 100644 index 0000000..08aa958 --- /dev/null +++ b/Tests/FindLibUV/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindLibUV.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindLibUV/Test" + "${CMake_BINARY_DIR}/Tests/FindLibUV/Test" + ${build_generator_args} + --build-project TestFindLibUV + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindLibUV/Test/CMakeLists.txt b/Tests/FindLibUV/Test/CMakeLists.txt new file mode 100644 index 0000000..257ddf3 --- /dev/null +++ b/Tests/FindLibUV/Test/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.6) +project(TestFindLibUV C) +include(CTest) + +# CMake does not actually provide FindLibUV publicly. +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) + +find_package(LibUV REQUIRED) + +add_executable(test_libuv_tgt main.c) +target_link_libraries(test_libuv_tgt LibUV::LibUV) +add_test(NAME test_libuv_tgt COMMAND test_libuv_tgt) + +add_executable(test_libuv_var main.c) +target_include_directories(test_libuv_var PRIVATE ${LibUV_INCLUDE_DIRS}) +target_link_libraries(test_libuv_var PRIVATE ${LibUV_LIBRARIES}) +add_test(NAME test_libuv_var COMMAND test_libuv_var) diff --git a/Tests/FindLibUV/Test/main.c b/Tests/FindLibUV/Test/main.c new file mode 100644 index 0000000..cbd0db3 --- /dev/null +++ b/Tests/FindLibUV/Test/main.c @@ -0,0 +1,7 @@ +#include <uv.h> + +int main() +{ + uv_loop_close(uv_default_loop()); + return 0; +} |