All modifications that have been made in april 2026 tu compile upm
with latest version of cmake, C++, C, python3 and last java version. It has not been possible to reach a successfull compilation with node and cordova. Most of the modifications are workarouds because the software requires an heavy revision from a tue dev whom I am not. Modifications qui seront validées : modifié : CMakeLists.txt modifié : cmake/modules/FindNode.cmake modifié : cmake/modules/FindNpm.cmake modifié : cmake/modules/OpenCVDetectPython.cmake nouveau fichier : cmake/modules/OpenCVDetectPython.oldcmake modifié : include/upm_types.h modifié : src/CMakeLists.txt modifié : src/ehr/ehr.cxx supprimé : src/hp20x/CMakeLists.txt supprimé : src/hp20x/hp20x.cxx supprimé : src/hp20x/hp20x.hpp supprimé : src/hp20x/hp20x.json
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required (VERSION 2.8.11)
|
||||
cmake_minimum_required (VERSION 4.0)
|
||||
project (upm)
|
||||
|
||||
# Before going any further, define build options
|
||||
@@ -6,13 +6,13 @@ option (BUILDDOC "Build all doc" OFF)
|
||||
option (BUILDCPP "Build CPP sensor libraries" ON)
|
||||
option (BUILDFTI "Build Funtion Table Interface (FTI) in C sensor libraries" OFF)
|
||||
option (BUILDSWIGPYTHON "Build swig python modules" ON)
|
||||
option (BUILDSWIGNODE "Build swig node modules" ON)
|
||||
option (BUILDSWIGJAVA "Build swig java modules" OFF)
|
||||
option (BUILDSWIGNODE "Build swig node modules" OFF)
|
||||
option (BUILDSWIGJAVA "Build swig java modules" ON)
|
||||
option (BUILDCORDOVA "Build cordova bindings" OFF)
|
||||
option (BUILDEXAMPLES "Build C/C++/JAVA examples" OFF)
|
||||
option (BUILDEXAMPLES "Build C/C++/JAVA examples" ON)
|
||||
option (NPM "Generate NPM/GYP tarballs" OFF)
|
||||
option (BUILDTESTS "Generate check-ups for upm" OFF)
|
||||
option (WERROR "Make all warnings into errors." ON)
|
||||
option (BUILDTESTS "Generate check-ups for upm" ON)
|
||||
option (WERROR "Make all warnings into errors." OFF)
|
||||
|
||||
# Warn if building in source root
|
||||
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
@@ -189,7 +189,8 @@ endif (BUILDCORDOVA)
|
||||
|
||||
# Find swig if any wrapper is enabled
|
||||
if (BUILDSWIGPYTHON OR BUILDSWIGNODE OR BUILDSWIGJAVA)
|
||||
find_package (SWIG 3.0.5 REQUIRED)
|
||||
# find_package (SWIG 3.0.5 REQUIRED)
|
||||
find_package (SWIG 4.4.1 REQUIRED)
|
||||
include (${SWIG_USE_FILE})
|
||||
endif ()
|
||||
|
||||
@@ -202,29 +203,30 @@ if (BUILDSWIGPYTHON OR BUILDTESTS)
|
||||
include (cmake/modules/OpenCVDetectPython.cmake)
|
||||
|
||||
# Fail if building tests but no python interpreter was found
|
||||
if (BUILDTESTS AND NOT PYTHON2INTERP_FOUND)
|
||||
if (BUILDTESTS AND NOT Python3_FOUND)
|
||||
message(FATAL_ERROR "BUILDTESTS=ON requires the python2 interpreter")
|
||||
endif (BUILDTESTS AND NOT PYTHON2INTERP_FOUND)
|
||||
endif (BUILDTESTS AND NOT Python3_FOUND)
|
||||
|
||||
# Fail if no LIBS were found
|
||||
if (NOT PYTHON2LIBS_FOUND AND NOT PYTHON3LIBS_FOUND)
|
||||
#if (NOT PYTHON2LIBS_FOUND AND NOT Python3_FOUND)
|
||||
if (NOT PYTHON2LIBS_FOUND AND NOT Python_LIBRARIES)
|
||||
message(FATAL_ERROR "At least one python lib is required")
|
||||
endif (NOT PYTHON2LIBS_FOUND AND NOT PYTHON3LIBS_FOUND)
|
||||
endif (NOT PYTHON2LIBS_FOUND AND NOT Python_LIBRARIES)
|
||||
endif (BUILDSWIGPYTHON OR BUILDTESTS)
|
||||
|
||||
# Which versions of python were found?
|
||||
if (PYTHON2LIBS_FOUND AND BUILDSWIGPYTHON)
|
||||
message(STATUS "Building python2 modules with python-${PYTHON2LIBS_VERSION_STRING}")
|
||||
endif (PYTHON2LIBS_FOUND AND BUILDSWIGPYTHON)
|
||||
if (PYTHON3LIBS_FOUND AND BUILDSWIGPYTHON)
|
||||
message(STATUS "Building python3 modules with python-${PYTHON3LIBS_VERSION_STRING}")
|
||||
endif (PYTHON3LIBS_FOUND AND BUILDSWIGPYTHON)
|
||||
if (Python3_FOUND AND BUILDSWIGPYTHON)
|
||||
message(STATUS "Building python3 modules with python-${Python_VERSION}")
|
||||
endif (Python3_FOUND AND BUILDSWIGPYTHON)
|
||||
|
||||
# Python2 is currently required for python documentation
|
||||
if (BUILDSWIGPYTHON AND BUILDDOC AND NOT PYTHON2INTERP_FOUND)
|
||||
message(FATAL_ERROR "Failed to find python2 interpreter which is required "
|
||||
"to build python documentation.")
|
||||
endif (BUILDSWIGPYTHON AND BUILDDOC AND NOT PYTHON2INTERP_FOUND)
|
||||
#if (BUILDSWIGPYTHON AND BUILDDOC AND NOT PYTHON2INTERP_FOUND)
|
||||
# message(FATAL_ERROR "Failed to find python2 interpreter which is required "
|
||||
# "to build python documentation.")
|
||||
#endif (BUILDSWIGPYTHON AND BUILDDOC AND NOT PYTHON2INTERP_FOUND)
|
||||
|
||||
# Set CMAKE_INSTALL_LIBDIR if not defined
|
||||
include(GNUInstallDirs)
|
||||
@@ -261,33 +263,33 @@ set (upm_VERSION_STRING ${upm_VERSION_MAJOR}.${upm_VERSION_MINOR}.${upm_VERSION_
|
||||
# enable c++11 standards support unconditionally
|
||||
include(CheckCXXCompilerFlag)
|
||||
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++23" COMPILER_SUPPORTS_CXX23)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
||||
if (COMPILER_SUPPORTS_CXX11)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
if (COMPILER_SUPPORTS_CXX23)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++23")
|
||||
elseif (COMPILER_SUPPORTS_CXX0X)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
else()
|
||||
message(FATAL_ERROR "A C++11 compliant compiler is required to build UPM.")
|
||||
message(FATAL_ERROR "A C++23 compliant compiler is required to build UPM.")
|
||||
endif()
|
||||
else()
|
||||
# 3.1+ uses this generic method to enable c++11
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
# 3.1+ uses this generic method to enable c++23
|
||||
set (CMAKE_CXX_STANDARD 23)
|
||||
set (CXX_STANDARD_REQUIRED ON)
|
||||
set (CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||
CHECK_C_COMPILER_FLAG("-std=c11" COMPILER_SUPPORTS_C11)
|
||||
if (COMPILER_SUPPORTS_C11)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
|
||||
CHECK_C_COMPILER_FLAG("-std=c23" COMPILER_SUPPORTS_C23)
|
||||
if (COMPILER_SUPPORTS_C23)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c23")
|
||||
else()
|
||||
message(FATAL_ERROR "A C11 compliant C compiler is required to build UPM.")
|
||||
message(FATAL_ERROR "A C23 compliant C compiler is required to build UPM.")
|
||||
endif()
|
||||
else()
|
||||
# 3.1+ uses this generic method to enable c11
|
||||
set (CMAKE_C_STANDARD 11)
|
||||
# 3.1+ uses this generic method to enable c23
|
||||
set (CMAKE_C_STANDARD 23)
|
||||
set (C_STANDARD_REQUIRED ON)
|
||||
set (C_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user