I am trying to add boost bjam build as an external cmake project.
This is my cmake code to build boost
include(ExternalProject)
ExternalProject_Add(
libboost
PREFIX ${BOOST_BUILD_DIRECTORY}
SOURCE_DIR ${BOOST_SOURCE_DIRECTORY}
BINARY_DIR ${BOOST_SOURCE_DIRECTORY}
CONFIGURE_COMMAND ""
BUILD_COMMAND ${b2Path}
--build-dir=${BOOST_BUILD_DIRECTORY}
--link=static
--variant=debug
--build-type=complete
INSTALL_COMMAND ${b2Path}
--prefix=${BOOST_BUILD_DIRECTORY}/${BoostFolderName}
--link=static
--variant=debug
--build-type=complete
INSTALL_DIR ${BOOST_BUILD_DIRECTORY}/${BoostFolderName}
LOG_BUILD ON
LOG_INSTALL ON
)
message("boostbuild done")
The problem here is, once in a while it fails. the same step for bjam doesn't fail if invoked through command line.
The error is
type "C:\Users\adhal\AppData\Local\Temp\jam6818c95b4.000" > "C:\build-sdk-Desktop_Qt_5_11_3_MSVC2017_64bit-Debug\external\boost\boost\bin.v2\libs\program_options\build\msvc-14.1\debug\address-model-64\link-static\runtime-link-static\threading-multi\libboost_program_options-variant-vc141-mt-sgd-x64-1_73-static.cmake"
...failed text-action C:\build-sdk-Desktop_Qt_5_11_3_MSVC2017_64bit-Debug\external\boost\boost\bin.v2\libs\program_options\build\msvc-14.1\debug\address-model-64\link-static\runtime-link-static\threading-multi\libboost_program_options-variant-vc141-mt-sgd-x64-1_73-static.cmake...
...skipped <pC:\proj\sdk\external\boost-program-options\stage\lib\cmake\boost_program_options-1.73.0>libboost_program_options-variant-vc141-mt-sgd-x64-1_73-static.cmake for lack of <pC:\build-sdk-Desktop_Qt_5_11_3_MSVC2017_64bit-Debug\external\boost\boost\bin.v2\libs\program_options\build\msvc-14.1\debug\address-model-64\link-static\runtime-link-static\threading-multi>libboost_program_options-variant-vc141-mt-sgd-x64-1_73-static.cmake...
compile-c-c++ C:\build-sdk-Desktop_Qt_5_11_3_MSVC2017_64bit-Debug\external\boost\boost\bin.v2\libs\regex\build\msvc-14.1\debug\address-model-64\link-static\runtime-link-static\threading-multi\regex.obj
When I run the exact same step, it doesn't fild the file(C:\Users\adhal\AppData\Local\Temp\jam6818c95b4.000). Since it's a temporary file, it's deleted.
Can someone tell me, if I am doing anything wrong ? Is it possible to specify a separate temporary directory for bjam ?