1- cmake_minimum_required (VERSION 3.13 )
1+ cmake_minimum_required (VERSION 3.18 )
22
33option (BUILD_PYTHON "Build the python module for the library" ON )
44option (USE_SPHINX "Use sphinx for documentation" OFF )
55option (BUILD_SHARED_LIBS "Build shared libraries" ON )
66
77# By default, build in Release mode. Must appear before project() command
8- set ( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" )
8+ set ( CMAKE_BUILD_TYPE Release CACHE STRING "Build type" )
99
1010project (otvine)
1111
@@ -14,25 +14,11 @@ string (TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_NAME)
1414# set module dir to find custom scripts
1515list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} /cmake)
1616
17- if (POLICY CMP0042)
18- # MACOSX_RPATH is enabled by default
19- cmake_policy (SET CMP0042 NEW)
20- endif ()
21- if (POLICY CMP0078)
22- # UseSWIG generates standard target names
23- cmake_policy (SET CMP0078 NEW)
24- endif ()
25- if (POLICY CMP0086)
26- # UseSWIG honors SWIG_MODULE_NAME via -module flag
27- cmake_policy (SET CMP0086 NEW)
28- endif ()
29-
3017find_package (OpenTURNS CONFIG REQUIRED)
3118message (STATUS "Found OpenTURNS: ${OPENTURNS_ROOT_DIR} (found version \" ${OPENTURNS_VERSION_STRING} \" )" )
3219
33- find_package (vinecopulib CONFIG REQUIRED)
34-
35- find_package (Eigen3 CONFIG REQUIRED)
20+ find_package (vinecopulib 0.7.1 CONFIG REQUIRED)
21+ message (STATUS "Found vinecopulib: ${vinecopulib_DIR} (found version \" ${vinecopulib_VERSION} \" )" )
3622
3723if (NOT BUILD_SHARED_LIBS )
3824 list ( APPEND OTVINE_DEFINITIONS "-DOTVINE_STATIC" )
@@ -54,21 +40,20 @@ set (OTVINE_CONFIG_CMAKE_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/otvine)
5440set (OTVINE_DOC_PATH ${CMAKE_INSTALL_DOCDIR} )
5541
5642if (BUILD_PYTHON)
57- find_package (SWIG 3 )
43+ find_package (SWIG 4 )
5844 include (${SWIG_USE_FILE} )
5945
60- if (CMAKE_VERSION VERSION_LESS 3.28)
61- find_package (Python 3.6 COMPONENTS Interpreter Development)
46+ option (USE_PYTHON_SABI "Use Python stable ABI" OFF )
47+ if (USE_PYTHON_SABI AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.26)
48+ find_package (Python 3.6 COMPONENTS Interpreter Development.SABIModule)
49+ add_library (Python::Module ALIAS Python::SABIModule)
6250 else ()
63- find_package (Python 3.6 COMPONENTS Interpreter Development.Module Development.SABIModule )
51+ find_package (Python 3.6 COMPONENTS Interpreter Development.Module)
6452 endif ()
6553
6654 if (Python_FOUND)
6755 include (FindPythonModule)
6856 find_python_module (matplotlib)
69- if (NOT TARGET Python::Module)
70- include (TargetLinkLibrariesWithDynamicLookup)
71- endif ()
7257
7358 if (USE_SPHINX)
7459 find_program (SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx Documentation Builder (sphinx-doc.org)" )
0 commit comments