From 62258ba3b4737432a95c3af8d0e03ed3fb7953e7 Mon Sep 17 00:00:00 2001
From: open-license-manager <rillf@maildrop.cc>
Date: 周一, 13 10月 2014 05:05:37 +0800
Subject: [PATCH] windows ok

---
 build/modules/add_boost.cmake |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/build/modules/add_boost.cmake b/build/modules/add_boost.cmake
index 7501ae8..d8dbd8e 100644
--- a/build/modules/add_boost.cmake
+++ b/build/modules/add_boost.cmake
@@ -151,13 +151,13 @@
 	  endif()
 	  execute_process(COMMAND ${b2Bootstrap} WORKING_DIRECTORY ${BOOST_ROOT}
 					  RESULT_VARIABLE Result OUTPUT_VARIABLE Output ERROR_VARIABLE Error)
-	  if(NOT Result EQUAL 0)
+	  find_program(b2Path NAMES b2 PATHS ${BOOST_ROOT} NO_DEFAULT_PATH)
+	  if(NOT Result EQUAL 0 OR NOT b2Path)
 		message(FATAL_ERROR "Failed running ${b2Bootstrap}:\n${Output}\n${Error}\n")
 	  endif()
 	endif()
 	execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BOOST_ROOT}/Build)
 
-	
 	#ADD_BOOST_STATIC_RUNTIME is a parsed function parameter
 	if(ADD_BOOST_STATIC_RUNTIME)
 		set(RUNTIME_LINK "static")
@@ -258,10 +258,13 @@
 	  else(MSVC)
 			set(OUTPUT_FILE ${BOOST_ROOT}/stage/lib/libboost_${libName}-mt${BOOST_LIB_SUFFIX}.${LINUX_LIB_EXTENSION})
 	  endif(MSVC)
-	  if(NOT EXISTS "${OUTPUT_FILE}")
-		  message(STATUS "Building ${Component}")
-		  execute_process(COMMAND ${b2Args} --with-${Component} WORKING_DIRECTORY ${BOOST_ROOT})
-	  endif()
+	  #if(NOT EXISTS "${OUTPUT_FILE}")
+		  message(STATUS "Building ${Component}: ${b2Args}")
+		  execute_process(COMMAND ${b2Args} --with-${Component} WORKING_DIRECTORY ${BOOST_ROOT} RESULT_VARIABLE Result OUTPUT_VARIABLE Output ERROR_VARIABLE Error)
+		  if(NOT Result EQUAL 0)
+			message(ERROR "Failed running ${b2Args} --with-${Component}:\n${Output}\n${Error}\n")
+		  endif()
+	  #endif()
 	endforeach()
 	
 	
@@ -272,7 +275,7 @@
 	#   BOOST_LIBRARYDIR       - Preferred library directory e.g. <prefix>/lib
 	#   Boost_NO_SYSTEM_PATHS  - Set to ON to disable searching in locations not
 	#                            specified by these hint variables. Default is OFF.
-	set (BOOST_LIBRARYDIR ${BoostSourceDir}/stage/lib CACHE PATH "BOOST library dir")
+	set (BOOST_LIBRARYDIR ${BOOST_ROOT}/stage/lib CACHE PATH "BOOST library dir")
 	#set (Boost_NO_SYSTEM_PATHS ON)
 	find_package(Boost 1.55 REQUIRED COMPONENTS ${ADD_BOOST_MODULES})
 	#clean up variables

--
Gitblit v1.9.1