| 
									
										
										
										
											2020-06-24 15:38:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Find the pugixml XML parsing library.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # Sets the usual variables expected for find_package scripts:
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # Looks for both the include files (via pkgconfig) and the shared library.
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | # PUGIXML_INCLUDE_DIR - header location
 | 
					
						
							|  |  |  | # PUGIXML_LIBRARIES - library to link against
 | 
					
						
							|  |  |  | # PUGIXML_FOUND - true if pugixml was found.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | include(FindPkgMacros)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-06 22:11:30 +00:00
										 |  |  | # On some macOS versions there could be a shared Pugixml library available, but as this
 | 
					
						
							|  |  |  | # is a rare exception, this hack is good enough to handle that scenario.
 | 
					
						
							|  |  |  | if(APPLE)
 | 
					
						
							|  |  |  |     set(CMAKE_FIND_LIBRARY_SUFFIXES .a .dylib)
 | 
					
						
							|  |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  | if(NOT WIN32)
 | 
					
						
							| 
									
										
										
										
											2020-08-17 17:15:05 +00:00
										 |  |  |     find_package(PkgConfig)
 | 
					
						
							|  |  |  |     pkg_check_modules(PUGIXML REQUIRED pugixml>=1.09)
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  |     # Set the full path to the library instead of just 'pugixml'.
 | 
					
						
							|  |  |  |     set(PUGIXML_LIBRARIES ${PUGIXML_LINK_LIBRARIES})
 | 
					
						
							|  |  |  | endif(NOT WIN32)
 | 
					
						
							| 
									
										
										
										
											2020-06-24 15:38:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  | if(WIN32)
 | 
					
						
							| 
									
										
										
										
											2020-08-17 17:15:05 +00:00
										 |  |  |     find_path(PUGIXML_INCLUDE_DIR pugixml.hpp)
 | 
					
						
							| 
									
										
										
										
											2020-06-24 15:38:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  | include(FindPackageHandleStandardArgs)
 | 
					
						
							| 
									
										
										
										
											2020-06-24 15:38:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | find_package_handle_standard_args(PUGIXML DEFAULT_MSG PUGIXML_INCLUDE_DIR)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  | if(NOT PUGIXML_INCLUDE_DIR)
 | 
					
						
							| 
									
										
										
										
											2020-06-24 15:38:41 +00:00
										 |  |  |     message(FATAL_ERROR "PUGIXML include files not found!")
 | 
					
						
							|  |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  | endif(WIN32)
 | 
					
						
							| 
									
										
										
										
											2020-06-24 15:38:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | find_library(PUGIXML_LIBRARY pugixml)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  | if(NOT PUGIXML_LIBRARY)
 | 
					
						
							| 
									
										
										
										
											2020-06-24 15:38:41 +00:00
										 |  |  |     message(FATAL_ERROR "libpugixml library not found!")
 | 
					
						
							|  |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  | include(FindPackageHandleStandardArgs)
 | 
					
						
							| 
									
										
										
										
											2020-06-24 15:38:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-27 19:04:02 +00:00
										 |  |  | find_package_handle_standard_args(Pugixml DEFAULT_MSG PUGIXML_LIBRARY)
 | 
					
						
							| 
									
										
										
										
											2021-04-06 22:11:30 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Change back to the previous search order, which is required for the libraries following this one.
 | 
					
						
							|  |  |  | if(APPLE)
 | 
					
						
							|  |  |  |     set(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .a)
 | 
					
						
							|  |  |  | endif()
 |