cmake: make h5md includes local

This commit is contained in:
Christoph Junghans 2017-08-21 15:04:03 -06:00
parent 5fcc19777c
commit cf3f15b0a5
1 changed files with 9 additions and 6 deletions

View File

@ -248,12 +248,6 @@ if(ENABLE_USER-QMMM)
list(APPEND LAMMPS_LINK_LIBS ${QE_LIBRARIES} ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
endif()
if(ENABLE_USER-H5MD)
find_package(HDF5 REQUIRED)
list(APPEND LAMMPS_LINK_LIBS ${HDF5_LIBRARIES})
include_directories(${HDF5_INCLUDE_DIRS} ${LAMMPS_LIB_SOURCE_DIR}/h5md/include)
endif()
if(ENABLE_USER-VTK)
find_package(VTK REQUIRED NO_MODULE)
include(${VTK_USE_FILE})
@ -366,6 +360,8 @@ foreach(SIMPLE_LIB REAX MEAM POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD
if(PKG_LIB STREQUAL awpmd)
set_property(SOURCE ${PKG_SRC} APPEND PROPERTY COMPILE_FLAGS -I${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/systems/interact)
set_property(SOURCE ${PKG_SRC} APPEND APPEND_STRING PROPERTY COMPILE_FLAGS " -I${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/ivutils/include")
elseif(PKG_LIB STREQUAL h5md)
include_directories(${LAMMPS_LIB_SOURCE_DIR}/h5md/include) #ch5md.h is included indirectly in style.h
else()
set_property(SOURCE ${PKG_SRC} APPEND PROPERTY COMPILE_FLAGS -I${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB})
endif()
@ -378,6 +374,13 @@ if(ENABLE_USER-AWPMD)
"${LAMMPS_LIB_SOURCE_DIR}/awpmd/systems/interact;${LAMMPS_LIB_SOURCE_DIR}/awpmd/ivutils/include")
endif()
if(ENABLE_USER-H5MD)
find_package(HDF5 REQUIRED)
target_link_libraries(h5md ${HDF5_LIBRARIES})
set_target_properties(h5md PROPERTIES INCLUDE_DIRECTORIES
"${HDF5_INCLUDE_DIRS};${LAMMPS_LIB_SOURCE_DIR}/h5md/include")
endif()
######################################################################
# packages which selectively include variants based on enabled styles
# e.g. accelerator packages