Commit 858c967e by Maarten L. Hekkelman

Locate mmcif dictionary in CCP4 space

parent f9ca5de5
...@@ -70,6 +70,8 @@ if(BUILD_FOR_CCP4) ...@@ -70,6 +70,8 @@ if(BUILD_FOR_CCP4)
set(BUILD_SHARED_LIBS ON) set(BUILD_SHARED_LIBS ON)
endif() endif()
endif("$ENV{CCP4}" STREQUAL "" OR NOT EXISTS $ENV{CCP4}) endif("$ENV{CCP4}" STREQUAL "" OR NOT EXISTS $ENV{CCP4})
add_definitions(-DCCP4=1)
endif() endif()
# Check if CCP4 is available # Check if CCP4 is available
......
...@@ -1251,6 +1251,19 @@ std::unique_ptr<std::istream> loadResource(std::filesystem::path name) ...@@ -1251,6 +1251,19 @@ std::unique_ptr<std::istream> loadResource(std::filesystem::path name)
} }
#endif #endif
#if defined(CCP4) and CCP4
if (not result and not fs::exists(p))
{
const char* CCP4_DIR = getenv("CCP4");
if (CCP4_DIR != nullptr and fs::exists(CCP4_DIR))
{
auto p2 = fs::path(DATA_DIR) / p;
if (fs::exists(p2))
swap(p, p2);
}
}
#endif
if (not result and fs::exists(p)) if (not result and fs::exists(p))
{ {
std::unique_ptr<std::ifstream> file(new std::ifstream(p, std::ios::binary)); std::unique_ptr<std::ifstream> file(new std::ifstream(p, std::ios::binary));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment