[sword-svn] r3233 - in trunk: . cmake

greg.hellings at crosswire.org greg.hellings at crosswire.org
Wed May 14 19:18:16 MST 2014


Author: greg.hellings
Date: 2014-05-14 19:18:16 -0700 (Wed, 14 May 2014)
New Revision: 3233

Modified:
   trunk/CMakeLists.txt
   trunk/cmake/FindICU.cmake
   trunk/cmake/sources.cmake
Log:
Cleaned up ICU finding and other issues for compiling on Windows.

Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2014-05-14 23:50:50 UTC (rev 3232)
+++ trunk/CMakeLists.txt	2014-05-15 02:18:16 UTC (rev 3233)
@@ -38,6 +38,7 @@
 INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/include") # For everything else
 IF(MSVC)
 	INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/src/utilfuns/win32/")
+	ADD_DEFINITIONS(-DWIN32 -D_ICUSWORD_ -D_LIB -DREGEX_MALLOC -DSWMAKINGDLL -D_CRT_SECURE_NO_WARNINGS -DCURL_STATICLIB -DUSBINARY -D_CRT_SECURE_NO_DEPRECATE)
 ENDIF(MSVC)
 
 ###########################################################################################
@@ -46,12 +47,19 @@
 #
 MESSAGE(STATUS "\n-- SEARCHING FOR SYTEM PACKAGES")
 # Find our packages
+IF(MSVC)
+	FIND_PACKAGE(BZIP2 REQUIRED)
+	FIND_PACKAGE(XZ REQUIRED)
+	FIND_PACKAGE(ICU REQUIRED)
+	FIND_PACKAGE(CURL REQUIRED)
+ELSE(MSVC)
+	FIND_PACKAGE(BZIP2 QUIET)
+	FIND_PACKAGE(XZ QUIET)
+	FIND_PACKAGE(ICU QUIET)
+	FIND_PACKAGE(CURL QUIET)
+ENDIF(MSVC)
+FIND_PACKAGE(CLucene QUIET)
 FIND_PACKAGE(ZLIB QUIET)
-FIND_PACKAGE(BZIP2 QUIET)
-FIND_PACKAGE(XZ QUIET)
-FIND_PACKAGE(ICU QUIET)
-FIND_PACKAGE(CURL QUIET)
-FIND_PACKAGE(CLucene QUIET)
 FIND_PACKAGE(PkgConfig QUIET)
 FIND_PACKAGE(Regex QUIET)
 
@@ -155,13 +163,21 @@
 	TARGET_LINK_LIBRARIES(libsword fnccheck)
 ENDIF(SWORD_ENABLE_PROFILEFN STREQUAL "Yes")
 
-SET(CMAKE_C_FLAGS_DEBUG            "-g3 -Wall -O0 ${CMAKE_C_FLAGS}")
-SET(CMAKE_C_FLAGS_RELEASE          "-O3 ${CMAKE_C_FLAGS}")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O3 -g ${CMAKE_C_FLAGS}")
-SET(CMAKE_CXX_FLAGS_DEBUG          "-g3 -Wall -O0 ${CMAKE_CXX_FLAGS}")
-SET(CMAKE_CXX_FLAGS_RELEASE        "-O3 ${CMAKE_CXX_FLAGS}")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g ${CMAKE_CXX_FLAGS}")
-
+IF(MSVC)
+	SET(CMAKE_C_FLAGS_DEBUG            "/D -Wall /O0 /DDEBUG ${CMAKE_C_FLAGS}")
+	SET(CMAKE_C_FLAGS_RELEASE          "/O3 /DNDEBUG ${CMAKE_C_FLAGS}")
+	SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "/O3 /D /DDEBUG ${CMAKE_C_FLAGS}")
+	SET(CMAKE_CXX_FLAGS_DEBUG          "/D -Wall /O0 /DDEBUG ${CMAKE_CXX_FLAGS}")
+	SET(CMAKE_CXX_FLAGS_RELEASE        "/O3 ${CMAKE_CXX_FLAGS}")
+	SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O3 /D /DDEBUG ${CMAKE_CXX_FLAGS}")
+ELSE(MSVC)
+	SET(CMAKE_C_FLAGS_DEBUG            "-g3 -Wall -O0 ${CMAKE_C_FLAGS}")
+	SET(CMAKE_C_FLAGS_RELEASE          "-O3 ${CMAKE_C_FLAGS}")
+	SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O3 -g ${CMAKE_C_FLAGS}")
+	SET(CMAKE_CXX_FLAGS_DEBUG          "-g3 -Wall -O0 ${CMAKE_CXX_FLAGS}")
+	SET(CMAKE_CXX_FLAGS_RELEASE        "-O3 ${CMAKE_CXX_FLAGS}")
+	SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g ${CMAKE_CXX_FLAGS}")
+ENDIF(MSVC)
 ##############################################################################################
 # Setting libraries and includes
 #

Modified: trunk/cmake/FindICU.cmake
===================================================================
--- trunk/cmake/FindICU.cmake	2014-05-14 23:50:50 UTC (rev 3232)
+++ trunk/cmake/FindICU.cmake	2014-05-15 02:18:16 UTC (rev 3233)
@@ -34,7 +34,14 @@
     ICU_I18N_LIBRARY
     NAMES icuin icui18n cygicuin cygicuin32
     DOC "Libraries to link against for ICU internationalization")
+  if(MSVC)
+    find_library(ICU_DATA_LIBRARY
+	  NAMES icudt
+	  DOC "Libraries to link against for ICU data")
+	set(ICU_LIBRARIES ${ICU_LIBRARIES} ${ICU_DATA_LIBRARY})
+  endif(MSVC)
   mark_as_advanced(ICU_I18N_LIBRARY)
+  mark_as_advanced(ICU_DATA_LIBRARY)
   if (ICU_I18N_LIBRARY)
     set(ICU_I18N_FOUND 1)
     set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY})
@@ -49,3 +56,13 @@
   set(ICU_I18N_LIBRARIES)
   set(ICU_INCLUDE_DIRS)
 endif(ICU_INCLUDE_DIR AND ICU_LIBRARY)
+
+IF(ICU_FOUND)
+	IF(NOT ICU_FIND_QUIETLY)
+		MESSAGE(STATUS "ICU: Yes ${ICU_I18N_LIBRARY}")
+	ENDIF(NOT ICU_FIND_QUIETLY)
+ELSE(ICU_FOUND)
+	IF(ICU_FIND_REQUIRED)
+		MESSAGE(FATAL_ERROR "ICU: No")
+	ENDIF(ICU_FIND_REQUIRED)
+ENDIF(ICU_FOUND)

Modified: trunk/cmake/sources.cmake
===================================================================
--- trunk/cmake/sources.cmake	2014-05-14 23:50:50 UTC (rev 3232)
+++ trunk/cmake/sources.cmake	2014-05-15 02:18:16 UTC (rev 3233)
@@ -176,6 +176,11 @@
 )
 SOURCE_GROUP("src\\utilfns" FILES ${sword_base_utilfns_SOURCES})
 
+SET(sword_base_msvc_SOURCES
+	src/utilfuns/win32/dirent.cpp
+)
+SOURCE_GROUP("src\\utilfns\\win32" FILES ${sword_base_msvc_SOURCES})
+
 SET(sword_base_binding_SOURCES
 	bindings/flatapi.cpp
 )
@@ -187,9 +192,20 @@
 	${sword_base_mgr_SOURCES}
 	${sword_base_module_SOURCES}
 	${sword_base_utilfns_SOURCES}
-	${sword_base_binding_SOURCES}
 )
 
+IF(NOT MSVC)
+	SET(sword_base_SOURCES
+		${sword_base_SOURCES}
+		${sword_base_binding_SOURCES}
+	)
+ELSE(NOT MSVC)
+	SET(sword_base_SOURCES
+		${sword_base_SOURCES}
+		${sword_base_msvc_SOURCES}
+	)
+ENDIF(NOT MSVC)
+
 # Sources relying on ZLib
 SET(sword_zlib_used_SOURCES
 	src/modules/common/zipcomprs.cpp




More information about the sword-cvs mailing list