[sword-svn] r2592 - in trunk: . cmake examples/cmdline tests

greg.hellings at crosswire.org greg.hellings at crosswire.org
Mon Dec 6 19:36:02 MST 2010


Author: greg.hellings
Date: 2010-12-06 19:36:02 -0700 (Mon, 06 Dec 2010)
New Revision: 2592

Modified:
   trunk/CMakeLists.txt
   trunk/cmake/FindCLucene.cmake
   trunk/cmake/FindICU.cmake
   trunk/cmake/FindRegex.cmake
   trunk/cmake/bindings.cmake
   trunk/cmake/install.cmake
   trunk/cmake/muxsources.cmake
   trunk/examples/cmdline/CMakeLists.txt
   trunk/tests/CMakeLists.txt
Log:
Cleaned up some CMake problems.

I took out a bunch of extraneous CMake output messages and bound up
several messages into more standardized output formats.

I also eliminated a configure problem where the bindings configure script
would be called even if the user had not selected bindings to be built.
This could cause configure to fail if SWIG was not found when the user did
not wish bindings to be built.


Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/CMakeLists.txt	2010-12-07 02:36:02 UTC (rev 2592)
@@ -38,6 +38,7 @@
 # This will look for various libraries that libsword builds against.  There is no REQUIRED
 # attribute added here, since all of the libraries here are not, in actuality, required.
 #
+MESSAGE(STATUS "\n-- SEARCHING FOR SYTEM PACKAGES")
 # Find our packages
 FIND_PACKAGE(ZLIB QUIET)
 FIND_PACKAGE(ICU QUIET)
@@ -77,11 +78,12 @@
 	IF(NOT MSVC OR NOT LIBSWORD_LIBRARY_TYPE MATCHES ".*Shared.*")
 		SET_TARGET_PROPERTIES(sword_static PROPERTIES 
 			OUTPUT_NAME "sword")
-		MESSAGE(STATUS "Building Static library with name sword")
+		#MESSAGE(STATUS "Building Static library with name sword")
 	ELSE(NOT MSVC OR NOT LIBSWORD_LIBRARY_TYPE MATCHES ".*Shared.*")
-		MESSAGE(STATUS "Building Static library with name
-		sword_static")
+		#MESSAGE(STATUS "Building Static library with name
+		#sword_static")
 	ENDIF(NOT MSVC OR NOT LIBSWORD_LIBRARY_TYPE MATCHES ".*Shared.*")
+	MESSAGE(STATUS "Building Static library.")
 ENDIF(LIBSWORD_LIBRARY_TYPE MATCHES ".*Static.*" OR NOT LIBSWORD_LIBRARY_TYPE)
 
 ################################################################################################
@@ -149,7 +151,7 @@
 	)
 ENDIF(BUILDING_STATIC)
 
-MESSAGE(STATUS "Setting CFlags for compile to ${SWORD_CFLAGS}")
+MESSAGE(STATUS "Setting CFlags to ${SWORD_CFLAGS}")
 
 ##############################################################################################
 # Setting libraries and includes
@@ -219,9 +221,9 @@
 # Bindings are good, right?
 #
 
-IF(NOT SWORD_BINDINGS STREQUAL "")
+IF(NOT SWORD_BINDINGS STREQUAL "" AND SWORD_BINDINGS)
 	INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/bindings.cmake")
-ENDIF(NOT SWORD_BINDINGS STREQUAL "")
+ENDIF(NOT SWORD_BINDINGS STREQUAL "" AND SWORD_BINDINGS)
 
 ##############################################################################################
 # Utilities are hawt

Modified: trunk/cmake/FindCLucene.cmake
===================================================================
--- trunk/cmake/FindCLucene.cmake	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/cmake/FindCLucene.cmake	2010-12-07 02:36:02 UTC (rev 2592)
@@ -63,7 +63,7 @@
 	NAMES clucene clucene-core
 	PATHS ${TRIAL_LIBRARY_PATHS})
 IF (CLUCENE_LIBRARY)
-	MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}")
+	#MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}")
 ENDIF (CLUCENE_LIBRARY)
 FIND_PATH(CLUCENE_INCLUDE_DIR
 	NAMES CLucene.h
@@ -71,7 +71,7 @@
 	ONLY_CMAKE_FIND_ROOT_PATH)
 
 IF (CLUCENE_INCLUDE_DIR)
-	MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}")
+	#MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}")
 ENDIF (CLUCENE_INCLUDE_DIR)
 
 IF(WIN32)
@@ -83,7 +83,7 @@
 FIND_PATH(CLUCENE_LIBRARY_DIR
 	NAMES CLucene/clucene-config.h PATHS ${TRIAL_LIBRARY_PATHS} ${TRIAL_INCLUDE_PATHS} NO_DEFAULT_PATH)
 IF (CLUCENE_LIBRARY_DIR)
