summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-31 13:19:31 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-31 13:19:31 (GMT)
commit6f8b93983a3bfb4a9262cae8e9b989edb61e8a4b (patch)
treea430cba0fcb321a72db0a5f5414f36ddf0268585 /Tests
parent59d559af2e35d3521c7cffc4a0c7c33ffaf2c744 (diff)
parent39ac889d636ee8ce083e00ab2c8351c6148150ef (diff)
downloadCMake-6f8b93983a3bfb4a9262cae8e9b989edb61e8a4b.zip
CMake-6f8b93983a3bfb4a9262cae8e9b989edb61e8a4b.tar.gz
CMake-6f8b93983a3bfb4a9262cae8e9b989edb61e8a4b.tar.bz2
Merge topic 'import-libuv'
39ac889d cmake: Add trivial usage of libuv 7cf369fe Do not build libuv on HP-UX 075cae51 Do not build libuv on SPARC 9a53af40 Do not build libuv on Cygwin 219f7411 Do not build libuv on Mac OS X 10.4 and lower 8a5beef3 Add option to build CMake against a system libuv e56aa462 FindLibUV: Add module to find libuv package 551d5aed libuv: Fix unused variable warning in uv_loop_close f4f8074b libuv: Avoid including macOS CoreServices header globally a63aaaed libuv: Always include our own header first 9130b53a libuv: Conditionally declare Windows APIs for VS 2008 and below b52afa46 libuv: Fix anonymous union syntax 05dbc204 libuv: Fix Windows API function typedef syntax 75139374 libuv: Install LICENSE file with CMake documentation 95dcc4e4 libuv: Disable warnings to avoid changing 3rd party code 13b7e758 libuv: Build the library within CMake ...
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt4
-rw-r--r--Tests/FindLibUV/CMakeLists.txt10
-rw-r--r--Tests/FindLibUV/Test/CMakeLists.txt17
-rw-r--r--Tests/FindLibUV/Test/main.c7
4 files changed, 38 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 4e9b062..3d0f264 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1373,6 +1373,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindJsonCpp)
endif()
+ if(CMake_TEST_FindLibUV)
+ add_subdirectory(FindLibUV)
+ endif()
+
if(CMake_TEST_FindLTTngUST)
add_subdirectory(FindLTTngUST)
endif()
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;
+}