Building Boost as an ExternalProject

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Building Boost as an ExternalProject

Michael Powell
Hello,

This question has been raised from time to time I think. I am trying
to build Boost as an ExternalProject, but I am ending up with an
error: 'cmd.exe' returned with exit code 1. Along these lines.

Perhaps I have involved one too many variables, but I doubt it. Ignore
the cross-plat stuff, this is building on Windows for the purposes of
this conversation.

I tried to configure ExternalProject_Add with as much verbosity as
possible, but unfortunately the process is not especially talkative as
it turns out. But for the EC 1.

set (BOOST_VERSION  1.65.1)

message (STATUS "Adding Boost ${BOOST_VERSION} as an external project.")

set (BOOST_BOOTSTRAP_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
set (BOOST_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
set (BOOST_BUILD_PREFIX ${BOOST_BOOTSTRAP_PREFIX}/boost)
set (BOOST_GIT_REPO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost)

if (WIN32)
    set (BOOST_BOOTSTRAP_CMD ${BOOST_GIT_REPO_DIR}/bootstrap.bat)
    # It was bjam at one point; it is now b2
    set (BOOST_BUILD_CMD ${BOOST_GIT_REPO_DIR}/b2.exe)
elseif (UNIX)
    set (BOOST_BOOTSTRAP_CMD ./${BOOST_GIT_REPO_DIR}/bootstrap.sh)
    set (BOOST_BUILD_CMD ./${BOOST_GIT_REPO_DIR}/b2)
endif ()

#  TODO: TBD: For now, assuming only 64-bit address models.
set (BOOST_ADDR_MODEL 64)

# TODO: TBD: align with the toolchain that we want to build through
the CMake here... For now assuming:
if (MSVC_VERSION EQUAL 1900)
    set (BOOST_TOOLSET msvc-14.0)
endif ()

ExternalProject_Add (boost
    # PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
    GIT_REPOSITORY [hidden email]:boostorg/boost.git
    GIT_TAG boost-${BOOST_VERSION}
    GIT_PROGRESS ON
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${BOOST_INSTALL_PREFIX}
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
    CONFIGURE_COMMAND ${BOOST_BOOTSTRAP_CMD} --prefix=${BOOST_BOOTSTRAP_PREFIX}
    # I do not necessarily care about any other Boost build options;
but that could change the further I get into unit testing, at least so
long as I will be adopting the test library for usage.
    BUILD_COMMAND ${BOOST_BUILD_CMD} --with-test
toolset=${BOOST_TOOLSET} variant=debug link=static stage
--prefix=${BOOST_BUILD_PREFIX}
    LOG_DOWNLOAD ON
    LOG_UPDATE ON
    LOG_CONFIGURE ON
    LOG_BUILD ON
    LOG_INSTALL ON
)

Cheers,

Michael Powell
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost as an ExternalProject

Michael Powell
On Mon, Oct 2, 2017 at 2:34 PM, Michael Powell <[hidden email]> wrote:
> Hello,
>
> This question has been raised from time to time I think. I am trying
> to build Boost as an ExternalProject, but I am ending up with an
> error: 'cmd.exe' returned with exit code 1. Along these lines.

From the Boost VC project file:

      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
C:\Dev\CMake\bin\cmake.exe -E make_directory
G:/Source/Spikes/nanomsg/cppnngswig-working/repos/boost
if %errorlevel% neq 0 goto :cmEnd
C:\Dev\CMake\bin\cmake.exe -E make_directory
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-build
if %errorlevel% neq 0 goto :cmEnd
C:\Dev\CMake\bin\cmake.exe -E make_directory
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix
if %errorlevel% neq 0 goto :cmEnd
C:\Dev\CMake\bin\cmake.exe -E make_directory
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/tmp
if %errorlevel% neq 0 goto :cmEnd
** C:\Dev\CMake\bin\cmake.exe -E make_directory
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/$(Configuration)
** if %errorlevel% neq 0 goto :cmEnd
C:\Dev\CMake\bin\cmake.exe -E make_directory
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src
if %errorlevel% neq 0 goto :cmEnd
C:\Dev\CMake\bin\cmake.exe -E touch
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/$(Configuration)/boost-mkdir
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
** endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>

** which line number was the error

Honestly, that does not make much sense since the directories do in fact exist.

The boost-configure-err.log shows this result:

The system cannot find the path specified.
'.\build.bat' is not recognized as an internal or external command,
operable program or batch file.

Which leads me to believe that possibly I need to tell the target to
operate in a more appropriate working directory?

> Perhaps I have involved one too many variables, but I doubt it. Ignore
> the cross-plat stuff, this is building on Windows for the purposes of
> this conversation.
>
> I tried to configure ExternalProject_Add with as much verbosity as
> possible, but unfortunately the process is not especially talkative as
> it turns out. But for the EC 1.
>
> set (BOOST_VERSION  1.65.1)
>
> message (STATUS "Adding Boost ${BOOST_VERSION} as an external project.")
>
> set (BOOST_BOOTSTRAP_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
> set (BOOST_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
> set (BOOST_BUILD_PREFIX ${BOOST_BOOTSTRAP_PREFIX}/boost)
> set (BOOST_GIT_REPO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost)
>
> if (WIN32)
>     set (BOOST_BOOTSTRAP_CMD ${BOOST_GIT_REPO_DIR}/bootstrap.bat)
>     # It was bjam at one point; it is now b2
>     set (BOOST_BUILD_CMD ${BOOST_GIT_REPO_DIR}/b2.exe)
> elseif (UNIX)
>     set (BOOST_BOOTSTRAP_CMD ./${BOOST_GIT_REPO_DIR}/bootstrap.sh)
>     set (BOOST_BUILD_CMD ./${BOOST_GIT_REPO_DIR}/b2)
> endif ()
>
> #  TODO: TBD: For now, assuming only 64-bit address models.
> set (BOOST_ADDR_MODEL 64)
>
> # TODO: TBD: align with the toolchain that we want to build through
> the CMake here... For now assuming:
> if (MSVC_VERSION EQUAL 1900)
>     set (BOOST_TOOLSET msvc-14.0)
> endif ()
>
> ExternalProject_Add (boost
>     # PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>     GIT_REPOSITORY [hidden email]:boostorg/boost.git
>     GIT_TAG boost-${BOOST_VERSION}
>     GIT_PROGRESS ON
>     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${BOOST_INSTALL_PREFIX}
>     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>     CONFIGURE_COMMAND ${BOOST_BOOTSTRAP_CMD} --prefix=${BOOST_BOOTSTRAP_PREFIX}
>     # I do not necessarily care about any other Boost build options;
> but that could change the further I get into unit testing, at least so
> long as I will be adopting the test library for usage.
>     BUILD_COMMAND ${BOOST_BUILD_CMD} --with-test
> toolset=${BOOST_TOOLSET} variant=debug link=static stage
> --prefix=${BOOST_BUILD_PREFIX}
>     LOG_DOWNLOAD ON
>     LOG_UPDATE ON
>     LOG_CONFIGURE ON
>     LOG_BUILD ON
>     LOG_INSTALL ON
> )
>
> Cheers,
>
> Michael Powell
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost as an ExternalProject

Michael Powell
On Mon, Oct 2, 2017 at 3:06 PM, Michael Powell <[hidden email]> wrote:
> On Mon, Oct 2, 2017 at 2:34 PM, Michael Powell <[hidden email]> wrote:
>> Hello,
>>
>> This question has been raised from time to time I think. I am trying
>> to build Boost as an ExternalProject, but I am ending up with an
>> error: 'cmd.exe' returned with exit code 1. Along these lines.

This is the line from the Microsoft.CppCommon.targets that was failing.

    <CustomBuild
      Sources                     ="@(CustomBuild)"
      BuildSuffix                 ="$(_BuildSuffix)"

      TrackerLogDirectory         ="%(CustomBuild.TrackerLogDirectory)"
      MinimalRebuildFromTracking  ="%(CustomBuild.MinimalRebuildFromTracking)"

      TLogReadFiles               ="@(CustomBuildTLogReadFiles)"
      TLogWriteFiles              ="@(CustomBuildTLogWriteFiles)"
      TrackFileAccess             ="$(TrackFileAccess)"
      ToolArchitecture            ="$(CustomBuildToolArchitecture)"
      TrackerFrameworkPath        ="$(CustomBuildTrackerFrameworkPath)"
      TrackerSdkPath              ="$(CustomBuildTrackerSdkPath)"

      AcceptableNonZeroExitCodes  ="%(CustomBuild.AcceptableNonZeroExitCodes)"
      >

And the output message is this:

2>  CMake Error at
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/boost-configure-Debug.cmake:16
(message):
2>    Command failed: The system cannot find the file specified
2>
2>     'bootstrap.bat'
'--prefix=G:/Source/Spikes/nanomsg/cppnngswig-working/boostbuild'
2>
2>    See also
2>
2>      G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/boost-configure-*.log

However, I've set the Working Directory to the bootstrap.bat location,
so I do not know how that could be missed.

> From the Boost VC project file:
>
>       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/repos/boost
> if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-build
> if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix
> if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/tmp
> if %errorlevel% neq 0 goto :cmEnd
> ** C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/$(Configuration)
> ** if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src
> if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E touch
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/$(Configuration)/boost-mkdir
> if %errorlevel% neq 0 goto :cmEnd
> :cmEnd
> ** endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
> :cmErrorLevel
> exit /b %1
> :cmDone
> if %errorlevel% neq 0 goto :VCEnd</Command>
>
> ** which line number was the error
>
> Honestly, that does not make much sense since the directories do in fact exist.
>
> The boost-configure-err.log shows this result:
>
> The system cannot find the path specified.
> '.\build.bat' is not recognized as an internal or external command,
> operable program or batch file.
>
> Which leads me to believe that possibly I need to tell the target to
> operate in a more appropriate working directory?
>
>> Perhaps I have involved one too many variables, but I doubt it. Ignore
>> the cross-plat stuff, this is building on Windows for the purposes of
>> this conversation.
>>
>> I tried to configure ExternalProject_Add with as much verbosity as
>> possible, but unfortunately the process is not especially talkative as
>> it turns out. But for the EC 1.
>>
>> set (BOOST_VERSION  1.65.1)
>>
>> message (STATUS "Adding Boost ${BOOST_VERSION} as an external project.")
>>
>> set (BOOST_BOOTSTRAP_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
>> set (BOOST_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
>> set (BOOST_BUILD_PREFIX ${BOOST_BOOTSTRAP_PREFIX}/boost)
>> set (BOOST_GIT_REPO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost)
>>
>> if (WIN32)
>>     set (BOOST_BOOTSTRAP_CMD ${BOOST_GIT_REPO_DIR}/bootstrap.bat)
>>     # It was bjam at one point; it is now b2
>>     set (BOOST_BUILD_CMD ${BOOST_GIT_REPO_DIR}/b2.exe)
>> elseif (UNIX)
>>     set (BOOST_BOOTSTRAP_CMD ./${BOOST_GIT_REPO_DIR}/bootstrap.sh)
>>     set (BOOST_BUILD_CMD ./${BOOST_GIT_REPO_DIR}/b2)
>> endif ()
>>
>> #  TODO: TBD: For now, assuming only 64-bit address models.
>> set (BOOST_ADDR_MODEL 64)
>>
>> # TODO: TBD: align with the toolchain that we want to build through
>> the CMake here... For now assuming:
>> if (MSVC_VERSION EQUAL 1900)
>>     set (BOOST_TOOLSET msvc-14.0)
>> endif ()
>>
>> ExternalProject_Add (boost
>>     # PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>>     GIT_REPOSITORY [hidden email]:boostorg/boost.git
>>     GIT_TAG boost-${BOOST_VERSION}
>>     GIT_PROGRESS ON
>>     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${BOOST_INSTALL_PREFIX}
>>     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>>     CONFIGURE_COMMAND ${BOOST_BOOTSTRAP_CMD} --prefix=${BOOST_BOOTSTRAP_PREFIX}
>>     # I do not necessarily care about any other Boost build options;
>> but that could change the further I get into unit testing, at least so
>> long as I will be adopting the test library for usage.
>>     BUILD_COMMAND ${BOOST_BUILD_CMD} --with-test
>> toolset=${BOOST_TOOLSET} variant=debug link=static stage
>> --prefix=${BOOST_BUILD_PREFIX}
>>     LOG_DOWNLOAD ON
>>     LOG_UPDATE ON
>>     LOG_CONFIGURE ON
>>     LOG_BUILD ON
>>     LOG_INSTALL ON
>> )
>>
>> Cheers,
>>
>> Michael Powell
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost as an ExternalProject

Jacob Barrett
The Apache Geode Native project is building Boost as an external project. You may want to look at our setup for inspiration. It builds correction on Windows with VS, Solaris x86 and SPARC with Solaris Studio, Linux with GCC and OS X with Xcode.Right now we are purely header only so if you need some libs you will have to tweak a little.


In our project the depends on boost we just add have:
target_link_libraries(... boost)

-Jake



On Mon, Oct 2, 2017 at 12:38 PM Michael Powell <[hidden email]> wrote:
On Mon, Oct 2, 2017 at 3:06 PM, Michael Powell <[hidden email]> wrote:
> On Mon, Oct 2, 2017 at 2:34 PM, Michael Powell <[hidden email]> wrote:
>> Hello,
>>
>> This question has been raised from time to time I think. I am trying
>> to build Boost as an ExternalProject, but I am ending up with an
>> error: 'cmd.exe' returned with exit code 1. Along these lines.

This is the line from the Microsoft.CppCommon.targets that was failing.

    <CustomBuild
      Sources                     ="@(CustomBuild)"
      BuildSuffix                 ="$(_BuildSuffix)"

      TrackerLogDirectory         ="%(CustomBuild.TrackerLogDirectory)"
      MinimalRebuildFromTracking  ="%(CustomBuild.MinimalRebuildFromTracking)"

      TLogReadFiles               ="@(CustomBuildTLogReadFiles)"
      TLogWriteFiles              ="@(CustomBuildTLogWriteFiles)"
      TrackFileAccess             ="$(TrackFileAccess)"
      ToolArchitecture            ="$(CustomBuildToolArchitecture)"
      TrackerFrameworkPath        ="$(CustomBuildTrackerFrameworkPath)"
      TrackerSdkPath              ="$(CustomBuildTrackerSdkPath)"

      AcceptableNonZeroExitCodes  ="%(CustomBuild.AcceptableNonZeroExitCodes)"
      >

And the output message is this:

2>  CMake Error at
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/boost-configure-Debug.cmake:16
(message):
2>    Command failed: The system cannot find the file specified
2>
2>     'bootstrap.bat'
'--prefix=G:/Source/Spikes/nanomsg/cppnngswig-working/boostbuild'
2>
2>    See also
2>
2>      G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/boost-configure-*.log

However, I've set the Working Directory to the bootstrap.bat location,
so I do not know how that could be missed.

> From the Boost VC project file:
>
>       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/repos/boost
> if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-build
> if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix
> if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/tmp
> if %errorlevel% neq 0 goto :cmEnd
> ** C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/$(Configuration)
> ** if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E make_directory
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src
> if %errorlevel% neq 0 goto :cmEnd
> C:\Dev\CMake\bin\cmake.exe -E touch
> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/$(Configuration)/boost-mkdir
> if %errorlevel% neq 0 goto :cmEnd
> :cmEnd
> ** endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
> :cmErrorLevel
> exit /b %1
> :cmDone
> if %errorlevel% neq 0 goto :VCEnd</Command>
>
> ** which line number was the error
>
> Honestly, that does not make much sense since the directories do in fact exist.
>
> The boost-configure-err.log shows this result:
>
> The system cannot find the path specified.
> '.\build.bat' is not recognized as an internal or external command,
> operable program or batch file.
>
> Which leads me to believe that possibly I need to tell the target to
> operate in a more appropriate working directory?
>
>> Perhaps I have involved one too many variables, but I doubt it. Ignore
>> the cross-plat stuff, this is building on Windows for the purposes of
>> this conversation.
>>
>> I tried to configure ExternalProject_Add with as much verbosity as
>> possible, but unfortunately the process is not especially talkative as
>> it turns out. But for the EC 1.
>>
>> set (BOOST_VERSION  1.65.1)
>>
>> message (STATUS "Adding Boost ${BOOST_VERSION} as an external project.")
>>
>> set (BOOST_BOOTSTRAP_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
>> set (BOOST_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
>> set (BOOST_BUILD_PREFIX ${BOOST_BOOTSTRAP_PREFIX}/boost)
>> set (BOOST_GIT_REPO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost)
>>
>> if (WIN32)
>>     set (BOOST_BOOTSTRAP_CMD ${BOOST_GIT_REPO_DIR}/bootstrap.bat)
>>     # It was bjam at one point; it is now b2
>>     set (BOOST_BUILD_CMD ${BOOST_GIT_REPO_DIR}/b2.exe)
>> elseif (UNIX)
>>     set (BOOST_BOOTSTRAP_CMD ./${BOOST_GIT_REPO_DIR}/bootstrap.sh)
>>     set (BOOST_BUILD_CMD ./${BOOST_GIT_REPO_DIR}/b2)
>> endif ()
>>
>> #  TODO: TBD: For now, assuming only 64-bit address models.
>> set (BOOST_ADDR_MODEL 64)
>>
>> # TODO: TBD: align with the toolchain that we want to build through
>> the CMake here... For now assuming:
>> if (MSVC_VERSION EQUAL 1900)
>>     set (BOOST_TOOLSET msvc-14.0)
>> endif ()
>>
>> ExternalProject_Add (boost
>>     # PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>>     GIT_REPOSITORY [hidden email]:boostorg/boost.git
>>     GIT_TAG boost-${BOOST_VERSION}
>>     GIT_PROGRESS ON
>>     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${BOOST_INSTALL_PREFIX}
>>     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>>     CONFIGURE_COMMAND ${BOOST_BOOTSTRAP_CMD} --prefix=${BOOST_BOOTSTRAP_PREFIX}
>>     # I do not necessarily care about any other Boost build options;
>> but that could change the further I get into unit testing, at least so
>> long as I will be adopting the test library for usage.
>>     BUILD_COMMAND ${BOOST_BUILD_CMD} --with-test
>> toolset=${BOOST_TOOLSET} variant=debug link=static stage
>> --prefix=${BOOST_BUILD_PREFIX}
>>     LOG_DOWNLOAD ON
>>     LOG_UPDATE ON
>>     LOG_CONFIGURE ON
>>     LOG_BUILD ON
>>     LOG_INSTALL ON
>> )
>>
>> Cheers,
>>
>> Michael Powell
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost as an ExternalProject

Michael Powell
On Mon, Oct 2, 2017 at 3:58 PM, Jacob Barrett <[hidden email]> wrote:
> The Apache Geode Native project is building Boost as an external project.
> You may want to look at our setup for inspiration. It builds correction on
> Windows with VS, Solaris x86 and SPARC with Solaris Studio, Linux with GCC
> and OS X with Xcode.Right now we are purely header only so if you need some
> libs you will have to tweak a little.
>
> https://github.com/apache/geode-native/blob/develop/dependencies/boost/CMakeLists.txt

Thank you for the heads up Jacob.

I could not find anything appreciably different that would make a
difference. It seems like EP_Add is ignoring the Working Directory. It
also does not seem to matter if I specify the full path for either
bootstrap and/or b2.

It seems to be making a little more progress, only sort of...

I get the following two messages:

output: Building Boost.Build engine

Failed to build Boost.Build engine.
Please consult bootstrap.log for further diagnostics.

You can try to obtain a prebuilt binary from

   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.


error: The system cannot find the path specified.
'.\build.bat' is not recognized as an internal or external command,
operable program or batch file.


With the output from the build in Visual Studio:

2>  Performing build step for 'boost'
2>  CMake Error at
G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/boost-build-Debug.cmake:16
(message):
2>    Command failed: The system cannot find the file specified
2>
2>     'b2.exe' '--with-test' 'toolset=msvc-14.0' 'variant=debug'
'link=static' 'stage'
'--prefix=G:/Source/Spikes/nanomsg/cppnngswig-working/boostbuild'

> In our project the depends on boost we just add have:
> target_link_libraries(... boost)
>
> -Jake
>
>
>
> On Mon, Oct 2, 2017 at 12:38 PM Michael Powell <[hidden email]>
> wrote:
>>
>> On Mon, Oct 2, 2017 at 3:06 PM, Michael Powell <[hidden email]>
>> wrote:
>> > On Mon, Oct 2, 2017 at 2:34 PM, Michael Powell <[hidden email]>
>> > wrote:
>> >> Hello,
>> >>
>> >> This question has been raised from time to time I think. I am trying
>> >> to build Boost as an ExternalProject, but I am ending up with an
>> >> error: 'cmd.exe' returned with exit code 1. Along these lines.
>>
>> This is the line from the Microsoft.CppCommon.targets that was failing.
>>
>>     <CustomBuild
>>       Sources                     ="@(CustomBuild)"
>>       BuildSuffix                 ="$(_BuildSuffix)"
>>
>>       TrackerLogDirectory         ="%(CustomBuild.TrackerLogDirectory)"
>>       MinimalRebuildFromTracking
>> ="%(CustomBuild.MinimalRebuildFromTracking)"
>>
>>       TLogReadFiles               ="@(CustomBuildTLogReadFiles)"
>>       TLogWriteFiles              ="@(CustomBuildTLogWriteFiles)"
>>       TrackFileAccess             ="$(TrackFileAccess)"
>>       ToolArchitecture            ="$(CustomBuildToolArchitecture)"
>>       TrackerFrameworkPath        ="$(CustomBuildTrackerFrameworkPath)"
>>       TrackerSdkPath              ="$(CustomBuildTrackerSdkPath)"
>>
>>       AcceptableNonZeroExitCodes
>> ="%(CustomBuild.AcceptableNonZeroExitCodes)"
>>       >
>>
>> And the output message is this:
>>
>> 2>  CMake Error at
>>
>> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/boost-configure-Debug.cmake:16
>> (message):
>> 2>    Command failed: The system cannot find the file specified
>> 2>
>> 2>     'bootstrap.bat'
>> '--prefix=G:/Source/Spikes/nanomsg/cppnngswig-working/boostbuild'
>> 2>
>> 2>    See also
>> 2>
>> 2>
>> G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/boost-configure-*.log
>>
>> However, I've set the Working Directory to the bootstrap.bat location,
>> so I do not know how that could be missed.
>>
>> > From the Boost VC project file:
>> >
>> >       <Command
>> > Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
>> > C:\Dev\CMake\bin\cmake.exe -E make_directory
>> > G:/Source/Spikes/nanomsg/cppnngswig-working/repos/boost
>> > if %errorlevel% neq 0 goto :cmEnd
>> > C:\Dev\CMake\bin\cmake.exe -E make_directory
>> >
>> > G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-build
>> > if %errorlevel% neq 0 goto :cmEnd
>> > C:\Dev\CMake\bin\cmake.exe -E make_directory
>> > G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix
>> > if %errorlevel% neq 0 goto :cmEnd
>> > C:\Dev\CMake\bin\cmake.exe -E make_directory
>> > G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/tmp
>> > if %errorlevel% neq 0 goto :cmEnd
>> > ** C:\Dev\CMake\bin\cmake.exe -E make_directory
>> >
>> > G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/$(Configuration)
>> > ** if %errorlevel% neq 0 goto :cmEnd
>> > C:\Dev\CMake\bin\cmake.exe -E make_directory
>> > G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src
>> > if %errorlevel% neq 0 goto :cmEnd
>> > C:\Dev\CMake\bin\cmake.exe -E touch
>> >
>> > G:/Source/Spikes/nanomsg/cppnngswig-working/build/boost-prefix/src/boost-stamp/$(Configuration)/boost-mkdir
>> > if %errorlevel% neq 0 goto :cmEnd
>> > :cmEnd
>> > ** endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
>> > :cmErrorLevel
>> > exit /b %1
>> > :cmDone
>> > if %errorlevel% neq 0 goto :VCEnd</Command>
>> >
>> > ** which line number was the error
>> >
>> > Honestly, that does not make much sense since the directories do in fact
>> > exist.
>> >
>> > The boost-configure-err.log shows this result:
>> >
>> > The system cannot find the path specified.
>> > '.\build.bat' is not recognized as an internal or external command,
>> > operable program or batch file.
>> >
>> > Which leads me to believe that possibly I need to tell the target to
>> > operate in a more appropriate working directory?
>> >
>> >> Perhaps I have involved one too many variables, but I doubt it. Ignore
>> >> the cross-plat stuff, this is building on Windows for the purposes of
>> >> this conversation.
>> >>
>> >> I tried to configure ExternalProject_Add with as much verbosity as
>> >> possible, but unfortunately the process is not especially talkative as
>> >> it turns out. But for the EC 1.
>> >>
>> >> set (BOOST_VERSION  1.65.1)
>> >>
>> >> message (STATUS "Adding Boost ${BOOST_VERSION} as an external
>> >> project.")
>> >>
>> >> set (BOOST_BOOTSTRAP_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
>> >> set (BOOST_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
>> >> set (BOOST_BUILD_PREFIX ${BOOST_BOOTSTRAP_PREFIX}/boost)
>> >> set (BOOST_GIT_REPO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost)
>> >>
>> >> if (WIN32)
>> >>     set (BOOST_BOOTSTRAP_CMD ${BOOST_GIT_REPO_DIR}/bootstrap.bat)
>> >>     # It was bjam at one point; it is now b2
>> >>     set (BOOST_BUILD_CMD ${BOOST_GIT_REPO_DIR}/b2.exe)
>> >> elseif (UNIX)
>> >>     set (BOOST_BOOTSTRAP_CMD ./${BOOST_GIT_REPO_DIR}/bootstrap.sh)
>> >>     set (BOOST_BUILD_CMD ./${BOOST_GIT_REPO_DIR}/b2)
>> >> endif ()
>> >>
>> >> #  TODO: TBD: For now, assuming only 64-bit address models.
>> >> set (BOOST_ADDR_MODEL 64)
>> >>
>> >> # TODO: TBD: align with the toolchain that we want to build through
>> >> the CMake here... For now assuming:
>> >> if (MSVC_VERSION EQUAL 1900)
>> >>     set (BOOST_TOOLSET msvc-14.0)
>> >> endif ()
>> >>
>> >> ExternalProject_Add (boost
>> >>     # PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>> >>     GIT_REPOSITORY [hidden email]:boostorg/boost.git
>> >>     GIT_TAG boost-${BOOST_VERSION}
>> >>     GIT_PROGRESS ON
>> >>     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${BOOST_INSTALL_PREFIX}
>> >>     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>> >>     CONFIGURE_COMMAND ${BOOST_BOOTSTRAP_CMD}
>> >> --prefix=${BOOST_BOOTSTRAP_PREFIX}
>> >>     # I do not necessarily care about any other Boost build options;
>> >> but that could change the further I get into unit testing, at least so
>> >> long as I will be adopting the test library for usage.
>> >>     BUILD_COMMAND ${BOOST_BUILD_CMD} --with-test
>> >> toolset=${BOOST_TOOLSET} variant=debug link=static stage
>> >> --prefix=${BOOST_BUILD_PREFIX}
>> >>     LOG_DOWNLOAD ON
>> >>     LOG_UPDATE ON
>> >>     LOG_CONFIGURE ON
>> >>     LOG_BUILD ON
>> >>     LOG_INSTALL ON
>> >> )
>> >>
>> >> Cheers,
>> >>
>> >> Michael Powell
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost as an ExternalProject

CMake mailing list
In reply to this post by Michael Powell
For building boost with cmake you can use this cmake script:

https://github.com/pfultz2/cget/blob/master/cget/cmake/boost.cmake

You can drop it in at the top of the boost tree and it will build Boost.Build
and then build boost with b2. This will map the cmake toolchain to the boost
toolchain so the builds are consistent.

On Mon, 2017-10-02 at 14:34 -0400, Michael Powell wrote:

> Hello,
>
> This question has been raised from time to time I think. I am trying
> to build Boost as an ExternalProject, but I am ending up with an
> error: 'cmd.exe' returned with exit code 1. Along these lines.
>
> Perhaps I have involved one too many variables, but I doubt it. Ignore
> the cross-plat stuff, this is building on Windows for the purposes of
> this conversation.
>
> I tried to configure ExternalProject_Add with as much verbosity as
> possible, but unfortunately the process is not especially talkative as
> it turns out. But for the EC 1.
>
> set (BOOST_VERSION  1.65.1)
>
> message (STATUS "Adding Boost ${BOOST_VERSION} as an external project.")
>
> set (BOOST_BOOTSTRAP_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
> set (BOOST_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
> set (BOOST_BUILD_PREFIX ${BOOST_BOOTSTRAP_PREFIX}/boost)
> set (BOOST_GIT_REPO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost)
>
> if (WIN32)
>     set (BOOST_BOOTSTRAP_CMD ${BOOST_GIT_REPO_DIR}/bootstrap.bat)
>     # It was bjam at one point; it is now b2
>     set (BOOST_BUILD_CMD ${BOOST_GIT_REPO_DIR}/b2.exe)
> elseif (UNIX)
>     set (BOOST_BOOTSTRAP_CMD ./${BOOST_GIT_REPO_DIR}/bootstrap.sh)
>     set (BOOST_BUILD_CMD ./${BOOST_GIT_REPO_DIR}/b2)
> endif ()
>
> #  TODO: TBD: For now, assuming only 64-bit address models.
> set (BOOST_ADDR_MODEL 64)
>
> # TODO: TBD: align with the toolchain that we want to build through
> the CMake here... For now assuming:
> if (MSVC_VERSION EQUAL 1900)
>     set (BOOST_TOOLSET msvc-14.0)
> endif ()
>
> ExternalProject_Add (boost
>     # PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>     GIT_REPOSITORY [hidden email]:boostorg/boost.git
>     GIT_TAG boost-${BOOST_VERSION}
>     GIT_PROGRESS ON
>     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${BOOST_INSTALL_PREFIX}
>     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>     CONFIGURE_COMMAND ${BOOST_BOOTSTRAP_CMD} --
> prefix=${BOOST_BOOTSTRAP_PREFIX}
>     # I do not necessarily care about any other Boost build options;
> but that could change the further I get into unit testing, at least so
> long as I will be adopting the test library for usage.
>     BUILD_COMMAND ${BOOST_BUILD_CMD} --with-test
> toolset=${BOOST_TOOLSET} variant=debug link=static stage
> --prefix=${BOOST_BUILD_PREFIX}
>     LOG_DOWNLOAD ON
>     LOG_UPDATE ON
>     LOG_CONFIGURE ON
>     LOG_BUILD ON
>     LOG_INSTALL ON
> )
>
> Cheers,
>
> Michael Powell

.
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost as an ExternalProject

Michael Powell
On Mon, Oct 2, 2017 at 4:54 PM, paul <[hidden email]> wrote:
> For building boost with cmake you can use this cmake script:
>
> https://github.com/pfultz2/cget/blob/master/cget/cmake/boost.cmake
>
> You can drop it in at the top of the boost tree and it will build Boost.Build
> and then build boost with b2. This will map the cmake toolchain to the boost
> toolchain so the builds are consistent.

That does seem to be the rub, at least on a Windows build. Something
about ExternalProject_Add ain't quite kosher with what the Boost build
system expects and it needs a little help.

Using ExternalProject_Add, it succeeds, to a point. Then it falls over
looking for b2 no matter how I try to persuade it:

ExternalProject_Add (boost
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/boost
    GIT_REPOSITORY [hidden email]:boostorg/boost.git
    GIT_TAG boost-${BOOST_VERSION}
    GIT_PROGRESS 1
    UPDATE_COMMAND ${BOOST_BOOTSTRAP_CMD}
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ${BOOST_BUILD_CMD} stage
    INSTALL_COMMAND ""
    LOG_DOWNLOAD 1
    LOG_UPDATE 1
    LOG_CONFIGURE 1
    LOG_BUILD 1
    LOG_INSTALL 1
)

It seems to use PREFIX a bit over zealously IMO, and not
WORKING_DIRECTORY one iota. I did have one breakthrough; at least
bootstrap.bat is building b2.exe, so that's something.

With the update step being a straight 'bootstrap.bat' invocation, then:

'b2.exe' '--prefix=G:/Source/Spikes/nanomsg/cppnngswig-working/boostbuild'
'-std=c++11' '--with-test' 'address-model=64' 'toolset=msvc-14.0'
'variant=debug' 'link=static' 'stage'

I'm really at a loss how folks are succeeding with that, maybe on *nix
systems, that is a different story, I don't know, I'm not aware.

So with this, it is a key departure from EP_Add in that it "helps" the
build system along. That was going to be my next approach.

I still think EP_Add should work, but I'm not sure what it is missing.
Maybe a simple <path/to/b2>\b2 ?

> On Mon, 2017-10-02 at 14:34 -0400, Michael Powell wrote:
>> Hello,
>>
>> This question has been raised from time to time I think. I am trying
>> to build Boost as an ExternalProject, but I am ending up with an
>> error: 'cmd.exe' returned with exit code 1. Along these lines.
>>
>> Perhaps I have involved one too many variables, but I doubt it. Ignore
>> the cross-plat stuff, this is building on Windows for the purposes of
>> this conversation.
>>
>> I tried to configure ExternalProject_Add with as much verbosity as
>> possible, but unfortunately the process is not especially talkative as
>> it turns out. But for the EC 1.
>>
>> set (BOOST_VERSION  1.65.1)
>>
>> message (STATUS "Adding Boost ${BOOST_VERSION} as an external project.")
>>
>> set (BOOST_BOOTSTRAP_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
>> set (BOOST_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/boostbuild)
>> set (BOOST_BUILD_PREFIX ${BOOST_BOOTSTRAP_PREFIX}/boost)
>> set (BOOST_GIT_REPO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost)
>>
>> if (WIN32)
>>     set (BOOST_BOOTSTRAP_CMD ${BOOST_GIT_REPO_DIR}/bootstrap.bat)
>>     # It was bjam at one point; it is now b2
>>     set (BOOST_BUILD_CMD ${BOOST_GIT_REPO_DIR}/b2.exe)
>> elseif (UNIX)
>>     set (BOOST_BOOTSTRAP_CMD ./${BOOST_GIT_REPO_DIR}/bootstrap.sh)
>>     set (BOOST_BUILD_CMD ./${BOOST_GIT_REPO_DIR}/b2)
>> endif ()
>>
>> #  TODO: TBD: For now, assuming only 64-bit address models.
>> set (BOOST_ADDR_MODEL 64)
>>
>> # TODO: TBD: align with the toolchain that we want to build through
>> the CMake here... For now assuming:
>> if (MSVC_VERSION EQUAL 1900)
>>     set (BOOST_TOOLSET msvc-14.0)
>> endif ()
>>
>> ExternalProject_Add (boost
>>     # PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>>     GIT_REPOSITORY [hidden email]:boostorg/boost.git
>>     GIT_TAG boost-${BOOST_VERSION}
>>     GIT_PROGRESS ON
>>     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${BOOST_INSTALL_PREFIX}
>>     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/repos/boost
>>     CONFIGURE_COMMAND ${BOOST_BOOTSTRAP_CMD} --
>> prefix=${BOOST_BOOTSTRAP_PREFIX}
>>     # I do not necessarily care about any other Boost build options;
>> but that could change the further I get into unit testing, at least so
>> long as I will be adopting the test library for usage.
>>     BUILD_COMMAND ${BOOST_BUILD_CMD} --with-test
>> toolset=${BOOST_TOOLSET} variant=debug link=static stage
>> --prefix=${BOOST_BUILD_PREFIX}
>>     LOG_DOWNLOAD ON
>>     LOG_UPDATE ON
>>     LOG_CONFIGURE ON
>>     LOG_BUILD ON
>>     LOG_INSTALL ON
>> )
>>
>> Cheers,
>>
>> Michael Powell
>
> .
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost as an ExternalProject

Knox, Kent
In reply to this post by Michael Powell
Hi Michael~

> That does seem to be the rub, at least on a Windows build. Something about ExternalProject_Add ain't quite kosher with what the Boost build system expects and it needs a little help.

> Using ExternalProject_Add, it succeeds, to a point. Then it falls over looking for b2 no matter how I try to persuade it:

> ExternalProject_Add (boost
>    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/boost
>    GIT_REPOSITORY [hidden email]:boostorg/boost.git
>    GIT_TAG boost-${BOOST_VERSION}
>    GIT_PROGRESS 1
>    UPDATE_COMMAND ${BOOST_BOOTSTRAP_CMD}
>    CONFIGURE_COMMAND ""
>    BUILD_COMMAND ${BOOST_BUILD_CMD} stage
>    INSTALL_COMMAND ""
>    LOG_DOWNLOAD 1
>    LOG_UPDATE 1
>    LOG_CONFIGURE 1
>    LOG_BUILD 1
>    LOG_INSTALL 1
> )

I think you need to add the following to your ExternalProject_Add ()
BUILD_IN_SOURCE  1

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake