Salome HOME
Ensure cmake_build_type is used in SALOME 9.12.0
[tools/sat_salome.git] / products / patches / openturns-1.21.0002.patch
1 --- openturns_ref/openturns-1.21/CMakeLists.txt 2023-09-22 12:27:24.290521494 +0200
2 +++ openturns_dev/openturns-1.21/CMakeLists.txt 2023-09-22 12:26:48.691883507 +0200
3 @@ -125,9 +125,17 @@
4  
5  set (CMAKE_CXX_STANDARD 11)
6  
7 +SET(LAPACK_ROOT_DIR $ENV{LAPACK_ROOT_DIR})
8 +IF(LAPACK_ROOT_DIR)
9 +  LIST(APPEND CMAKE_PREFIX_PATH "${LAPACK_ROOT_DIR}")
10 +ENDIF(LAPACK_ROOT_DIR)
11  if (NOT DEFINED LAPACK_LIBRARIES)
12    find_package (LAPACK REQUIRED)
13  endif ()
14 +IF (DEFINED CBLAS_LIBRARIES)
15 +  MESSAGE(STATUS "CBLAS_LIBRARIES is defined... adding to the list of libraries ${CBLAS_LIBRARIES}")
16 +  LIST (APPEND OPENTURNS_PRIVATE_LIBRARIES ${CBLAS_LIBRARIES})
17 +ENDIF()
18  list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${LAPACK_LIBRARIES})
19  
20  if (USE_SPECTRA)
21 @@ -181,6 +189,10 @@
22  endif ()
23  
24  if (USE_TBB)
25 +  SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR})
26 +  if(TBB_ROOT_DIR)
27 +    LIST(APPEND CMAKE_PREFIX_PATH "${TBB_ROOT_DIR}")
28 +  endif(TBB_ROOT_DIR)
29    find_package (TBB CONFIG)
30    if (TBB_FOUND)
31      message (STATUS "Found TBB: ${TBB_DIR} (found version ${TBB_VERSION})")
32 @@ -235,6 +247,10 @@
33  endif ()
34  
35  if (USE_LIBXML2)
36 +  SET(LIBXML2_ROOT_DIR $ENV{LIBXLM2_ROOT_DIR})
37 +  if(LIBXML2_ROOT_DIR)
38 +    LIST(APPEND CMAKE_PREFIX_PATH "${LIBXML2_ROOT_DIR}")
39 +  endif(LIBXML2_ROOT_DIR)
40    find_package (LibXml2)
41  endif ()
42  if (LIBXML2_FOUND)
43 @@ -245,7 +261,19 @@
44    list (APPEND OPENTURNS_ENABLED_FEATURES "libxml2")
45  endif ()
46  
47 +SET(MPI_ROOT_DIR $ENV{MPI_ROOT_DIR} CACHE PATH "Path to the MPI.")
48 +IF(MPI_ROOT_DIR)
49 +  LIST(APPEND CMAKE_PREFIX_PATH "${MPI_ROOT_DIR}")
50 +  find_package(MPI)
51 +  list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${MPI_INCLUDE_DIRS})
52 +  list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPI_LIBRARIES})
53 +ENDIF(MPI_ROOT_DIR)
54 +
55  if (USE_HDF5)
56 +  SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to the HDF5.")
57 +  IF(HDF5_ROOT_DIR)
58 +    LIST(APPEND CMAKE_PREFIX_PATH "${HDF5_ROOT_DIR}")
59 +  ENDIF(HDF5_ROOT_DIR)
60    find_package(HDF5 COMPONENTS C CXX)
61  endif ()
62  if (HDF5_FOUND)
63 @@ -288,7 +316,13 @@
64  endif ()
65  
66  if (USE_NLOPT)
67 -  find_package (NLopt CONFIG QUIET)
68 +  SET(NLOPT_ROOT_DIR $ENV{NLOPT_ROOT_DIR} CACHE PATH "Path to the NLOPT.")
69 +  IF (NOT NLOPT_ROOT_DIR)
70 +    MESSAGE(FATAL "NLOPT_ROOT_DIR environment variable not found!")
71 +  ENDIF()
72 +  MESSAGE(STATUS "NLOPT_ROOT_DIR = ${NLOPT_ROOT_DIR}")
73 +  FIND_PACKAGE(NLopt
74 +               HINTS "${NLOPT_ROOT_DIR}/lib/cmake/nlopt")
75    if (NLopt_FOUND)
76      message(STATUS "Found NLopt: ${NLopt_DIR}  (found version \"${NLopt_VERSION}\")")
77    else ()