/usr/share/cmake/CheMPS2/CheMPS2Config.cmake is in libchemps2-dev 1.8.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | # CheMPS2Config.cmake
# ------------------
#
# CheMPS2 cmake module.
# This module sets the following variables in your project::
#
# CheMPS2_FOUND - true if CheMPS2 and all required components found on the system
# CheMPS2_VERSION - CheMPS2 version in format Major.Minor.Release
# CheMPS2_INCLUDE_DIRS - Directory where chemps2/DMRG.h header is located.
# CheMPS2_INCLUDE_DIR - same as DIRS
# CheMPS2_DEFINITIONS: Definitions necessary to use CheMPS2, namely USING_CheMPS2.
# CheMPS2_LIBRARIES - CheMPS2 library to link against.
# CheMPS2_LIBRARY - same as LIBRARIES
# CheMPS2_EXECUTABLE - path to CheMPS2 executable
#
#
# Available components: shared static exe ::
#
# shared - search for only shared library
# static - search for only static library
# exe - search for executable as well as library
#
#
# Exported targets::
#
# If CheMPS2 is found, this module defines the following :prop_tgt:`IMPORTED`
# target. ::
#
# CheMPS2::chemps2 - the main CheMPS2 library with header & defs attached.
#
#
# Suggested usage::
#
# find_package(CheMPS2)
# find_package(CheMPS2 1.8 CONFIG REQUIRED COMPONENTS shared)
#
#
# The following variables can be set to guide the search for this package::
#
# CheMPS2_DIR - CMake variable, set to directory containing this Config file
# CMAKE_PREFIX_PATH - CMake variable, set to root directory of this package
# PATH - environment variable, set to bin directory of this package
# CMAKE_DISABLE_FIND_PACKAGE_CheMPS2 - CMake variable, disables
# find_package(CheMPS2) perhaps to force internal build
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was CheMPS2Config.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
set(PN CheMPS2)
set (_valid_components
static
shared
exe
)
# find includes
unset(_temp_h CACHE)
find_path(_temp_h
NAMES chemps2/DMRG.h
PATHS ${PACKAGE_PREFIX_DIR}/include
NO_DEFAULT_PATH)
if(_temp_h)
set(${PN}_INCLUDE_DIR "${_temp_h}")
set(${PN}_INCLUDE_DIRS ${${PN}_INCLUDE_DIR})
else()
set(${PN}_FOUND 0)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "${PN}Config missing component: header (${PN}: ${_temp_h})")
endif()
endif()
# find executable
list(FIND ${PN}_FIND_COMPONENTS "exe" _seek_exe)
unset(_temp_exe CACHE)
find_program(_temp_exe
NAMES chemps2
PATHS ${PACKAGE_PREFIX_DIR}/bin
NO_DEFAULT_PATH)
if(_temp_exe)
set(${PN}_EXECUTABLE "{_temp_exe}")
if(_seek_exe GREATER -1)
set(${PN}_exe_FOUND 1)
endif()
else()
if(_seek_exe GREATER -1)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "${PN}Config missing component: executable (${PN}: ${_temp_exe})")
endif()
endif()
endif()
# find library: shared, static, or whichever
set(_hold_library_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
list(FIND ${PN}_FIND_COMPONENTS "shared" _seek_shared)
list(FIND ${PN}_FIND_COMPONENTS "static" _seek_static)
if(_seek_shared GREATER -1)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
elseif(_seek_static GREATER -1)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
unset(_temp CACHE)
find_library(_temp
NAMES chemps2
PATHS ${PACKAGE_PREFIX_DIR}/lib/x86_64-linux-gnu
NO_DEFAULT_PATH)
if(_temp)
set(${PN}_LIBRARY "${_temp}")
if(_seek_shared GREATER -1)
set(${PN}_shared_FOUND 1)
elseif(_seek_static GREATER -1)
set(${PN}_static_FOUND 1)
endif()
else()
if(_seek_shared GREATER -1)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "${PN}Config missing component: shared library (${PN}: ${_temp})")
endif()
elseif(_seek_static GREATER -1)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "${PN}Config missing component: static library (${PN}: ${_temp})")
endif()
else()
set(${PN}_FOUND 0)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "${PN}Config missing component: library (${PN}: ${_temp})")
endif()
endif()
endif()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_hold_library_suffixes})
set(${PN}_LIBRARIES ${${PN}_LIBRARY})
set(${PN}_DEFINITIONS USING_${PN})
check_required_components(${PN})
# make detectable the FindTarget*.cmake modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
#-----------------------------------------------------------------------------
# Don't include targets if this file is being picked up by another
# project which has already built this as a subproject
#-----------------------------------------------------------------------------
if(NOT TARGET ${PN}::chemps2)
get_filename_component(_fext ${${PN}_LIBRARY} EXT)
if(${_fext} STREQUAL ${CMAKE_SHARED_LIBRARY_SUFFIX})
include("${CMAKE_CURRENT_LIST_DIR}/${PN}Targets-shared.cmake")
else()
include("${CMAKE_CURRENT_LIST_DIR}/${PN}Targets-static.cmake")
endif()
include(CMakeFindDependencyMacro)
if(NOT TARGET tgt::hdf5)
find_dependency(TargetHDF5 1.10.0.1 EXACT)
endif()
endif()
|