From f379b24745b2e1624991597d81ce1b8225d00e87 Mon Sep 17 00:00:00 2001
From: ilor <kailoran@gmail.com>
Date: Tue, 31 May 2011 13:53:05 +0200
Subject: [PATCH] Conditional build of Swig

---
 CMakeLists.txt | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6130ac9..2224152 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,7 @@ IF(NOT CMAKE_BUILD_TYPE)
 		FORCE)
 ENDIF(NOT CMAKE_BUILD_TYPE)
 
+set(WCCL_BUILD_SWIG True CACHE BOOL "Build SWIG Python wrappers" FORCE)
 
 if(CMAKE_COMPILER_IS_GNUCXX)
 	# Set our own default flags at first run.
@@ -62,4 +63,16 @@ endif(MSVC OR BORLAND)
 add_subdirectory(libwccl)
 add_subdirectory(wccl-apps)
 add_subdirectory(tests)
-add_subdirectory(swig)
+
+if(WCCL_BUILD_SWIG)
+	FIND_PACKAGE(SWIG)
+	if(SWIG_FOUND)
+		message(STATUS "SWIG found, Python wrappers will be built")
+		add_subdirectory(swig)
+	else()
+		message(STATUS "WARNING: SWIG not found, Python wrappers will not be built")
+	endif(SWIG_FOUND)
+else()
+	message(STATUS "Not building SWIG Python wrappers")
+endif(WCCL_BUILD_SWIG)
+
-- 
GitLab