You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2012/12/05 18:43:03 UTC

svn commit: r1417554 - /qpid/proton/trunk/proton-c/bindings/CMakeLists.txt

Author: astitcher
Date: Wed Dec  5 17:43:02 2012
New Revision: 1417554

URL: http://svn.apache.org/viewvc?rev=1417554&view=rev
Log:
PROTON-108: Allow bindings builds to be turned off
- Re-arranged the bindings build files to make it easier to add
  new bindings and to turn off individual binding builds

Modified:
    qpid/proton/trunk/proton-c/bindings/CMakeLists.txt

Modified: qpid/proton/trunk/proton-c/bindings/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/CMakeLists.txt?rev=1417554&r1=1417553&r2=1417554&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/bindings/CMakeLists.txt Wed Dec  5 17:43:02 2012
@@ -19,32 +19,50 @@
 
 include(UseSWIG)
 
+# Add any new bindings here - the directory name must be the same as the binding name
+set (BINDINGS python ruby php perl)
+
 set (BINDING_DEPS qpid-proton)
 
-# Build wrapper for Python:
+# Add a block here to detect the prerequisites to build each language binding:
+#
+# If the prerequisites for the binding are present set a variable called
+# DEFAULT_{uppercase name of binding} to ON
+
+# Prerequisites for Python wrapper:
 find_package (PythonLibs)
 if (PYTHONLIBS_FOUND)
-  add_subdirectory(python)
+  set (DEFAULT_PYTHON ON)
 endif (PYTHONLIBS_FOUND)
 
-# Build wrapper for Ruby:
+# Prerequisites for Ruby:
 find_package(Ruby)
 if (RUBY_FOUND)
-  add_subdirectory(ruby)
+  set (DEFAULT_RUBY ON)
 endif (RUBY_FOUND)
 
-# Build wrapper for PHP
+# Prerequites for PHP:
 # For now, assume PHP support if the 'php-config' tool is present.
 # @todo: allow user to specify which php-config if multiple PHP sources installed!
 find_program(PHP_CONFIG_EXE php-config)
 if (PHP_CONFIG_EXE)
   find_program(PHP_EXE php)
   if (PHP_EXE)
-    add_subdirectory(php)
+    set (DEFAULT_PHP ON)
   endif (PHP_EXE)
 endif (PHP_CONFIG_EXE)
 
+# Prerequisites for Perl:
 include(FindPerlLibs)
 if (PERLLIBS_FOUND)
-  add_subdirectory(perl)
+  set (DEFAULT_PERL ON)
 endif (PERLLIBS_FOUND)
+
+# Shouldn't need to modify below here when adding new language binding
+foreach(BINDING ${BINDINGS})
+  string(TOUPPER ${BINDING} UBINDING)
+  option("BUILD_${UBINDING}" "Build ${BINDING} language binding" ${DEFAULT_${UBINDING}})
+  if ("BUILD_${UBINDING}")
+    add_subdirectory(${BINDING})
+  endif ()
+endforeach(BINDING)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org