From e73e5ad6bd9d190a61f08932e74a8f9ca4abdf3f Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 2 Feb 2024 23:39:02 -0500 Subject: [PATCH] gmx: fix include directive (#3221) Fix #3214. Signed-off-by: Jinzhe Zeng (cherry picked from commit 412c8122b3cbd6ef0b629b06f753be72bb259e01) --- source/gmx/CMakeLists.txt | 1 + source/gmx/include/gmx_plugin.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/source/gmx/CMakeLists.txt b/source/gmx/CMakeLists.txt index c119e4b212..d445479d39 100644 --- a/source/gmx/CMakeLists.txt +++ b/source/gmx/CMakeLists.txt @@ -19,6 +19,7 @@ else() target_link_libraries(${libgmxname} PUBLIC ${LIB_DEEPMD_CC}) target_compile_definitions(${libgmxname} PUBLIC "DP_USE_CXX_API") endif() +target_compile_definitions(${libgmxname} PRIVATE "DP_GMX_PLUGIN_INTERNAL") target_include_directories(${libgmxname} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_include_directories(${libgmxname} diff --git a/source/gmx/include/gmx_plugin.h b/source/gmx/include/gmx_plugin.h index 51eae8ca7e..430ca2fe0d 100644 --- a/source/gmx/include/gmx_plugin.h +++ b/source/gmx/include/gmx_plugin.h @@ -5,7 +5,11 @@ #include "DeepPot.h" namespace deepmd_compat = deepmd; #else +#ifdef DP_GMX_PLUGIN_INTERNAL #include "deepmd.hpp" +#else +#include "deepmd/deepmd.hpp" +#endif namespace deepmd_compat = deepmd::hpp; #endif