-	MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
+	#MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
 	FILE(READ ${CLUCENE_LIBRARY_DIR}/CLucene/clucene-config.h CLCONTENT)
 	STRING(REGEX MATCH "_CL_VERSION +\".*\"" CLMATCH ${CLCONTENT})
 	IF (CLMATCH)
@@ -98,7 +98,7 @@
 	ENDIF (CLUCENE_VERSION STREQUAL "0.9.17")
 	ENDIF (CLMATCH)
 ELSE (CLUCENE_LIBRARY_DIR)
-	MESSAGE(STATUS "CLucene library dir not found.")
+	#MESSAGE(STATUS "CLucene library dir not found.")
 ENDIF (CLUCENE_LIBRARY_DIR)
 
 IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
@@ -107,11 +107,11 @@
 
 IF(CLucene_FOUND)
 	IF(NOT CLucene_FIND_QUIETLY)
-		MESSAGE(STATUS "Found CLucene: ${CLUCENE_LIBRARY}")
+		MESSAGE(STATUS "CLucene: Yes ${CLUCENE_LIBRARY}")
 	ENDIF(NOT CLucene_FIND_QUIETLY)
 ELSE(CLucene_FOUND)
 	IF(CLucene_FIND_REQUIRED)
-		MESSAGE(FATAL_ERROR "Could not find CLucene.")
+		MESSAGE(FATAL_ERROR "CLucene: No")
 	ENDIF(CLucene_FIND_REQUIRED)
 ENDIF(CLucene_FOUND)
 

Modified: trunk/cmake/FindICU.cmake
===================================================================
--- trunk/cmake/FindICU.cmake	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/cmake/FindICU.cmake	2010-12-07 02:36:02 UTC (rev 2592)
@@ -20,8 +20,8 @@
 )
 
 if(ICU_CONFIG_BIN)
-  MESSAGE(STATUS "icu-config found at ${ICU_CONFIG_BIN}: Using that for configuration")
-  MESSAGE(STATUS "genrb found at ${ICU_GENRB}: Using that for generating transliteration data")
+  MESSAGE(STATUS "[ICU] icu-config: Yes ${ICU_CONFIG_BIN}")
+  MESSAGE(STATUS "[ICU] genrb: Yes ${ICU_GENRB}")
 
   # Get include directories
   execute_process(COMMAND "${ICU_CONFIG_BIN}" "--cppflags"
@@ -95,4 +95,5 @@
   set(ICU_LIBRARIES)
   set(ICU_I18N_LIBRARIES)
   set(ICU_INCLUDE_DIRS)
+  MESSAGE(STATUS "ICU: No")
 endif(ICU_INCLUDE_DIR AND ICU_LIBRARY)

Modified: trunk/cmake/FindRegex.cmake
===================================================================
--- trunk/cmake/FindRegex.cmake	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/cmake/FindRegex.cmake	2010-12-07 02:36:02 UTC (rev 2592)
@@ -29,6 +29,9 @@
 
 IF(REGEX_INCLUDE_DIR)
 	SET(REGEX_FOUND 1)
+	MESSAGE(STATUS "System regex.h: Yes")
+ELSE(REGEX_INCLUDE_DIR)
+	MESSAGE(STATUS "System regex.h: No")
 ENDIF(REGEX_INCLUDE_DIR)
 
 MARK_AS_ADVANCED(

Modified: trunk/cmake/bindings.cmake
===================================================================
--- trunk/cmake/bindings.cmake	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/cmake/bindings.cmake	2010-12-07 02:36:02 UTC (rev 2592)
@@ -5,15 +5,16 @@
 # I will try to get them integrated into the system if I can.  If there are bindings that you need
 # other than the Python|Perl/Swig bindings, then you should probably speak up now.
 
+MESSAGE(STATUS "\n-- CONFIGURING SWIG BINDINGS")
 #####################################################################################################
 # SWIG
 # We need to find the SWIG executable in order to be able to do this, right?
 FIND_PACKAGE(SWIG)
 
 IF(NOT SWIG_FOUND)
-	MESSAGE(FATAL_ERROR "Swig not found.  Bindings will not be built.")
+	MESSAGE(FATAL_ERROR "Swig: no")
 ELSE(NOT SWIG_FOUND)
-	MESSAGE(STATUS "Swig found at ${SWIG_EXECUTABLE}")
+	MESSAGE(STATUS "Swig: yes")
 	
 	SET(SWORD_SWIG_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/bindings/swig")
 	SET(SWORD_SWIG_BINARY "${CMAKE_CURRENT_BINARY_DIR}/bindings/swig")
@@ -72,7 +73,7 @@
 			VERBATIM
 		)
 		
-		MESSAGE(STATUS "Configured for building Python bindings.")
+		MESSAGE(STATUS "Python: yes")
 	ENDIF(SWORD_BINDINGS MATCHES ".*Python.*")
 	
 	IF(SWORD_BINDINGS MATCHES ".*Perl.*")
@@ -127,9 +128,9 @@
 				VERBATIM
 			)
 			
-			MESSAGE(STATUS "Configured for building Perl bindings.")
+			MESSAGE(STATUS "Perl: yes")
 		ELSE(PERL_FOUND)
-			MESSAGE(FATAL_ERROR "Perl not found. Can't create perl bindings without Perl to bind")
+			MESSAGE(FATAL_ERROR "Perl: not found")
 		ENDIF(PERL_FOUND)
 	ENDIF(SWORD_BINDINGS MATCHES ".*Perl.*")
 ENDIF(NOT SWIG_FOUND)

Modified: trunk/cmake/install.cmake
===================================================================
--- trunk/cmake/install.cmake	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/cmake/install.cmake	2010-12-07 02:36:02 UTC (rev 2592)
@@ -1,6 +1,7 @@
 #####################################################################
 # First, install the library itself
 # 
+MESSAGE(STATUS "\n-- CONFIGURING INSTALLATION DESTINATIONS")
 IF(NOT CMAKE_INSTALL_PREFIX)
 	IF(APPLE)
 		SET(SWORD_INSTALL_DIR "/opt/local")
@@ -32,7 +33,7 @@
 		DESTINATION "${SWORD_INSTALL_DIR}/include/sword")
 ENDIF(SWORD_INTERNAL_REGEX)
 
