Skip to content

Commit

Permalink
Replace XHCFF in build system by libpvol
Browse files Browse the repository at this point in the history
  • Loading branch information
pprcht committed Jan 24, 2025
1 parent fc552c1 commit 60ba7d2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ if(NOT TARGET "gfn0::gfn0" AND WITH_GFN0)
add_compile_definitions(WITH_GFN0)
endif()

# XHCFF
if(NOT TARGET "xhcff::xhcff" AND WITH_XHCFF)
find_package("xhcff" REQUIRED)
add_compile_definitions(WITH_XHCFF)
# libpvol
if(NOT TARGET "libpvol::libpvol" AND WITH_LIBPVOL)
find_package("libpvol" REQUIRED)
add_compile_definitions(WITH_LIBPVOL)
endif()

# lwONIOM
Expand Down
2 changes: 1 addition & 1 deletion assets/template/metadata.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
character(len=*),parameter :: gfn0var = "@gfn0var@"
character(len=*),parameter :: gfnffvar = "@gfnffvar@"
character(len=*),parameter :: tblitevar = "@tblitevar@"
character(len=*),parameter :: xhcffvar = "@xhcffvar@"
character(len=*),parameter :: xhcffvar = "@libpvolvar@"
character(len=*),parameter :: lwoniomvar = "@lwoniomvar@"
7 changes: 4 additions & 3 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ option(WITH_TBLITE "Enable support for tblite" TRUE)
option(WITH_TOMLF "Enable support for toml-f" TRUE)
option(WITH_GFN0 "Enable support for GFN0-xTB" TRUE)
option(WITH_GFNFF "Enable support for GFN-FF" TRUE)
option(WITH_XHCFF "Enable support for XHCFF" FALSE)
option(WITH_LIBPVOL "Enable support for LIBPVOL" FALSE)
option(WITH_LWONIOM "Enable support for lwONIOM" TRUE)
option(WITH_TESTS "Enable unit tests" TRUE)

option(STATICBUILD "Attempt to link everything statically" FALSE) # doesn't work yet
option(STATICBUILD "Attempt to link everything statically" FALSE)
set(PYTHON_BINDINGS OFF CACHE BOOL "Disable python bindings for submodules that have them" FORCE)

#########################################################################################
#########################################################################################
Expand Down Expand Up @@ -100,7 +101,7 @@ set(tomlfvar "${WITH_TOMLF}")
set(gfn0var "${WITH_GFN0}")
set(gfnffvar "${WITH_GFNFF}")
set(tblitevar "${WITH_TBLITE}")
set(xhcffvar "${WITH_XHCFF}")
set(libpvolvar "${WITH_LIBPVOL}")
set(lwoniomvar "${WITH_LWONIOM}")

configure_file(
Expand Down
16 changes: 8 additions & 8 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ if get_option('WITH_GFNFF')
endif


# XHCFF
if get_option('WITH_XHCFF')
add_project_arguments('-DWITH_XHCFF', language: 'fortran')
xhcff_dep = dependency(
'xhcff',
fallback: ['xhcff', 'xhcfflib_dep'],
# LIBPVOL
if get_option('WITH_LIBPVOL')
add_project_arguments('-DWITH_LIBPVOL', language: 'fortran')
libpvol_dep = dependency(
'libpvol',
fallback: ['libpvol', 'libpvollib_dep'],
default_options: ['default_library=static'],
)
exe_deps += xhcff_dep
exe_deps += libpvol_dep
endif


Expand Down Expand Up @@ -292,7 +292,7 @@ config = configuration_data({
'gfn0var': get_option('WITH_GFN0'),
'gfnffvar': get_option('WITH_GFNFF'),
'tblitevar': get_option('WITH_TBLITE'),
'xhcffvar': get_option('WITH_XHCFF'),
'libpvolvar': get_option('WITH_LIBPVOL'),
'lwoniomvar': get_option('WITH_LWONIOM'),
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# You should have received a copy of the GNU Lesser General Public License
# along with crest. If not, see <https://www.gnu.org/licenses/>.

set(_lib "xhcff")
set(_pkg "XHCFF")
set(_url "https://github.com/zellerf/xhcff-lib")
set(_lib "libpvol")
set(_pkg "LIBPVOL")
set(_url "https://github.com/neudecker-group/libpvol.git")

if(NOT DEFINED "${_pkg}_FIND_METHOD")
set("${_pkg}_FIND_METHOD" "subproject" "cmake" "fetch" "pkgconf" )
Expand All @@ -27,10 +27,10 @@ include("${CMAKE_CURRENT_LIST_DIR}/crest-utils.cmake")
crest_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}")

set(found FALSE)
if(TARGET "xhcff::xhcff")
if(TARGET "libpvol::libpvol")
set (found TRUE)
endif()
message(STATUS "Found xhcff: ${found}")
message(STATUS "Found libpvol: ${found}")

unset(_lib)
unset(_pkg)
Expand Down
4 changes: 2 additions & 2 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ option(
description: 'build with toml-f integration',
)
option(
'WITH_XHCFF',
'WITH_LIBPVOL',
type: 'boolean',
value: false,
description: 'build with XHCFF integration',
description: 'build with libpvol integration',
)

option(
Expand Down

0 comments on commit 60ba7d2

Please sign in to comment.