2016-12-22 23:12:11 +05:00
|
|
|
include (ExternalProject)
|
|
|
|
|
Fix various typos
Found via `codespell -q 3 -S ./external_dependencies/pybind11 -L alledges,allright,ane,anormal,ans,apoints,ba,boxs,cancle,childs,co-ordinate,co-ordinates,daty,enty,filld,hel,identifyable,ist,linz,lod,ned,nd,selt,statics,suround,thev,thist,thisy,timere,upto,wel`
2022-03-26 03:21:48 +05:00
|
|
|
option( BUILD_ZLIB "Build and link static version of zlib (useful for pip binaries)" OFF )
|
|
|
|
option( BUILD_OCC "Build and link static version of occ (useful for pip binaries)" OFF )
|
2016-12-22 23:12:11 +05:00
|
|
|
set_property (DIRECTORY PROPERTY EP_PREFIX dependencies)
|
|
|
|
|
|
|
|
set (NETGEN_DEPENDENCIES)
|
|
|
|
set (LAPACK_DEPENDENCIES)
|
2017-02-10 15:33:05 +05:00
|
|
|
set (NETGEN_CMAKE_ARGS "" CACHE INTERNAL "")
|
2021-10-27 19:50:07 +05:00
|
|
|
set (SUBPROJECT_CMAKE_ARGS "" CACHE INTERNAL "")
|
2021-11-04 18:44:14 +05:00
|
|
|
|
2021-10-27 19:50:07 +05:00
|
|
|
set (SUBPROJECT_ARGS
|
|
|
|
LIST_SEPARATOR |
|
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/dependencies
|
|
|
|
)
|
2021-11-04 18:44:14 +05:00
|
|
|
|
2023-07-28 16:01:41 +05:00
|
|
|
if (EMSCRIPTEN)
|
|
|
|
set (SUBPROJECT_ARGS
|
|
|
|
${SUBPROJECT_ARGS}
|
|
|
|
CMAKE_COMMAND emcmake ${CMAKE_COMMAND})
|
|
|
|
endif()
|
|
|
|
|
2021-11-04 18:44:14 +05:00
|
|
|
# only show output on failure in ci-builds
|
2021-11-08 19:52:52 +05:00
|
|
|
if(DEFINED ENV{CI})
|
2021-11-02 14:39:16 +05:00
|
|
|
set (SUBPROJECT_ARGS
|
2023-07-28 16:01:41 +05:00
|
|
|
${SUBPROJECT_ARGS}
|
2021-11-04 18:44:14 +05:00
|
|
|
LOG_DOWNLOAD ON
|
|
|
|
LOG_BUILD ON
|
|
|
|
LOG_INSTALL ON
|
|
|
|
LOG_CONFIGURE ON
|
2021-10-27 19:50:07 +05:00
|
|
|
)
|
2021-11-04 18:44:14 +05:00
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.0")
|
|
|
|
set (SUBPROJECT_ARGS
|
|
|
|
${SUBPROJECT_ARGS}
|
|
|
|
LOG_OUTPUT_ON_FAILURE ON
|
|
|
|
LOG_MERGED_STDOUTERR ON
|
|
|
|
)
|
|
|
|
endif()
|
2021-10-27 19:50:07 +05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
set (NETGEN_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} )
|
2016-12-22 23:12:11 +05:00
|
|
|
|
|
|
|
macro(set_vars VAR_OUT)
|
|
|
|
foreach(varname ${ARGN})
|
|
|
|
if(NOT "${${varname}}" STREQUAL "")
|
2021-10-27 19:50:07 +05:00
|
|
|
string(REPLACE ";" "|" varvalue "${${varname}}" )
|
|
|
|
set(${VAR_OUT} "${${VAR_OUT}};-D${varname}=${varvalue}" CACHE INTERNAL "")
|
2016-12-22 23:12:11 +05:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endmacro()
|
2021-10-27 19:50:07 +05:00
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
set_vars(SUBPROJECT_CMAKE_ARGS CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
set_vars(SUBPROJECT_CMAKE_ARGS CMAKE_OSX_SYSROOT)
|
|
|
|
set_vars(SUBPROJECT_CMAKE_ARGS CMAKE_C_COMPILER)
|
|
|
|
set_vars(SUBPROJECT_CMAKE_ARGS CMAKE_CXX_COMPILER)
|
|
|
|
set_vars(SUBPROJECT_CMAKE_ARGS CMAKE_BUILD_TYPE)
|
|
|
|
|
|
|
|
set(SUBPROJECT_CMAKE_ARGS "${SUBPROJECT_CMAKE_ARGS};-DCMAKE_POSITION_INDEPENDENT_CODE=ON" CACHE INTERNAL "")
|
|
|
|
|
|
|
|
if(USE_CCACHE)
|
|
|
|
find_program(CCACHE_FOUND NAMES ccache ccache.bat)
|
|
|
|
if(CCACHE_FOUND)
|
|
|
|
set(SUBPROJECT_CMAKE_ARGS "${SUBPROJECT_CMAKE_ARGS};-DCMAKE_CXX_COMPILER_LAUNCHER=${CCACHE_FOUND}" CACHE INTERNAL "")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-12-22 23:12:11 +05:00
|
|
|
#######################################################################
|
2020-03-12 01:30:43 +05:00
|
|
|
set (DEPS_DOWNLOAD_URL "https://github.com/NGSolve/ngsolve_dependencies/releases/download/v1.0.0" CACHE STRING INTERNAL)
|
2021-09-02 17:52:34 +05:00
|
|
|
set (OCC_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/occ75_win64.zip" CACHE STRING INTERNAL)
|
2020-03-12 01:30:43 +05:00
|
|
|
set (TCLTK_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/tcltk_win64.zip" CACHE STRING INTERNAL)
|
|
|
|
set (ZLIB_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/zlib_win64.zip" CACHE STRING INTERNAL)
|
|
|
|
set (CGNS_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/cgns_win64.zip" CACHE STRING INTERNAL)
|
|
|
|
set (CGNS_DOWNLOAD_URL_MAC "${DEPS_DOWNLOAD_URL}/cgns_mac.zip" CACHE STRING INTERNAL)
|
2016-12-22 23:12:11 +05:00
|
|
|
|
2021-10-27 19:50:07 +05:00
|
|
|
|
2017-01-10 16:01:48 +05:00
|
|
|
if(UNIX)
|
2017-01-10 22:45:49 +05:00
|
|
|
message("Checking for write permissions in install directory...")
|
2017-05-30 00:19:34 +05:00
|
|
|
execute_process(COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX})
|
|
|
|
execute_process(COMMAND test -w ${CMAKE_INSTALL_PREFIX} RESULT_VARIABLE res)
|
2017-01-10 22:45:49 +05:00
|
|
|
if(res)
|
2017-01-31 16:20:27 +05:00
|
|
|
message(WARNING "No write access at install directory, please set correct permissions")
|
2017-01-10 16:01:48 +05:00
|
|
|
endif()
|
|
|
|
endif(UNIX)
|
2016-12-22 23:12:11 +05:00
|
|
|
|
2021-10-27 19:50:07 +05:00
|
|
|
if(USE_OCC)
|
|
|
|
if(BUILD_OCC)
|
|
|
|
set(OCC_DIR ${CMAKE_CURRENT_BINARY_DIR}/dependencies/occ)
|
|
|
|
|
|
|
|
ExternalProject_Add(project_occ
|
2024-05-24 00:57:50 +05:00
|
|
|
# URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_3.zip
|
|
|
|
# URL_MD5 2426e373903faabbd4f96a01a934b66d
|
2024-05-23 13:37:26 +05:00
|
|
|
# URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_7_2.zip
|
|
|
|
# URL_MD5 533eb4f18af0f77ae321b158caeaee79
|
2024-05-24 00:57:50 +05:00
|
|
|
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_8_1.zip
|
|
|
|
URL_MD5 bf62952a03696dab9e4272aa8efacb1a
|
2021-10-27 19:50:07 +05:00
|
|
|
DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies
|
|
|
|
${SUBPROJECT_ARGS}
|
|
|
|
CMAKE_ARGS
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${OCC_DIR}
|
|
|
|
-DCMAKE_PREFIX_PATH=${OCC_DIR}
|
|
|
|
-DBUILD_LIBRARY_TYPE:STRING=Static
|
|
|
|
-DBUILD_MODULE_FoundationClasses:BOOL=ON
|
|
|
|
-DBUILD_MODULE_ModelingData:BOOL=ON
|
|
|
|
-DBUILD_MODULE_ModelingAlgorithms:BOOL=ON
|
|
|
|
-DBUILD_MODULE_DataExchange:BOOL=ON
|
2022-04-27 16:42:04 +05:00
|
|
|
-DBUILD_MODULE_Visualization:BOOL=OFF
|
2021-10-27 19:50:07 +05:00
|
|
|
-DBUILD_MODULE_ApplicationFramework:BOOL=OFF
|
|
|
|
-DBUILD_MODULE_Draw:BOOL=OFF
|
2023-09-14 13:49:07 +05:00
|
|
|
-DBUILD_MODULE_DETools:BOOL=OFF
|
2022-04-27 16:42:04 +05:00
|
|
|
-DUSE_FREETYPE:BOOL=OFF
|
|
|
|
-DUSE_OPENGL:BOOL=OFF
|
|
|
|
-DUSE_XLIB:BOOL=OFF
|
|
|
|
-DBUILD_DOC_Overview:BOOL=OFF
|
2021-10-27 19:50:07 +05:00
|
|
|
${SUBPROJECT_CMAKE_ARGS}
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND NETGEN_DEPENDENCIES project_occ)
|
|
|
|
set(OpenCascade_ROOT ${OCC_DIR})
|
|
|
|
else(BUILD_OCC)
|
2024-06-14 13:50:42 +05:00
|
|
|
find_package(OpenCascade NAMES OpenCasCade OpenCASCADE opencascade)
|
|
|
|
if(NOT OpenCascade_FOUND)
|
|
|
|
message(FATAL_ERROR "Opencascade not found, either\n\
|
|
|
|
- install pip packages netgen-occt-devel netgen-occ\n\
|
|
|
|
- set OpenCascade_DIR to a directory containting opencascadeConfig.cmake\n\
|
|
|
|
- build OpenCascade automatically by passing -DBUILD_OCC=ON\n\
|
|
|
|
- disable OpenCascade by passing -DUSE_OCC=OFF\n\
|
|
|
|
")
|
2021-10-27 19:50:07 +05:00
|
|
|
endif()
|
|
|
|
endif(BUILD_OCC)
|
|
|
|
endif(USE_OCC)
|
|
|
|
|
|
|
|
if(BUILD_ZLIB)
|
2023-07-28 16:01:41 +05:00
|
|
|
set(ZLIB_ROOT ${CMAKE_CURRENT_BINARY_DIR}/dependencies/zlib)
|
2021-10-27 19:50:07 +05:00
|
|
|
ExternalProject_Add(project_zlib
|
|
|
|
${SUBPROJECT_ARGS}
|
|
|
|
URL https://github.com/madler/zlib/archive/refs/tags/v1.2.11.zip
|
|
|
|
URL_MD5 9d6a627693163bbbf3f26403a3a0b0b1
|
|
|
|
DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies
|
|
|
|
CMAKE_ARGS
|
2023-07-28 16:01:41 +05:00
|
|
|
-DCMAKE_INSTALL_PREFIX=${ZLIB_ROOT}
|
2021-10-27 19:50:07 +05:00
|
|
|
${SUBPROJECT_CMAKE_ARGS}
|
|
|
|
UPDATE_COMMAND "" # Disable update
|
|
|
|
BUILD_IN_SOURCE 1
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND NETGEN_DEPENDENCIES project_zlib)
|
|
|
|
if(WIN32)
|
|
|
|
# force linking the static library
|
2023-07-28 16:01:41 +05:00
|
|
|
set(ZLIB_INCLUDE_DIRS ${ZLIB_ROOT}/include)
|
|
|
|
set(ZLIB_LIBRARIES ${ZLIB_ROOT}/lib/zlibstatic.lib)
|
2024-08-28 21:14:27 +05:00
|
|
|
set(ZLIB_LIBRARY_RELEASE ${ZLIB_ROOT}/lib/zlibstatic.lib)
|
2024-10-07 21:04:20 +05:00
|
|
|
else(WIN32)
|
2023-07-28 16:01:41 +05:00
|
|
|
set(ZLIB_INCLUDE_DIRS ${ZLIB_ROOT}/include)
|
|
|
|
set(ZLIB_LIBRARIES ${ZLIB_ROOT}/lib/libz.a)
|
2024-08-28 21:14:27 +05:00
|
|
|
set(ZLIB_LIBRARY_RELEASE ${ZLIB_ROOT}/lib/libz.a)
|
2021-10-27 19:50:07 +05:00
|
|
|
endif(WIN32)
|
|
|
|
else()
|
|
|
|
include(cmake/external_projects/zlib.cmake)
|
|
|
|
endif()
|
2016-12-22 23:12:11 +05:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
if (USE_PYTHON)
|
2017-01-09 23:16:53 +05:00
|
|
|
find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include NO_DEFAULT_PATH)
|
2018-01-25 18:01:57 +05:00
|
|
|
set(NG_INSTALL_PYBIND ON)
|
2016-12-22 23:12:11 +05:00
|
|
|
if( NOT PYBIND_INCLUDE_DIR )
|
2017-01-20 14:16:48 +05:00
|
|
|
# if the pybind submodule is missing, try to initialize and update all submodules
|
2016-12-22 23:12:11 +05:00
|
|
|
execute_process(COMMAND git submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
2018-01-25 18:01:57 +05:00
|
|
|
find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include NO_DEFAULT_PATH)
|
2016-12-22 23:12:11 +05:00
|
|
|
endif( NOT PYBIND_INCLUDE_DIR )
|
|
|
|
if( PYBIND_INCLUDE_DIR )
|
|
|
|
message("-- Found Pybind11: ${PYBIND_INCLUDE_DIR}")
|
|
|
|
else( PYBIND_INCLUDE_DIR )
|
|
|
|
message(FATAL_ERROR "Could NOT find pybind11!")
|
|
|
|
endif( PYBIND_INCLUDE_DIR )
|
2023-08-30 23:25:11 +05:00
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
|
2023-09-14 13:49:25 +05:00
|
|
|
find_package(Python3 COMPONENTS Interpreter Development.Module)
|
2024-02-05 14:02:39 +05:00
|
|
|
if(NOT EMSCRIPTEN)
|
|
|
|
find_package(Python3 COMPONENTS Interpreter Development.Embed)
|
|
|
|
endif()
|
2023-08-30 23:25:11 +05:00
|
|
|
else()
|
|
|
|
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
|
|
|
|
endif()
|
2016-12-22 23:12:11 +05:00
|
|
|
|
2018-01-25 18:01:57 +05:00
|
|
|
set_vars(NETGEN_CMAKE_ARGS
|
2023-08-29 13:52:22 +05:00
|
|
|
Python3_INCLUDE_DIRS
|
|
|
|
Python3_LIBRARIES
|
|
|
|
Python3_EXECUTABLE
|
|
|
|
Python3_VERSION
|
2018-01-25 18:01:57 +05:00
|
|
|
PYBIND_INCLUDE_DIR
|
|
|
|
NG_INSTALL_PYBIND
|
|
|
|
)
|
2016-12-22 23:12:11 +05:00
|
|
|
endif (USE_PYTHON)
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
if(USE_GUI)
|
2017-02-23 18:45:25 +05:00
|
|
|
include(cmake/external_projects/tcltk.cmake)
|
2016-12-22 23:12:11 +05:00
|
|
|
endif(USE_GUI)
|
|
|
|
|
2020-03-11 19:53:08 +05:00
|
|
|
if(USE_CGNS)
|
|
|
|
include(cmake/external_projects/cgns.cmake)
|
|
|
|
endif(USE_CGNS)
|
|
|
|
|
2017-02-23 18:45:25 +05:00
|
|
|
#######################################################################
|
|
|
|
if(USE_MPI)
|
2019-10-01 14:48:38 +05:00
|
|
|
if (METIS_DIR)
|
|
|
|
message(STATUS "Using external METIS at: ${METIS_DIR}")
|
|
|
|
else (METIS_DIR)
|
|
|
|
message(STATUS "Looking for system METIS")
|
|
|
|
find_package(METIS QUIET)
|
|
|
|
if(NOT METIS_FOUND)
|
|
|
|
message(WARNING "Could not find METIS, it will be built from source (this might conflict with NGSolve MUMPS)!")
|
|
|
|
include(cmake/external_projects/metis.cmake)
|
|
|
|
endif(NOT METIS_FOUND)
|
|
|
|
endif(METIS_DIR)
|
2017-02-23 18:45:25 +05:00
|
|
|
endif(USE_MPI)
|
|
|
|
|
|
|
|
|
2016-12-22 23:12:11 +05:00
|
|
|
#######################################################################
|
|
|
|
# propagate cmake variables to Netgen subproject
|
|
|
|
set_vars( NETGEN_CMAKE_ARGS
|
2023-09-05 20:13:29 +05:00
|
|
|
CMAKE_MODULE_LINKER_FLAGS
|
|
|
|
CMAKE_MODULE_LINKER_FLAGS_RELEASE
|
2017-01-26 18:52:15 +05:00
|
|
|
CMAKE_SHARED_LINKER_FLAGS
|
|
|
|
CMAKE_SHARED_LINKER_FLAGS_RELEASE
|
|
|
|
CMAKE_CXX_FLAGS
|
|
|
|
CMAKE_CXX_FLAGS_RELEASE
|
2023-09-05 20:13:29 +05:00
|
|
|
CMAKE_STRIP
|
2017-01-26 18:52:15 +05:00
|
|
|
|
2016-12-22 23:12:11 +05:00
|
|
|
USE_GUI
|
|
|
|
USE_PYTHON
|
|
|
|
USE_MPI
|
2024-05-13 16:43:53 +05:00
|
|
|
USE_MPI_WRAPPER
|
2016-12-22 23:12:11 +05:00
|
|
|
USE_VT
|
|
|
|
USE_VTUNE
|
|
|
|
USE_NUMA
|
|
|
|
USE_CCACHE
|
|
|
|
USE_NATIVE_ARCH
|
|
|
|
USE_OCC
|
2017-02-03 19:28:59 +05:00
|
|
|
USE_MPEG
|
2017-09-22 14:06:00 +05:00
|
|
|
USE_JPEG
|
2020-03-11 15:48:05 +05:00
|
|
|
USE_CGNS
|
2017-05-30 00:19:34 +05:00
|
|
|
USE_INTERNAL_TCL
|
2017-02-16 19:01:16 +05:00
|
|
|
INSTALL_PROFILES
|
2016-12-22 23:12:11 +05:00
|
|
|
INTEL_MIC
|
2017-05-30 00:19:34 +05:00
|
|
|
CMAKE_INSTALL_PREFIX
|
2018-12-03 20:28:04 +05:00
|
|
|
ENABLE_UNIT_TESTS
|
2018-12-08 20:10:29 +05:00
|
|
|
ENABLE_CPP_CORE_GUIDELINES_CHECK
|
2018-12-28 17:43:15 +05:00
|
|
|
USE_SPDLOG
|
|
|
|
DEBUG_LOG
|
2019-01-02 20:30:55 +05:00
|
|
|
CHECK_RANGE
|
2020-11-21 19:49:07 +05:00
|
|
|
TRACE_MEMORY
|
2019-06-30 15:52:08 +05:00
|
|
|
BUILD_STUB_FILES
|
2019-11-27 00:26:18 +05:00
|
|
|
BUILD_FOR_CONDA
|
2020-10-01 16:35:53 +05:00
|
|
|
NG_COMPILE_FLAGS
|
2021-10-27 19:50:07 +05:00
|
|
|
OpenCascade_ROOT
|
|
|
|
ZLIB_INCLUDE_DIRS
|
|
|
|
ZLIB_LIBRARIES
|
2024-08-28 21:14:27 +05:00
|
|
|
ZLIB_LIBRARY_RELEASE
|
2023-07-28 16:01:41 +05:00
|
|
|
ZLIB_ROOT
|
2022-04-27 16:42:04 +05:00
|
|
|
|
|
|
|
NGLIB_LIBRARY_TYPE
|
|
|
|
NGCORE_LIBRARY_TYPE
|
|
|
|
NGGUI_LIBRARY_TYPE
|
2023-06-23 15:03:14 +05:00
|
|
|
|
|
|
|
NG_INSTALL_DIR_PYTHON
|
|
|
|
NG_INSTALL_DIR_BIN
|
|
|
|
NG_INSTALL_DIR_LIB
|
|
|
|
NG_INSTALL_DIR_INCLUDE
|
|
|
|
NG_INSTALL_DIR_CMAKE
|
|
|
|
NG_INSTALL_DIR_RES
|
|
|
|
NG_INSTALL_SUFFIX
|
2016-12-22 23:12:11 +05:00
|
|
|
)
|
|
|
|
|
2017-02-10 15:33:05 +05:00
|
|
|
# propagate all variables set on the command line using cmake -DFOO=BAR
|
|
|
|
# to Netgen subproject
|
|
|
|
get_cmake_property(CACHE_VARS CACHE_VARIABLES)
|
|
|
|
foreach(CACHE_VAR ${CACHE_VARS})
|
|
|
|
get_property(CACHE_VAR_HELPSTRING CACHE ${CACHE_VAR} PROPERTY HELPSTRING)
|
2022-02-02 21:18:55 +05:00
|
|
|
if(CACHE_VAR_HELPSTRING STREQUAL "No help, variable specified on the command line." AND NOT CACHE_VAR STREQUAL "CMAKE_OSX_ARCHITECTURES")
|
2017-02-10 15:33:05 +05:00
|
|
|
get_property(CACHE_VAR_TYPE CACHE ${CACHE_VAR} PROPERTY TYPE)
|
2021-10-27 19:50:07 +05:00
|
|
|
string(REPLACE ";" "|" varvalue "${${CACHE_VAR}}" )
|
|
|
|
set(NETGEN_CMAKE_ARGS ${NETGEN_CMAKE_ARGS};-D${CACHE_VAR}:${CACHE_VAR_TYPE}=${varvalue} CACHE INTERNAL "")
|
2017-02-10 15:33:05 +05:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2017-01-10 16:39:12 +05:00
|
|
|
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
|
|
|
set(NETGEN_BUILD_COMMAND $(MAKE) --silent )
|
|
|
|
else()
|
|
|
|
set(NETGEN_BUILD_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/netgen --config ${CMAKE_BUILD_TYPE})
|
|
|
|
endif()
|
|
|
|
|
2021-06-04 18:57:15 +05:00
|
|
|
|
2021-10-27 19:50:07 +05:00
|
|
|
string(REPLACE ";" "|" NETGEN_CMAKE_PREFIX_PATH_ALT_SEP "${NETGEN_CMAKE_PREFIX_PATH}")
|
2016-12-22 23:12:11 +05:00
|
|
|
ExternalProject_Add (netgen
|
2021-10-27 19:50:07 +05:00
|
|
|
${SUBPROJECT_ARGS}
|
2016-12-22 23:12:11 +05:00
|
|
|
DEPENDS ${NETGEN_DEPENDENCIES}
|
|
|
|
SOURCE_DIR ${PROJECT_SOURCE_DIR}
|
2021-10-27 19:50:07 +05:00
|
|
|
CMAKE_ARGS
|
|
|
|
-DUSE_SUPERBUILD=OFF
|
|
|
|
${NETGEN_CMAKE_ARGS}
|
|
|
|
${SUBPROJECT_CMAKE_ARGS}
|
|
|
|
-DCMAKE_PREFIX_PATH=${NETGEN_CMAKE_PREFIX_PATH_ALT_SEP}
|
2016-12-22 23:12:11 +05:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/netgen
|
2017-01-10 16:39:12 +05:00
|
|
|
BUILD_COMMAND ${NETGEN_BUILD_COMMAND}
|
2016-12-22 23:12:11 +05:00
|
|
|
STEP_TARGETS build
|
|
|
|
)
|
|
|
|
|
2017-01-20 14:16:48 +05:00
|
|
|
# Check if the git submodules (i.e. pybind11) are up to date
|
|
|
|
# in case, something is wrong, emit a warning but continue
|
|
|
|
ExternalProject_Add_Step(netgen check_submodules
|
2017-05-30 00:19:34 +05:00
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_submodules.cmake
|
2017-01-20 14:16:48 +05:00
|
|
|
DEPENDERS install # Steps on which this step depends
|
|
|
|
)
|
|
|
|
|
|
|
|
# Due to 'ALWAYS 1', this step is always run which also forces a build of
|
|
|
|
# the Netgen subproject
|
|
|
|
ExternalProject_Add_Step(netgen check_submodules1
|
2017-05-30 00:19:34 +05:00
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_submodules.cmake
|
2017-01-20 14:16:48 +05:00
|
|
|
DEPENDEES configure # Steps on which this step depends
|
|
|
|
DEPENDERS build # Steps that depend on this step
|
|
|
|
ALWAYS 1 # No stamp file, step always runs
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-12-10 22:01:44 +05:00
|
|
|
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build . --target install --config ${CMAKE_BUILD_TYPE} WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/netgen\")")
|
2016-12-22 23:12:11 +05:00
|
|
|
|
|
|
|
add_custom_target(test_netgen
|
|
|
|
${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/netgen
|
|
|
|
--target test
|
|
|
|
--config ${CMAKE_BUILD_TYPE}
|
|
|
|
)
|