-MESSAGE(STATUS "Installation destination: ${SWORD_INSTALL_DIR}")
+MESSAGE(STATUS "Destination: ${SWORD_INSTALL_DIR}")
 
 # Configuration files, of course
 SET(prefix 		${SWORD_INSTALL_DIR})

Modified: trunk/cmake/muxsources.cmake
===================================================================
--- trunk/cmake/muxsources.cmake	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/cmake/muxsources.cmake	2010-12-07 02:36:02 UTC (rev 2592)
@@ -10,73 +10,74 @@
 # a ZLIB at all, and allowing a user to disable it does not bring about use
 # of some internal fall-back but just leaves the ability to read ZLIB files
 # out of the library altogether
+MESSAGE(STATUS "\n-- CONFIGURING SOURCE LIST")
 IF(SWORD_NO_ZLIB STREQUAL "Yes")
-	MESSAGE(STATUS "ZLib support excluded")
+	MESSAGE(STATUS "ZLib: excluded by use option")
 	ADD_DEFINITIONS(-DEXCLUDEZLIB)
 	SET(WITH_ZLIB 0)
 ELSE(SWORD_NO_ZLIB STREQUAL "Yes")
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_zlib_used_SOURCES})
 	IF(NOT ZLIB_FOUND OR SWORD_USE_INTERNAL_ZLIB STREQUAL "Yes")
-		MESSAGE(STATUS "No system ZLib found or user forcing internal")
+		MESSAGE(STATUS "ZLib: internal")
 		SET(sword_SOURCES ${sword_SOURCES} ${sword_zlib_nofound_SOURCES})
 		SET(WITH_INTERNAL_ZLIB 1)
 	ELSE(NOT ZLIB_FOUND OR SWORD_USE_INTERNAL_ZLIB STREQUAL "Yes")
-		MESSAGE(STATUS "Using system ZLib: ${ZLIB_LIBRARY}")
+		MESSAGE(STATUS "ZLib: system ${ZLIB_LIBRARY}")
 		SET(WITH_ZLIB 1)
 	ENDIF(NOT ZLIB_FOUND OR SWORD_USE_INTERNAL_ZLIB STREQUAL "Yes")
 ENDIF(SWORD_NO_ZLIB STREQUAL "Yes")
 
 # Check for if we've found ICU
 IF(CURL_FOUND AND NOT SWORD_NO_CURL STREQUAL "Yes")
-	MESSAGE(STATUS "cURL found , using ${CURL_LIBRARY} and ${CURL_INCLUDE_DIRS}")
+	MESSAGE(STATUS "cURL: system ${CURL_LIBRARY} and ${CURL_INCLUDE_DIRS}")
 	ADD_DEFINITIONS(-DCURLAVAILABLE)
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_curl_found_SOURCES})
 	SET(WITH_CURL 1)
 ELSE(CURL_FOUND AND NOT SWORD_NO_CURL STREQUAL "Yes")
