diff options
author | Brad King <brad.king@kitware.com> | 2019-03-18 15:26:40 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-18 15:26:49 (GMT) |
commit | 23874e407839bdd93a05285c65a5dc20c225ac24 (patch) | |
tree | cf40838cf028d6708ece54a4a20172826313effe /Tests | |
parent | 4480769f8bdcc0fa954da098a1612003102a7056 (diff) | |
parent | a77a30e657acea42787b22e88f84fa829b6234d0 (diff) | |
download | CMake-23874e407839bdd93a05285c65a5dc20c225ac24.zip CMake-23874e407839bdd93a05285c65a5dc20c225ac24.tar.gz CMake-23874e407839bdd93a05285c65a5dc20c225ac24.tar.bz2 |
Merge topic 'FindGLEW-updates'
a77a30e657 FindGLEW: Add test
a7d853868b FindGLEW: Update implementation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3094
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/FindGLEW/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindGLEW/Test/CMakeLists.txt | 18 | ||||
-rw-r--r-- | Tests/FindGLEW/Test/main.cpp | 8 |
4 files changed, 40 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 01f8226..74da394 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1445,6 +1445,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindGit) endif() + if(CMake_TEST_FindGLEW) + add_subdirectory(FindGLEW) + endif() + if(CMake_TEST_FindGSL) add_subdirectory(FindGSL) endif() diff --git a/Tests/FindGLEW/CMakeLists.txt b/Tests/FindGLEW/CMakeLists.txt new file mode 100644 index 0000000..ff42bce --- /dev/null +++ b/Tests/FindGLEW/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindGLEW.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindGLEW/Test" + "${CMake_BINARY_DIR}/Tests/FindGLEW/Test" + ${build_generator_args} + --build-project TestFindGLEW + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindGLEW/Test/CMakeLists.txt b/Tests/FindGLEW/Test/CMakeLists.txt new file mode 100644 index 0000000..954ee10 --- /dev/null +++ b/Tests/FindGLEW/Test/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindGLEW LANGUAGES CXX) +include(CTest) + +find_package(GLEW REQUIRED) + +add_executable(test_glew_shared_tgt main.cpp) +target_link_libraries(test_glew_shared_tgt GLEW::GLEW) +add_test(NAME test_glew_shared_tgt COMMAND test_glew_shared_tgt) + +add_executable(test_glew_generic_tgt main.cpp) +target_link_libraries(test_glew_generic_tgt GLEW::glew) +add_test(NAME test_glew_generic_tgt COMMAND test_glew_generic_tgt) + +add_executable(test_glew_var main.cpp) +target_include_directories(test_glew_var PRIVATE ${GLEW_INCLUDE_DIRS}) +target_link_libraries(test_glew_var PRIVATE ${GLEW_LIBRARIES}) +add_test(NAME test_glew_var COMMAND test_glew_var) diff --git a/Tests/FindGLEW/Test/main.cpp b/Tests/FindGLEW/Test/main.cpp new file mode 100644 index 0000000..4a108ad --- /dev/null +++ b/Tests/FindGLEW/Test/main.cpp @@ -0,0 +1,8 @@ +#include <GL/glew.h> + +int main() +{ + GLenum init_return = glewInit(); + + return (init_return == GLEW_OK); +} |