From 29a97249671490b0f88731b3fa894a1db9a7b44f Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 5 Jun 2024 09:24:32 -0700 Subject: [PATCH] Remove CMake modules that are not used in RMF --- cmake_modules/CheckCompiles.cmake | 28 --------- cmake_modules/FindCGAL.cmake | 99 ------------------------------- cmake_modules/FindEigen3.cmake | 81 ------------------------- cmake_modules/FindOpenMP3.cmake | 21 ------- cmake_modules/FindRMF.cmake | 44 -------------- cmake_modules/InstallDeref.cmake | 23 ------- 6 files changed, 296 deletions(-) delete mode 100644 cmake_modules/CheckCompiles.cmake delete mode 100644 cmake_modules/FindCGAL.cmake delete mode 100644 cmake_modules/FindEigen3.cmake delete mode 100644 cmake_modules/FindOpenMP3.cmake delete mode 100644 cmake_modules/FindRMF.cmake delete mode 100644 cmake_modules/InstallDeref.cmake diff --git a/cmake_modules/CheckCompiles.cmake b/cmake_modules/CheckCompiles.cmake deleted file mode 100644 index 457868f5..00000000 --- a/cmake_modules/CheckCompiles.cmake +++ /dev/null @@ -1,28 +0,0 @@ -include(CheckCXXSourceCompiles) -function(check_compiles name pkgname ucpkgname includes include_dir link_libs result) - #message(STATUS "Trying to compile ${pkgname} searching in ${include_dir} ${link_libs}") - set(CMAKE_REQUIRED_LIBRARIES ${link_libs}) - set(CMAKE_REQUIRED_INCLUDES ${include_dir}) - set(mybody "${includes} -int main(int,char*[]) { - ${CHECK_COMPILES_BODY} - return 0; -}") - set(${pkgname}) - check_cxx_source_compiles("${mybody}" "${pkgname}${name}") - if ("${${pkgname}${name}}" MATCHES "1") - #message(STATUS "Compiled ok") - set(${ucpkgname}_INCLUDE_PATH ${include_dir} CACHE INTERNAL "" FORCE) - foreach(l ${link_libs}) - set(${ucpkgname}_LIBRARIES ${${ucpkgname}_LIBRARIES} ${l} CACHE INTERNAL "" FORCE) - endforeach() - file(WRITE "${CMAKE_BINARY_DIR}/build_info/${pkgname}" "ok=True -includepath=\"${${pkgname}_INCLUDE_PATH}\" -swigpath=\"${${pkgname}_SWIG_PATH}\" -libpath=\"${${pkgname}_LIB_PATH}\" -") - set(${result} "1" PARENT_SCOPE) - else() - set(${result} "0" PARENT_SCOPE) - endif() -endfunction(check_compiles) diff --git a/cmake_modules/FindCGAL.cmake b/cmake_modules/FindCGAL.cmake deleted file mode 100644 index 0471b8dd..00000000 --- a/cmake_modules/FindCGAL.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# -# The following module is based on FindVTK.cmake -# - -# - Find a CGAL installation or binary tree. -# The following variables are set if CGAL is found. If CGAL is not -# found, CGAL_FOUND is set to false. -# -# CGAL_FOUND - Set to true when CGAL is found. -# CGAL_USE_FILE - CMake file to use CGAL. -# - -# Construct consistent error messages for use below. -set(CGAL_DIR_DESCRIPTION "directory containing CGALConfig.cmake. This is either the binary directory where CGAL was configured or PREFIX/lib/CGAL for an installation.") -set(CGAL_DIR_MESSAGE "CGAL not found. Set the CGAL_DIR cmake variable or environment variable to the ${CGAL_DIR_DESCRIPTION}") - -set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) - -if ( NOT CGAL_DIR ) - - # Get the system search path as a list. - if(UNIX) - string(REGEX MATCHALL "[^:]+" CGAL_DIR_SEARCH1 "$ENV{PATH}") - else() - string(REGEX REPLACE "\\\\" "/" CGAL_DIR_SEARCH1 "$ENV{PATH}") - endif() - - string(REGEX REPLACE "/;" ";" CGAL_DIR_SEARCH2 "${CGAL_DIR_SEARCH1}") - - # Construct a set of paths relative to the system search path. - set(CGAL_DIR_SEARCH "") - - foreach(dir ${CGAL_DIR_SEARCH2}) - - set(CGAL_DIR_SEARCH ${CGAL_DIR_SEARCH} ${dir}/../lib/CGAL ) - - endforeach() - - - # - # Look for an installation or build tree. - # - find_path(CGAL_DIR CGALConfig.cmake - - # Look for an environment variable CGAL_DIR. - $ENV{CGAL_DIR} - - # Look in places relative to the system executable search path. - ${CGAL_DIR_SEARCH} - - # Look in standard UNIX install locations. - /usr/local/lib/CGAL - /usr/local/lib/cmake/CGAL - /usr/lib64/CGAL - /usr/lib64/cmake/CGAL - /usr/lib/CGAL - /usr/lib/cmake/CGAL - /usr/local/share/CGAL/cmake - /usr/share/CGAL/cmake - /usr/share/cmake/CGAL - /opt/homebrew/lib/cmake/CGAL - - # Read from the CMakeSetup registry entries. It is likely that - # CGAL will have been recently built. - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9] - [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10] - - # Help the user find it if we cannot. - DOC "The ${CGAL_DIR_DESCRIPTION}" - ) - -endif() - -if ( CGAL_DIR ) - - if ( EXISTS "${CGAL_DIR}/CGALConfig.cmake" ) - include( "${CGAL_DIR}/CGALConfig.cmake" ) - set( CGAL_FOUND TRUE ) - endif() - -endif() - -if( NOT CGAL_FOUND) - if(CGAL_FIND_REQUIRED) - MESSAGE(FATAL_ERROR ${CGAL_DIR_MESSAGE}) - else() - if(NOT CGAL_FIND_QUIETLY) - MESSAGE(STATUS ${CGAL_DIR_MESSAGE}) - endif() - endif() -endif() diff --git a/cmake_modules/FindEigen3.cmake b/cmake_modules/FindEigen3.cmake deleted file mode 100644 index 9c546a05..00000000 --- a/cmake_modules/FindEigen3.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# - Try to find Eigen3 lib -# -# This module supports requiring a minimum version, e.g. you can do -# find_package(Eigen3 3.1.2) -# to require version 3.1.2 or newer of Eigen3. -# -# Once done this will define -# -# EIGEN3_FOUND - system has eigen lib with correct version -# EIGEN3_INCLUDE_DIR - the eigen include directory -# EIGEN3_VERSION - eigen version - -# Copyright (c) 2006, 2007 Montel Laurent, -# Copyright (c) 2008, 2009 Gael Guennebaud, -# Copyright (c) 2009 Benoit Jacob -# Redistribution and use is allowed according to the terms of the 2-clause BSD license. - -if(NOT Eigen3_FIND_VERSION) - if(NOT Eigen3_FIND_VERSION_MAJOR) - set(Eigen3_FIND_VERSION_MAJOR 2) - endif(NOT Eigen3_FIND_VERSION_MAJOR) - if(NOT Eigen3_FIND_VERSION_MINOR) - set(Eigen3_FIND_VERSION_MINOR 91) - endif(NOT Eigen3_FIND_VERSION_MINOR) - if(NOT Eigen3_FIND_VERSION_PATCH) - set(Eigen3_FIND_VERSION_PATCH 0) - endif(NOT Eigen3_FIND_VERSION_PATCH) - - set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") -endif(NOT Eigen3_FIND_VERSION) - -macro(_eigen3_check_version) - file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) - - string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") - set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") - set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") - set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") - - set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) - if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) - set(EIGEN3_VERSION_OK FALSE) - else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) - set(EIGEN3_VERSION_OK TRUE) - endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) - - if(NOT EIGEN3_VERSION_OK) - - message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " - "but at least version ${Eigen3_FIND_VERSION} is required") - endif(NOT EIGEN3_VERSION_OK) -endmacro(_eigen3_check_version) - -if (EIGEN3_INCLUDE_DIR) - - # in cache already - _eigen3_check_version() - set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) - -else (EIGEN3_INCLUDE_DIR) - - find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library - PATHS - ${CMAKE_INSTALL_PREFIX}/include - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen3 eigen - ) - - if(EIGEN3_INCLUDE_DIR) - _eigen3_check_version() - endif(EIGEN3_INCLUDE_DIR) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) - - mark_as_advanced(EIGEN3_INCLUDE_DIR) - -endif(EIGEN3_INCLUDE_DIR) - diff --git a/cmake_modules/FindOpenMP3.cmake b/cmake_modules/FindOpenMP3.cmake deleted file mode 100644 index 0fd92e77..00000000 --- a/cmake_modules/FindOpenMP3.cmake +++ /dev/null @@ -1,21 +0,0 @@ -find_package(OpenMP) -if (OPENMP_FOUND) - set(CMAKE_REQUIRED_FLAGS ${OpenMP_CXX_FLAGS}) - set(mybody "#include -int main() { -omp_sched_t kind; -int chunk_size; -omp_get_schedule(&kind, &chunk_size); -return chunk_size; -}") - - check_cxx_source_compiles("${mybody}" OpenMP3) - set(CMAKE_REQUIRED_FLAGS ) - if ("${OpenMP3}" MATCHES "1") - message(STATUS "OpenMP 3 is supported and will be used") - else() - message(STATUS "OpenMP 3 not supported - will not be used") - set(OpenMP_CXX_FLAGS "" CACHE STRING "OpenMP flags" FORCE) - set(OPENMP_FOUND FALSE) - endif() -endif() diff --git a/cmake_modules/FindRMF.cmake b/cmake_modules/FindRMF.cmake deleted file mode 100644 index 2c87be14..00000000 --- a/cmake_modules/FindRMF.cmake +++ /dev/null @@ -1,44 +0,0 @@ -#[=======================================================================[.rst: -FindRMF -------- - -Try to find RMF - -Result Variables -^^^^^^^^^^^^^^^^ - -This module defines the following variables: - -``RMF_FOUND`` - system has RMF -``RMF_INCLUDE_PATH`` - the RMF include directory -``RMF_SWIG_PATH`` - the directory containing SWIG (.i) files for RMF -``RMF_LIBRARY`` - Link this to use RMF -``RMF_VERSION_STRING`` - the version of RMF found - - -#]=======================================================================] - - -find_path(RMF_INCLUDE_PATH RMF.h PATH_SUFFIXES include) -find_path(RMF_SWIG_PATH RMF.i PATH_SUFFIXES share/RMF/swig) -if (NOT RMF_LIBRARY) - find_library(RMF_LIBRARY NAMES RMF PATH_SUFFIXES lib) -endif() - -if (RMF_INCLUDE_PATH AND EXISTS "${RMF_INCLUDE_PATH}/RMF/config.h") - file(STRINGS "${RMF_INCLUDE_PATH}/RMF/config.h" RMF_MAJOR_H REGEX "#define RMF_VERSION_MAJOR +([0-9]+)") - file(STRINGS "${RMF_INCLUDE_PATH}/RMF/config.h" RMF_MINOR_H REGEX "#define RMF_VERSION_MINOR +([0-9]+)") - string(REGEX REPLACE " *#define RMF_VERSION_MAJOR +([0-9]+) *" "\\1" RMF_VERSION_MAJOR "${RMF_MAJOR_H}") - string(REGEX REPLACE " *#define RMF_VERSION_MINOR +([0-9]+) *" "\\1" RMF_VERSION_MINOR "${RMF_MINOR_H}") - set(RMF_VERSION_STRING "${RMF_VERSION_MAJOR}.${RMF_VERSION_MINOR}") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(RMF - REQUIRED_VARS RMF_LIBRARY RMF_INCLUDE_PATH RMF_SWIG_PATH - VERSION_VAR RMF_VERSION_STRING) diff --git a/cmake_modules/InstallDeref.cmake b/cmake_modules/InstallDeref.cmake deleted file mode 100644 index d5303c47..00000000 --- a/cmake_modules/InstallDeref.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Similar to INSTALL(DIRECTORY, ...) except that any symlinks in the -# hierarchy are dereferenced -function(install_deref src pattern dest) - file(GLOB_RECURSE relfiles RELATIVE ${src} FOLLOW_SYMLINKS ${src}/${pattern}) - foreach(relfile ${relfiles}) - get_filename_component(subdir ${relfile} PATH) - get_filename_component(fileext ${relfile} EXT) - get_filename_component(filename ${relfile} NAME) - get_filename_component(realfile "${src}/${relfile}" REALPATH) - # If we hit a directory, this must be a symlink; recurse into the - # linked-to directory - if(IS_DIRECTORY ${realfile}) - install_deref("${src}/${relfile}" ${pattern} "${dest}/${relfile}") - # Don't install .pyc (compiled Python) files, scons control files, - # or source control files - elseif(NOT "${fileext}" STREQUAL ".pyc" - AND NOT "${filename}" STREQUAL "SConscript" - AND NOT "${realfile}" MATCHES "\\.svn") - install(FILES ${realfile} RENAME ${filename} - DESTINATION "${dest}/${subdir}") - endif() - endforeach(relfile) -endfunction(install_deref)