1## gflags CMake configuration file 2 3# library version information 4set (@PACKAGE_PREFIX@_VERSION_STRING "@PACKAGE_VERSION@") 5set (@PACKAGE_PREFIX@_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@) 6set (@PACKAGE_PREFIX@_VERSION_MINOR @PACKAGE_VERSION_MINOR@) 7set (@PACKAGE_PREFIX@_VERSION_PATCH @PACKAGE_VERSION_PATCH@) 8 9# import targets 10if (NOT DEFINED @PACKAGE_PREFIX@_USE_TARGET_NAMESPACE) 11 set (@PACKAGE_PREFIX@_USE_TARGET_NAMESPACE FALSE) 12endif () 13if (@PACKAGE_PREFIX@_USE_TARGET_NAMESPACE) 14 include ("${CMAKE_CURRENT_LIST_DIR}/@EXPORT_NAME@.cmake") 15 set (@PACKAGE_PREFIX@_TARGET_NAMESPACE @PACKAGE_NAME@) 16else () 17 include ("${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_NAME@-nonamespace-targets.cmake") 18 set (@PACKAGE_PREFIX@_TARGET_NAMESPACE) 19endif () 20if (@PACKAGE_PREFIX@_TARGET_NAMESPACE) 21 set (@PACKAGE_PREFIX@_TARGET_PREFIX ${@PACKAGE_PREFIX@_TARGET_NAMESPACE}::) 22else () 23 set (@PACKAGE_PREFIX@_TARGET_PREFIX) 24endif () 25 26# installation prefix 27get_filename_component (CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 28get_filename_component (_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PREFIX_REL2CONFIG_DIR@" ABSOLUTE) 29 30# include directory 31# 32# Newer versions of CMake set the INTERFACE_INCLUDE_DIRECTORIES property 33# of the imported targets. It is hence not necessary to add this path 34# manually to the include search path for targets which link to gflags. 35set (@PACKAGE_PREFIX@_INCLUDE_DIR "${_INSTALL_PREFIX}/@INCLUDE_INSTALL_DIR@") 36 37if (@PACKAGE_NAME@_FIND_COMPONENTS) 38 foreach (@PACKAGE_NAME@_FIND_COMPONENT IN LISTS @PACKAGE_NAME@_FIND_COMPONENTS) 39 if (@PACKAGE_NAME@_FIND_REQUIRED_${@PACKAGE_NAME@_FIND_COMPONENT} AND NOT TARGET @PACKAGE_NAME@_${@PACKAGE_NAME@_FIND_COMPONENT}) 40 message (FATAL_ERROR "Package @PACKAGE_NAME@ was installed without required component ${@PACKAGE_NAME@_FIND_COMPONENT}!") 41 endif () 42 endforeach () 43 list (GET @PACKAGE_NAME@_FIND_COMPONENTS 0 @PACKAGE_NAME@_FIND_COMPONENT) 44else () 45 set (@PACKAGE_NAME@_FIND_COMPONENT) 46endif () 47 48# default settings of @PACKAGE_PREFIX@_SHARED and @PACKAGE_PREFIX@_NOTHREADS 49# 50# It is recommended to use either one of the following find_package commands 51# instead of setting the @PACKAGE_PREFIX@_(SHARED|NOTHREADS) variables: 52# - find_package(@PACKAGE_NAME@ REQUIRED) 53# - find_package(@PACKAGE_NAME@ COMPONENTS nothreads_static) 54# - find_package(@PACKAGE_NAME@ COMPONENTS nothreads_shared) 55# - find_package(@PACKAGE_NAME@ COMPONENTS static) 56# - find_package(@PACKAGE_NAME@ COMPONENTS shared) 57if (NOT DEFINED @PACKAGE_PREFIX@_SHARED) 58 if (DEFINED @PACKAGE_NAME@_SHARED) 59 set (@PACKAGE_PREFIX@_SHARED ${@PACKAGE_NAME@_SHARED}) 60 elseif (@PACKAGE_NAME@_FIND_COMPONENT) 61 if (@PACKAGE_NAME@_FIND_COMPONENT MATCHES "shared") 62 set (@PACKAGE_PREFIX@_SHARED TRUE) 63 else () 64 set (@PACKAGE_PREFIX@_SHARED FALSE) 65 endif () 66 elseif (TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_shared OR TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_nothreads_shared) 67 set (@PACKAGE_PREFIX@_SHARED TRUE) 68 else () 69 set (@PACKAGE_PREFIX@_SHARED FALSE) 70 endif () 71endif () 72if (NOT DEFINED @PACKAGE_PREFIX@_NOTHREADS) 73 if (DEFINED @PACKAGE_NAME@_NOTHREADS) 74 set (@PACKAGE_PREFIX@_NOTHREADS ${@PACKAGE_NAME@_NOTHREADS}) 75 elseif (@PACKAGE_NAME@_FIND_COMPONENT) 76 if (@PACKAGE_NAME@_FIND_COMPONENT MATCHES "nothreads") 77 set (@PACKAGE_PREFIX@_NOTHREADS TRUE) 78 else () 79 set (@PACKAGE_PREFIX@_NOTHREADS FALSE) 80 endif () 81 elseif (TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}PACKAGE_NAME@_static OR TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_shared) 82 set (@PACKAGE_PREFIX@_NOTHREADS FALSE) 83 else () 84 set (@PACKAGE_PREFIX@_NOTHREADS TRUE) 85 endif () 86endif () 87 88# choose imported library target 89if (NOT @PACKAGE_PREFIX@_TARGET) 90 if (@PACKAGE_NAME@_TARGET) 91 set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_NAME@_TARGET}) 92 elseif (@PACKAGE_PREFIX@_SHARED) 93 if (@PACKAGE_PREFIX@_NOTHREADS) 94 set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_nothreads_shared) 95 else () 96 set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_shared) 97 endif () 98 else () 99 if (@PACKAGE_PREFIX@_NOTHREADS) 100 set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_nothreads_static) 101 else () 102 set (@PACKAGE_PREFIX@_TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@_static) 103 endif () 104 endif () 105endif () 106if (NOT TARGET ${@PACKAGE_PREFIX@_TARGET}) 107 message (FATAL_ERROR "Your @PACKAGE_NAME@ installation does not contain a ${@PACKAGE_PREFIX@_TARGET} library target!" 108 " Try a different combination of @PACKAGE_PREFIX@_SHARED and @PACKAGE_PREFIX@_NOTHREADS.") 109endif () 110 111# add more convenient "${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@" import target 112if (NOT TARGET ${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@) 113 if (@PACKAGE_PREFIX@_SHARED) 114 add_library (${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ SHARED IMPORTED) 115 else () 116 add_library (${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ STATIC IMPORTED) 117 endif () 118 # copy INTERFACE_* properties 119 foreach (_@PACKAGE_PREFIX@_PROPERTY_NAME IN ITEMS 120 COMPILE_DEFINITIONS 121 COMPILE_FEATURES 122 COMPILE_OPTIONS 123 INCLUDE_DIRECTORIES 124 LINK_LIBRARIES 125 POSITION_INDEPENDENT_CODE 126 ) 127 get_target_property (_@PACKAGE_PREFIX@_PROPERTY_VALUE ${@PACKAGE_PREFIX@_TARGET} INTERFACE_${_@PACKAGE_PREFIX@_PROPERTY_NAME}) 128 if (_@PACKAGE_PREFIX@_PROPERTY_VALUE) 129 set_target_properties(${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ PROPERTIES 130 INTERFACE_${_@PACKAGE_PREFIX@_PROPERTY_NAME} "${_@PACKAGE_PREFIX@_PROPERTY_VALUE}" 131 ) 132 endif () 133 endforeach () 134 # copy IMPORTED_*_<CONFIG> properties 135 get_target_property (_@PACKAGE_PREFIX@_CONFIGURATIONS ${@PACKAGE_PREFIX@_TARGET} IMPORTED_CONFIGURATIONS) 136 set_target_properties (${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ PROPERTIES IMPORTED_CONFIGURATIONS "${_@PACKAGE_PREFIX@_CONFIGURATIONS}") 137 foreach (_@PACKAGE_PREFIX@_PROPERTY_NAME IN ITEMS 138 IMPLIB 139 LOCATION 140 LINK_DEPENDENT_LIBRARIES 141 LINK_INTERFACE_LIBRARIES 142 LINK_INTERFACE_LANGUAGES 143 LINK_INTERFACE_MULTIPLICITY 144 NO_SONAME 145 SONAME 146 ) 147 foreach (_@PACKAGE_PREFIX@_CONFIG IN LISTS _@PACKAGE_PREFIX@_CONFIGURATIONS) 148 get_target_property (_@PACKAGE_PREFIX@_PROPERTY_VALUE ${@PACKAGE_PREFIX@_TARGET} IMPORTED_${_@PACKAGE_PREFIX@_PROPERTY_NAME}_${_@PACKAGE_PREFIX@_CONFIG}) 149 if (_@PACKAGE_PREFIX@_PROPERTY_VALUE) 150 set_target_properties(${@PACKAGE_PREFIX@_TARGET_PREFIX}@PACKAGE_NAME@ PROPERTIES 151 IMPORTED_${_@PACKAGE_PREFIX@_PROPERTY_NAME}_${_@PACKAGE_PREFIX@_CONFIG} "${_@PACKAGE_PREFIX@_PROPERTY_VALUE}" 152 ) 153 endif () 154 endforeach () 155 endforeach () 156 unset (_@PACKAGE_PREFIX@_CONFIGURATIONS) 157 unset (_@PACKAGE_PREFIX@_CONFIG) 158 unset (_@PACKAGE_PREFIX@_PROPERTY_NAME) 159 unset (_@PACKAGE_PREFIX@_PROPERTY_VALUE) 160endif () 161 162# alias for default import target to be compatible with older CMake package configurations 163set (@PACKAGE_PREFIX@_LIBRARIES "${@PACKAGE_PREFIX@_TARGET}") 164 165# set @PACKAGE_NAME@_* variables for backwards compatibility 166if (NOT "^@PACKAGE_NAME@$" STREQUAL "^@PACKAGE_PREFIX@$") 167 foreach (_@PACKAGE_PREFIX@_VARIABLE IN ITEMS 168 VERSION_STRING 169 VERSION_MAJOR 170 VERSION_MINOR 171 VERSION_PATCH 172 INCLUDE_DIR 173 LIBRARIES 174 TARGET 175 ) 176 set (@PACKAGE_NAME@_${_@PACKAGE_PREFIX@_VARIABLE} "${@PACKAGE_PREFIX@_${_@PACKAGE_PREFIX@_VARIABLE}}") 177 endforeach () 178 unset (_@PACKAGE_PREFIX@_VARIABLE) 179endif () 180 181# unset private variables 182unset (@PACKAGE_NAME@_FIND_COMPONENT) 183unset (_INSTALL_PREFIX) 184