diff options
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 1b5ed03af0..e03a8170cc 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 0000000000..ff42bcec1a --- /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 0000000000..954ee1092b --- /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 0000000000..4a108ad24a --- /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); +} |