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
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ project( tnl )
set( tnlVersion "0.1" )
set( tnlVersion "0.1" )


# declare all custom build options
# 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_MIC "Build with MIC support" OFF)
option(WITH_CUDA "Build with CUDA support" ON)
option(WITH_CUDA "Build with CUDA support" ON)
set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures")
set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures")
@@ -377,6 +378,7 @@ INCLUDE( CPack )


# Print custom build options
# Print custom build options
message( "-- Build options:" )
message( "-- Build options:" )
message( "   OFFLINE_BUILD=${OFFLINE_BUILD}" )
message( "   WITH_MIC=${WITH_MIC}" )
message( "   WITH_MIC=${WITH_MIC}" )
message( "   WITH_CUDA=${WITH_CUDA}" )
message( "   WITH_CUDA=${WITH_CUDA}" )
message( "   WITH_CUDA_ARCH=${WITH_CUDA_ARCH}" )
message( "   WITH_CUDA_ARCH=${WITH_CUDA_ARCH}" )
+3 −0
Original line number Original line Diff line number Diff line
@@ -11,6 +11,7 @@ CMAKE="cmake"
CMAKE_ONLY="no"
CMAKE_ONLY="no"
HELP="no"
HELP="no"
VERBOSE=""
VERBOSE=""
OFFLINE_BUILD="no"


WITH_CLANG="no"
WITH_CLANG="no"
WITH_CUDA="yes"
WITH_CUDA="yes"
@@ -40,6 +41,7 @@ do
        --cmake=*                        ) CMAKE="${option#*=}" ;;
        --cmake=*                        ) CMAKE="${option#*=}" ;;
        --cmake-only=*                   ) CMAKE_ONLY="${option#*=}" ;;
        --cmake-only=*                   ) CMAKE_ONLY="${option#*=}" ;;
        --verbose                        ) VERBOSE="VERBOSE=1" ;;
        --verbose                        ) VERBOSE="VERBOSE=1" ;;
        --offline-build                  ) OFFLINE_BUILD="yes" ;;
        --help                           ) HELP="yes" ;;
        --help                           ) HELP="yes" ;;
        --with-clang=*                   ) WITH_CLANG="${option#*=}" ;;
        --with-clang=*                   ) WITH_CLANG="${option#*=}" ;;
        --with-mic=*                     ) WITH_MIC="${option#*=}" ;;
        --with-mic=*                     ) WITH_MIC="${option#*=}" ;;
@@ -104,6 +106,7 @@ echo "Configuring ${BUILD} $TARGET ..."
${CMAKE} ${ROOT_DIR} \
${CMAKE} ${ROOT_DIR} \
         -DCMAKE_BUILD_TYPE=${BUILD} \
         -DCMAKE_BUILD_TYPE=${BUILD} \
         -DCMAKE_INSTALL_PREFIX=${PREFIX} \
         -DCMAKE_INSTALL_PREFIX=${PREFIX} \
         -DOFFLINE_BUILD=${OFFLINE_BUILD} \
         -DWITH_MIC=${WITH_MIC} \
         -DWITH_MIC=${WITH_MIC} \
         -DWITH_CUDA=${WITH_CUDA} \
         -DWITH_CUDA=${WITH_CUDA} \
         -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} \
         -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} \
+3 −0
Original line number Original line Diff line number Diff line
@@ -19,4 +19,7 @@ ExternalProject_Add(googletest
  BUILD_COMMAND     ""
  BUILD_COMMAND     ""
  INSTALL_COMMAND   ""
  INSTALL_COMMAND   ""
  TEST_COMMAND      ""
  TEST_COMMAND      ""
  # Disable update of the external project in an offline build
  # reference: https://stackoverflow.com/a/40423683
  UPDATE_DISCONNECTED ${OFFLINE_BUILD}
)
)
+3 −0
Original line number Original line Diff line number Diff line
@@ -9,4 +9,7 @@ ExternalProject_Add(pybind11
  SOURCE_DIR        "${CMAKE_BINARY_DIR}/pybind11-src"
  SOURCE_DIR        "${CMAKE_BINARY_DIR}/pybind11-src"
  BINARY_DIR        "${CMAKE_BINARY_DIR}/pybind11-build"
  BINARY_DIR        "${CMAKE_BINARY_DIR}/pybind11-build"
  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DPYBIND11_TEST=FALSE
  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}
)
)