Support parallel 64- and 32-bit boost binaries (RIPD-1317):

* CMake and scons
* Update Visual Studio build docs
* Cache Appveyor PIP downloads for scons builds
* Rename the CMakeFuncs `find_` functions to `use_`
This commit is contained in:
Edward Hennis
2016-11-04 19:55:13 -04:00
committed by Nik Bougalis
parent b6ce0aa75a
commit fd901f8081
8 changed files with 96 additions and 52 deletions

View File

@@ -235,8 +235,8 @@ macro(check_gcc4_abi)
if (is_gcc AND NOT gcc4_abi)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5)
execute_process(COMMAND lsb_release -si OUTPUT_VARIABLE lsb)
string(STRIP ${lsb} lsb)
if (${lsb} STREQUAL "Ubuntu")
string(STRIP "${lsb}" lsb)
if ("${lsb}" STREQUAL "Ubuntu")
execute_process(COMMAND lsb_release -sr OUTPUT_VARIABLE lsb)
string(STRIP ${lsb} lsb)
if (${lsb} VERSION_LESS 15.1)
@@ -268,8 +268,21 @@ endmacro()
############################################################
# Params: Boost components to search for.
macro(find_boost)
if (NOT WIN32)
macro(use_boost)
if(WIN32 OR CYGWIN)
# Workaround for MSVC having two boost versions - x86 and x64 on same PC in stage folders
if ((NOT DEFINED BOOST_ROOT) AND (DEFINED ENV{BOOST_ROOT}))
set(BOOST_ROOT $ENV{BOOST_ROOT})
endif()
if(DEFINED BOOST_ROOT)
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND IS_DIRECTORY ${BOOST_ROOT}/stage64/lib)
set(Boost_LIBRARY_DIR ${BOOST_ROOT}/stage64/lib)
else()
set(Boost_LIBRARY_DIR ${BOOST_ROOT}/stage/lib)
endif()
endif()
endif()
if (is_clang AND DEFINED ENV{CLANG_BOOST_ROOT})
set(BOOST_ROOT $ENV{CLANG_BOOST_ROOT})
endif()
@@ -280,22 +293,19 @@ macro(find_boost)
find_package(Boost COMPONENTS
${ARGN})
if (Boost_FOUND)
if (Boost_FOUND OR
((CYGWIN OR WIN32) AND Boost_INCLUDE_DIRS AND Boost_LIBRARY_DIRS))
if(NOT Boost_FOUND)
message(WARNING "Boost directory found, but not all components. May not be able to build.")
endif()
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
else()
message(FATAL_ERROR "Boost not found")
endif()
else(DEFINED ENV{BOOST_ROOT})
include_directories(SYSTEM $ENV{BOOST_ROOT})
if(IS_DIRECTORY $ENV{BOOST_ROOT}/stage64/lib)
link_directories($ENV{BOOST_ROOT}/stage64/lib)
else()
link_directories($ENV{BOOST_ROOT}/stage/lib)
endif()
endif()
endmacro()
macro(find_pthread)
macro(use_pthread)
if (NOT WIN32)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
@@ -303,7 +313,7 @@ macro(find_pthread)
endif()
endmacro()
macro(find_openssl openssl_min)
macro(use_openssl openssl_min)
if (APPLE AND NOT DEFINED ENV{OPENSSL_ROOT_DIR})
find_program(HOMEBREW brew)
if (NOT HOMEBREW STREQUAL "HOMEBREW-NOTFOUND")
@@ -342,7 +352,7 @@ macro(find_openssl openssl_min)
endif()
endmacro()
macro(find_protobuf)
macro(use_protobuf)
if (WIN32)
if (DEFINED ENV{PROTOBUF_ROOT})
include_directories($ENV{PROTOBUF_ROOT}/src)
@@ -622,7 +632,7 @@ macro(set_startup_project cur_project)
endmacro()
macro(link_common_libraries cur_project)
if (NOT WIN32)
if (NOT MSVC)
target_link_libraries(${cur_project} ${Boost_LIBRARIES})
target_link_libraries(${cur_project} dl)
target_link_libraries(${cur_project} Threads::Threads)
@@ -634,7 +644,7 @@ macro(link_common_libraries cur_project)
else()
target_link_libraries(${cur_project} rt)
endif()
else(NOT WIN32)
else(NOT MSVC)
target_link_libraries(${cur_project}
$<$<OR:$<CONFIG:Debug>,$<CONFIG:DebugClassic>>:VC/static/ssleay32MTd>
$<$<OR:$<CONFIG:Debug>,$<CONFIG:DebugClassic>>:VC/static/libeay32MTd>)
@@ -644,5 +654,5 @@ macro(link_common_libraries cur_project)
target_link_libraries(${cur_project}
legacy_stdio_definitions.lib Shlwapi kernel32 user32 gdi32 winspool comdlg32
advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32)
endif (NOT WIN32)
endif (NOT MSVC)
endmacro()