diff --git a/rascaline-c-api/CMakeLists.txt b/rascaline-c-api/CMakeLists.txt index 0e887dfd8..041d6c467 100644 --- a/rascaline-c-api/CMakeLists.txt +++ b/rascaline-c-api/CMakeLists.txt @@ -60,7 +60,7 @@ set(RUST_BUILD_TARGET "" CACHE STRING "Cross-compilation target for rust code. L set(EXTRA_RUST_FLAGS "" CACHE STRING "Flags used to build rust code") mark_as_advanced(RUST_BUILD_TARGET EXTRA_RUST_FLAGS) -option(RASCALINE_ENABLE_CHEMFILES "Disable the usage of chemfiles for reading structures from files" ON) +option(RASCALINE_ENABLE_CHEMFILES "Enable the usage of chemfiles for reading structures from files" OFF) option(RASCALINE_FETCH_EQUISTORE "Download and build the equistore C API before building rascaline" OFF) set(CMAKE_MACOSX_RPATH ON) diff --git a/rascaline-c-api/tests/CMakeLists.txt b/rascaline-c-api/tests/CMakeLists.txt index 782901d82..02be53b03 100644 --- a/rascaline-c-api/tests/CMakeLists.txt +++ b/rascaline-c-api/tests/CMakeLists.txt @@ -49,6 +49,7 @@ else() string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE) endif() +set(RASCALINE_ENABLE_CHEMFILES ON) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/rascaline) diff --git a/rascaline/src/systems/chemfiles.rs b/rascaline/src/systems/chemfiles.rs index a3f7dbd1f..cc19e9153 100644 --- a/rascaline/src/systems/chemfiles.rs +++ b/rascaline/src/systems/chemfiles.rs @@ -73,7 +73,8 @@ pub fn read_from_file(path: impl AsRef) -> Result, Error #[cfg(not(feature = "chemfiles"))] pub fn read_from_file(_: impl AsRef) -> Result, Error> { Err(Error::Chemfiles( - "read_from_file is only available with the chemfiles feature enabled".into() + "read_from_file is only available with the chemfiles feature enabled \ + (RASCALINE_ENABLE_CHEMFILES=ON in CMake)".into() )) }