blob: e0585eebc6fa800b58534f5c959fe92fe8019b0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
cmake_minimum_required(VERSION 3.7)
project(testFindGTK2 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()
|