-	MESSAGE(STATUS "cURL not found or being ignored")
+	MESSAGE(STATUS "cURL: no")
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_curl_nofound_SOURCES})
 	SET(WITH_CURL 0)
 ENDIF(CURL_FOUND AND NOT SWORD_NO_CURL STREQUAL "Yes")
 
 # And for CLucene
 IF(CLucene_FOUND AND NOT SWORD_NO_CLUCENE STREQUAL "Yes")
-	MESSAGE(STATUS "CLucene found, using ${CLUCENE_LIBRARY} in ${CLUCENE_LIBRARY_DIR} and ${CLUCENE_INCLUDE_DIR}")
+	MESSAGE(STATUS "CLucene: yes ${CLUCENE_LIBRARY} in ${CLUCENE_LIBRARY_DIR} and ${CLUCENE_INCLUDE_DIR}")
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_clucene_found_SOURCES})
 	SET(WITH_CLUCENE 1)
 ELSE(CLucene_FOUND AND NOT SWORD_NO_CLUCENE STREQUAL "Yes")
-	MESSAGE(STATUS "CLucene not found or being ignored")
+	MESSAGE(STATUS "CLucene: no")
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_clucene_nofound_SOURCES})
 	SET(WITH_CLUCENE 0)
 ENDIF(CLucene_FOUND AND NOT SWORD_NO_CLUCENE STREQUAL "Yes")
 
 # Alert the user if PkgConfig is unavailalbe
 IF(NOT PKG_CONFIG_FOUND)
-	MESSAGE(STATUS "PkgConfig not found on the system.  Proceeding without it.")
+	MESSAGE(STATUS "PkgConfig: no")
 	SET(WITH_PKG_CONFIG 1)
 ELSE(NOT PKG_CONFIG_FOUND)
-	MESSAGE(STATUS "PkgConfig found. Using.")
+	MESSAGE(STATUS "PkgConfig: yes")
 	SET(WITH_PKG_CONFIG 0)
 ENDIF(NOT PKG_CONFIG_FOUND)
 
 # ICU needs some lovin' too
 IF(ICU_FOUND AND NOT SWORD_NO_ICU STREQUAL "No")
-	MESSAGE(STATUS "ICU Found, using ${ICU_LIBRARY} and ${ICU_INCLUDE_DIRS}")
+	MESSAGE(STATUS "ICU: yes ${ICU_LIBRARY} and ${ICU_INCLUDE_DIRS}")
 	ADD_DEFINITIONS(-D_ICU_)
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_icu_found_SOURCES})
 	SET(WITH_ICU 1)
 ELSE(ICU_FOUND AND NOT SWORD_NO_ICU STREQUAL "No")
-	MESSAGE(STATUS "ICU not found or ignored.")
+	MESSAGE(STATUS "ICU: no")
 	SET(WITH_ICU 0)
 ENDIF(ICU_FOUND AND NOT SWORD_NO_ICU STREQUAL "No")
 
 # Internal or external regex.h
 IF(REGEX_FOUND)
-	MESSAGE(STATUS "System Regex found: ${REGEX_INCLUDE_DIR}")
+	MESSAGE(STATUS "Regex.h: system ${REGEX_INCLUDE_DIR}")
 	INCLUDE_DIRECTORIES(${REGEX_INCLUDE_DIR})
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_external_regex_SOURCES})
 	SET(WITH_REGEX 1)
 ELSE(REGEX_FOUND)
-	MESSAGE(STATUS "Using internal regex")
+	MESSAGE(STATUS "Regex.h: internal")
 	INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/internal/regex)
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_internal_regex_SOURCES})
 	SET(WITH_REGEX 0)

Modified: trunk/examples/cmdline/CMakeLists.txt
===================================================================
--- trunk/examples/cmdline/CMakeLists.txt	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/examples/cmdline/CMakeLists.txt	2010-12-07 02:36:02 UTC (rev 2592)
@@ -3,6 +3,7 @@
 # SWORD_BUILD_EXAMPLES="Yes".  These will not be installed, so don't worry about
 # that.
 # 
+MESSAGE(STATUS "\n-- CONFIGURING LIBRARY EXAMPLES")
 SET(example_PROGRAMS
 	listoptions
 	lookup

Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt	2010-12-06 19:25:48 UTC (rev 2591)
+++ trunk/tests/CMakeLists.txt	2010-12-07 02:36:02 UTC (rev 2592)
@@ -12,6 +12,8 @@
 # more about how these tests work.
 # 
 
+MESSAGE(STATUS "\n-- CONFIGURING LIBRARY TESTS")
+
 SET(test_PROGRAMS
 	casttest
 	ciphertest




More information about the sword-cvs mailing list