From 78d1c8bc7ecf9642b25df37a1fd398840c8483a7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 27 Jun 2021 14:39:53 -0400 Subject: [PATCH] USER-MOLFILE depends on CMAKE_DL_LIBS when not compiling on Windows --- cmake/Modules/Packages/USER-MOLFILE.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/Packages/USER-MOLFILE.cmake b/cmake/Modules/Packages/USER-MOLFILE.cmake index 427f0ed6fa..add4c640e7 100644 --- a/cmake/Modules/Packages/USER-MOLFILE.cmake +++ b/cmake/Modules/Packages/USER-MOLFILE.cmake @@ -1,5 +1,7 @@ set(MOLFILE_INCLUDE_DIR "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers") -set(MOLFILE_INCLUDE_DIRS "${MOLFILE_INCLUDE_DIR}") add_library(molfile INTERFACE) -target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS}) +target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIR}) +if(NOT (CMAKE_SYSTEM_NAME STREQUAL "Windows")) + target_link_libraries(molfile INTERFACE ${CMAKE_DL_LIBS}) +endif() target_link_libraries(lammps PRIVATE molfile)