summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-09 15:06:30 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-11-09 15:06:30 (GMT)
commit20e445f4418088ddf6e8f30ff3425af1588d2710 (patch)
treeed18dcf6074b30898fc76af1dd597208f0ddf947
parentc53e692db92ce5f24151f4bded40ffcddc9b0fb2 (diff)
parent5d79b9563f7852098721a9218a13c84383f780ed (diff)
downloadCMake-20e445f4418088ddf6e8f30ff3425af1588d2710.zip
CMake-20e445f4418088ddf6e8f30ff3425af1588d2710.tar.gz
CMake-20e445f4418088ddf6e8f30ff3425af1588d2710.tar.bz2
Merge topic 'FindGTK2_GTK2_TARGETS'
5d79b956 FindGTK2: Use targets in GTK2_LIBRARIES if GTK2_USE_IMPORTED_TARGETS is ON
-rw-r--r--Help/release/dev/FindGTK2_GTK2_TARGETS.rst7
-rw-r--r--Modules/FindGTK2.cmake11
2 files changed, 18 insertions, 0 deletions
diff --git a/Help/release/dev/FindGTK2_GTK2_TARGETS.rst b/Help/release/dev/FindGTK2_GTK2_TARGETS.rst
new file mode 100644
index 0000000..76e3657
--- /dev/null
+++ b/Help/release/dev/FindGTK2_GTK2_TARGETS.rst
@@ -0,0 +1,7 @@
+FindGTK2_GTK2_TARGETS
+---------------------
+
+* The :module:`FindGTK2` module, when ``GTK2_USE_IMPORTED_TARGETS`` is
+ enabled, now sets ``GTK2_LIBRARIES`` to contain the list of imported
+ targets instead of the paths to the libraries. Moreover it now sets
+ a new ``GTK2_TARGETS`` variable containing all the targets imported.
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index ab4ef3e..6e4a7f2 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -34,6 +34,7 @@
# GTK2_FOUND - Were all of your specified components found?
# GTK2_INCLUDE_DIRS - All include directories
# GTK2_LIBRARIES - All libraries
+# GTK2_TARGETS - All imported targets
# GTK2_DEFINITIONS - Additional compiler flags
#
#
@@ -550,6 +551,9 @@ function(_GTK2_ADD_TARGET _var)
add_library(GTK2::${_basename} UNKNOWN IMPORTED)
+ set(GTK2_TARGETS ${GTK2_TARGETS} GTK2::${_basename})
+ set(GTK2_TARGETS ${GTK2_TARGETS} PARENT_SCOPE)
+
if(GTK2_${_var}_LIBRARY_RELEASE)
set_property(TARGET GTK2::${_basename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_property(TARGET GTK2::${_basename} PROPERTY IMPORTED_LOCATION_RELEASE "${GTK2_${_var}_LIBRARY_RELEASE}" )
@@ -602,6 +606,7 @@ endfunction()
set(GTK2_FOUND)
set(GTK2_INCLUDE_DIRS)
set(GTK2_LIBRARIES)
+set(GTK2_TARGETS)
set(GTK2_DEFINITIONS)
if(NOT GTK2_FIND_COMPONENTS)
@@ -940,6 +945,11 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
endif()
endforeach()
+if(GTK2_USE_IMPORTED_TARGETS)
+ set(GTK2_LIBRARIES ${GTK2_TARGETS})
+endif()
+
+
if(_GTK2_did_we_find_everything AND NOT GTK2_VERSION_CHECK_FAILED)
set(GTK2_FOUND true)
else()
@@ -951,6 +961,7 @@ else()
set(GTK2_VERSION_PATCH)
set(GTK2_INCLUDE_DIRS)
set(GTK2_LIBRARIES)
+ set(GTK2_TARGETS)
set(GTK2_DEFINITIONS)
endif()