vcpkg/ports/boost/portfile.cmake

93 lines
3.4 KiB
CMake
Raw Normal View History

2016-09-19 11:50:08 +08:00
include(vcpkg_common_functions)
vcpkg_download_distfile(ARCHIVE_FILE
2016-09-20 08:40:40 +08:00
URL "http://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2"
FILENAME "boost_1_61_0.tar.bz2"
MD5 6095876341956f65f9d35939ccea1a9f
2016-09-19 11:50:08 +08:00
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
2016-09-20 08:40:40 +08:00
if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0/b2.exe)
2016-09-19 11:50:08 +08:00
message(STATUS "Bootstrapping")
vcpkg_execute_required_process(
2016-09-20 08:40:40 +08:00
COMMAND "${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0/bootstrap.bat"
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0
2016-09-19 11:50:08 +08:00
LOGNAME bootstrap
)
endif()
message(STATUS "Bootstrapping done")
set(B2_OPTIONS
--toolset=msvc
-j$ENV{NUMBER_OF_PROCESSORS}
-q
--without-python
threading=multi
link=shared
runtime-link=shared
--debug-configuration
)
if(TRIPLET_SYSTEM_ARCH MATCHES "x64")
list(APPEND B2_OPTIONS address-model=64)
endif()
if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore")
list(APPEND B2_OPTIONS windows-api=store)
set(ENV{BOOST_BUILD_PATH} ${CMAKE_CURRENT_LIST_DIR})
endif()
message(STATUS "Building ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
2016-09-20 08:40:40 +08:00
COMMAND "${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0/b2.exe"
2016-09-19 11:50:08 +08:00
--stagedir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage
--build-dir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
${B2_OPTIONS}
variant=release
2016-09-20 08:40:40 +08:00
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0
2016-09-19 11:50:08 +08:00
LOGNAME build-${TARGET_TRIPLET}-rel
)
message(STATUS "Building ${TARGET_TRIPLET}-rel done")
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
2016-09-20 08:40:40 +08:00
COMMAND "${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0/b2.exe"
2016-09-19 11:50:08 +08:00
--stagedir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage
--build-dir=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
${B2_OPTIONS}
variant=debug
2016-09-20 08:40:40 +08:00
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0
2016-09-19 11:50:08 +08:00
LOGNAME build-${TARGET_TRIPLET}-dbg
)
message(STATUS "Building ${TARGET_TRIPLET}-dbg done")
message(STATUS "Packaging headers")
file(
2016-09-20 08:40:40 +08:00
COPY ${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0/boost
2016-09-19 11:50:08 +08:00
DESTINATION ${CURRENT_PACKAGES_DIR}/include
PATTERN "config/user.hpp" EXCLUDE
)
2016-09-20 08:40:40 +08:00
file(COPY ${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0/boost/config/user.hpp
2016-09-19 11:50:08 +08:00
DESTINATION ${CURRENT_PACKAGES_DIR}/include/boost/config/
)
file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp
"\n#define BOOST_ALL_DYN_LINK\n"
)
2016-09-20 08:40:40 +08:00
file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/boost_1_61_0/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright)
2016-09-19 11:50:08 +08:00
message(STATUS "Packaging headers done")
message(STATUS "Packaging ${TARGET_TRIPLET}-rel")
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
FILES_MATCHING PATTERN "*.lib")
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/stage/lib/
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
FILES_MATCHING PATTERN "*.dll")
message(STATUS "Packaging ${TARGET_TRIPLET}-rel done")
message(STATUS "Packaging ${TARGET_TRIPLET}-dbg")
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
FILES_MATCHING PATTERN "*.lib")
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/stage/lib/
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
FILES_MATCHING PATTERN "*.dll")
message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done")
vcpkg_copy_pdbs()