Files
CMake/Tests/RunCMake/FindGTK2/FindGTK2RunTwice.cmake
T
Brad King 1edf138506 Tests/RunCMake: Update cmake_minimum_required versions
For policy-specific tests, use the version before the policy was
introduced.  Otherwise, use 3.5 where possible.

Also, remove `cmake_minimum_required()` and `project()` calls from
individual cases where they are handled by `CMakeLists.txt`.
2023-02-11 06:24:22 -05:00

21 lines
574 B
CMake

enable_language(C)
# First call
find_package(GTK2 REQUIRED)
# Backup variables
set(GTK2_LIBRARIES_BAK ${GTK2_LIBRARIES})
set(GTK2_TARGETS_BAK ${GTK2_TARGETS})
# Second call
find_package(GTK2 REQUIRED)
# Check variables
if(NOT "${GTK2_LIBRARIES_BAK}" STREQUAL "${GTK2_LIBRARIES}")
message(SEND_ERROR "GTK2_LIBRARIES is different:\nbefore: ${GTK2_LIBRARIES_BAK}\nafter: ${GTK2_LIBRARIES}")
endif()
if(NOT "${GTK2_TARGETS_BAK}" STREQUAL "${GTK2_TARGETS}")
message(SEND_ERROR "GTK2_TARGETS is different:\nbefore: ${GTK2_TARGETS_BAK}\nafter: ${GTK2_TARGETS}")
endif()