diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindOpenGL/Test/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMP0072-NEW-stdout.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMP0072-NEW.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMP0072-OLD-stdout.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMP0072-OLD.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMP0072-WARN-stderr.txt | 21 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMP0072-WARN-stdout.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMP0072-WARN.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMP0072-common.cmake | 13 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/FindOpenGL/RunCMakeTest.cmake | 5 |
12 files changed, 59 insertions, 1 deletions
diff --git a/Tests/FindOpenGL/Test/CMakeLists.txt b/Tests/FindOpenGL/Test/CMakeLists.txt index 3b5ffee..9004a98 100644 --- a/Tests/FindOpenGL/Test/CMakeLists.txt +++ b/Tests/FindOpenGL/Test/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.10) +cmake_policy(SET CMP0072 NEW) project(TestFindOpenGL C) include(CTest) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 5d584af..07d9f08 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -144,6 +144,7 @@ add_RunCMake_test(ExternalData) add_RunCMake_test(FeatureSummary) add_RunCMake_test(FPHSA) add_RunCMake_test(FindBoost) +add_RunCMake_test(FindOpenGL) if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom") add_RunCMake_test(GenerateExportHeader) endif() diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-NEW-stdout.txt b/Tests/RunCMake/FindOpenGL/CMP0072-NEW-stdout.txt new file mode 100644 index 0000000..f5ee220 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-NEW-stdout.txt @@ -0,0 +1,3 @@ +-- OpenGL_GL_PREFERENCE='GLVND' +-- OPENGL_gl_LIBRARY='' +-- OPENGL_LIBRARIES='OpenGL;GLX;GLU' diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-NEW.cmake b/Tests/RunCMake/FindOpenGL/CMP0072-NEW.cmake new file mode 100644 index 0000000..6cbbeec --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0072 NEW) +include(CMP0072-common.cmake) diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stdout.txt b/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stdout.txt new file mode 100644 index 0000000..22df1b1 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stdout.txt @@ -0,0 +1,3 @@ +-- OpenGL_GL_PREFERENCE='LEGACY' +-- OPENGL_gl_LIBRARY='GL' +-- OPENGL_LIBRARIES='GL;GLU' diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-OLD.cmake b/Tests/RunCMake/FindOpenGL/CMP0072-OLD.cmake new file mode 100644 index 0000000..6d57004 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0072 OLD) +include(CMP0072-common.cmake) diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-WARN-stderr.txt b/Tests/RunCMake/FindOpenGL/CMP0072-WARN-stderr.txt new file mode 100644 index 0000000..f26f217 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-WARN-stderr.txt @@ -0,0 +1,21 @@ +^CMake Warning \(dev\) at .*/Modules/FindOpenGL.cmake:[0-9]+ \(message\): + Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when + available. Run "cmake --help-policy CMP0072" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + FindOpenGL found both a legacy GL library: + + OPENGL_gl_LIBRARY: GL + + and GLVND libraries for OpenGL and GLX: + + OPENGL_opengl_LIBRARY: OpenGL + OPENGL_glx_LIBRARY: GLX + + OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for + compatibility with CMake 3.10 and below the legacy GL library will be used. +Call Stack \(most recent call first\): + CMP0072-common.cmake:[0-9]+ \(find_package\) + CMP0072-WARN.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-WARN-stdout.txt b/Tests/RunCMake/FindOpenGL/CMP0072-WARN-stdout.txt new file mode 100644 index 0000000..22df1b1 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-WARN-stdout.txt @@ -0,0 +1,3 @@ +-- OpenGL_GL_PREFERENCE='LEGACY' +-- OPENGL_gl_LIBRARY='GL' +-- OPENGL_LIBRARIES='GL;GLU' diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-WARN.cmake b/Tests/RunCMake/FindOpenGL/CMP0072-WARN.cmake new file mode 100644 index 0000000..459c458 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-WARN.cmake @@ -0,0 +1 @@ +include(CMP0072-common.cmake) diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-common.cmake b/Tests/RunCMake/FindOpenGL/CMP0072-common.cmake new file mode 100644 index 0000000..3fe8030 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-common.cmake @@ -0,0 +1,13 @@ +set(CYGWIN 0) +set(WIN32 0) +set(APPLE 0) +set(OPENGL_INCLUDE_DIR GL/include) +set(OPENGL_GLX_INCLUDE_DIR GLX/include) +set(OPENGL_gl_LIBRARY GL) +set(OPENGL_opengl_LIBRARY OpenGL) +set(OPENGL_glx_LIBRARY GLX) +set(OPENGL_glu_LIBRARY GLU) +find_package(OpenGL) +message(STATUS "OpenGL_GL_PREFERENCE='${OpenGL_GL_PREFERENCE}'") +message(STATUS "OPENGL_gl_LIBRARY='${OPENGL_gl_LIBRARY}'") +message(STATUS "OPENGL_LIBRARIES='${OPENGL_LIBRARIES}'") diff --git a/Tests/RunCMake/FindOpenGL/CMakeLists.txt b/Tests/RunCMake/FindOpenGL/CMakeLists.txt new file mode 100644 index 0000000..bf2ef15 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.10) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FindOpenGL/RunCMakeTest.cmake b/Tests/RunCMake/FindOpenGL/RunCMakeTest.cmake new file mode 100644 index 0000000..fcc130f --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0072-WARN) +run_cmake(CMP0072-OLD) +run_cmake(CMP0072-NEW) |