Skip to content
Snippets Groups Projects
Commit de3a13e7 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Added --offline-build option to skip update of external Cmake projects

parent e689178a
No related branches found
No related tags found
1 merge request!4Small Cmake updates
......@@ -19,6 +19,7 @@ project( tnl )
set( tnlVersion "0.1" )
# declare all custom build options
option(OFFLINE_BUILD "Offline build (i.e. without downloading libraries such as pybind11)" OFF)
option(WITH_MIC "Build with MIC support" OFF)
option(WITH_CUDA "Build with CUDA support" ON)
set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures")
......@@ -377,6 +378,7 @@ INCLUDE( CPack )
# Print custom build options
message( "-- Build options:" )
message( " OFFLINE_BUILD=${OFFLINE_BUILD}" )
message( " WITH_MIC=${WITH_MIC}" )
message( " WITH_CUDA=${WITH_CUDA}" )
message( " WITH_CUDA_ARCH=${WITH_CUDA_ARCH}" )
......
......@@ -11,6 +11,7 @@ CMAKE="cmake"
CMAKE_ONLY="no"
HELP="no"
VERBOSE=""
OFFLINE_BUILD="no"
WITH_CLANG="no"
WITH_CUDA="yes"
......@@ -40,6 +41,7 @@ do
--cmake=* ) CMAKE="${option#*=}" ;;
--cmake-only=* ) CMAKE_ONLY="${option#*=}" ;;
--verbose ) VERBOSE="VERBOSE=1" ;;
--offline-build ) OFFLINE_BUILD="yes" ;;
--help ) HELP="yes" ;;
--with-clang=* ) WITH_CLANG="${option#*=}" ;;
--with-mic=* ) WITH_MIC="${option#*=}" ;;
......@@ -104,6 +106,7 @@ echo "Configuring ${BUILD} $TARGET ..."
${CMAKE} ${ROOT_DIR} \
-DCMAKE_BUILD_TYPE=${BUILD} \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DOFFLINE_BUILD=${OFFLINE_BUILD} \
-DWITH_MIC=${WITH_MIC} \
-DWITH_CUDA=${WITH_CUDA} \
-DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} \
......
......@@ -19,4 +19,7 @@ ExternalProject_Add(googletest
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
# Disable update of the external project in an offline build
# reference: https://stackoverflow.com/a/40423683
UPDATE_DISCONNECTED ${OFFLINE_BUILD}
)
......@@ -9,4 +9,7 @@ ExternalProject_Add(pybind11
SOURCE_DIR "${CMAKE_BINARY_DIR}/pybind11-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/pybind11-build"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DPYBIND11_TEST=FALSE
# Disable update of the external project in an offline build
# reference: https://stackoverflow.com/a/40423683
UPDATE_DISCONNECTED ${OFFLINE_BUILD}
)
  • Maintainer

    I would keep the new flag. However, it would be better if the build would continue by default even if the online updates fail ... to be more user friendly.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment