[ismrmrd] 165/281: updating FindXSD to respect find_package args.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag ismrmrd0.5
in repository ismrmrd.

commit 57f173c3db3b31768ef6c293a81bcb32358f8077
Author: Joseph Naegele <joseph.naegele at gmail.com>
Date:   Mon Aug 12 11:39:03 2013 -0400

    updating FindXSD to respect find_package args.
    
    Prior to this commit, the REQUIRED arg to find_package
    did nothing. Depending on the location of XSD on your system,
    you may still need to defined XSD_DIR for cmake, or set an
    XSD_DIR env variable.
---
 cmake/FindXSD.cmake | 72 ++++++++++++++++-------------------------------------
 1 file changed, 22 insertions(+), 50 deletions(-)

diff --git a/cmake/FindXSD.cmake b/cmake/FindXSD.cmake
index ed83d61..59a8834 100644
--- a/cmake/FindXSD.cmake
+++ b/cmake/FindXSD.cmake
@@ -1,57 +1,26 @@
-# - Find CodeSource Xsd
-# This module can be used to find Xsd and it's include path
+# - Find CodeSynthesis XSD
+# This module can be used to find XSD and it's include path
 # Variables:
-#	XSD_EXECUTABLE
-#	XSD_INCLUDE_DIR
-#	XSD_FOUND
+#	XSD_FOUND - System has XSD
+#	XSD_EXECUTABLE - XSD binary executable
+#	XSD_INCLUDE_DIR - XSD include directory
+#
+# Functions:
+#       WRAP_XSD - Generates C++ bindings in the given output directory for a given schema file
 
-SET(XSD_FOUND FALSE)
+if(NOT DEFINED XSD_DIR AND DEFINED ENV{XSD_DIR})
+    set(XSD_DIR $ENV{XSD_DIR})
+endif(NOT DEFINED XSD_DIR AND DEFINED ENV{XSD_DIR})
 
-if(WIN32)
-	SET(__XSD_NAME xsd.exe)
-else(WIN32)
-	SET(__XSD_NAME xsdcxx xsd)
-endif(WIN32)
+find_program(XSD_EXECUTABLE NAMES xsd xsdcxx xsd.exe
+    PATHS ${XSD_DIR} /usr /usr/local
+    PATH_SUFFIXES bin
+)
 
-if(XSD_INCLUDE_DIR)
-	#in cache already
-	SET(XSD_FOUND TRUE)
-else(XSD_INCLUDE_DIR)
-	IF (WIN32) 
-	find_program(XSD_EXECUTABLE NAMES "bin/${__XSD_NAME}" "${__XSD_NAME}"
-	     PATHS
-		 ${XSD_DIR}
-		 ${XSD_DIR}/bin
-	)
-	ELSE(WIN32)
-	find_file(XSD_EXECUTABLE NAMES ${__XSD_NAME}
-	     PATHS
-	         /usr/local/bin
-		 /usr/bin
-		 ${XSD_DIR}
-		 ${XSD_DIR}/bin
-	)
-	ENDIF(WIN32)
-
-	if(XSD_EXECUTABLE)
-		SET(XSD_FOUND TRUE)
-	else(XSD_EXECUTABLE)
-		SET(XSD_EXECUTABLE "xsd-NOTFOUND" CACHE FILE "xsd executable path")
-	endif(XSD_EXECUTABLE)
-
-	find_path(XSD_INCLUDE_DIR NAMES xsd 
-	    PATHS
-		${XSD_DIR}/include
-		/usr/include
-		/usr/local/include
-	)
-
-	if(XSD_INCLUDE_DIR)
-		SET(XSD_FOUND TRUE)
-	else(XSD_INCLUDE_DIR)
-		SET(XSD_INCLUDE_DIR "xsd-include-NOTFOUND" CACHE PATH "xsd include path")
-	endif(XSD_INCLUDE_DIR)
-endif(XSD_INCLUDE_DIR)
+find_path(XSD_INCLUDE_DIR NAMES xsd/cxx/pre.hxx
+    PATHS ${XSD_DIR} /usr /usr/local
+    PATH_SUFFIXES include
+)
 
 FUNCTION(XSD_EXTRACT_OPTIONS _xsd_files _xsd_options)
 	foreach(current_arg ${ARGN})
@@ -94,3 +63,6 @@ FUNCTION(WRAP_XSD XSD_SRCS XSD_INCLUDES OUT_PATH)
 	SET(${XSD_SRCS} ${_XSD_SRCS} PARENT_SCOPE)
 ENDFUNCTION(WRAP_XSD)
 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(XSD DEFAULT_MSG XSD_INCLUDE_DIR XSD_EXECUTABLE)
+mark_as_advanced(XSD_INCLUDE_DIR XSD_EXECUTABLE)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git



More information about the debian-science-commits mailing list