Commit 250e3892 authored by Giacomo Fiorin's avatar Giacomo Fiorin
Browse files

Add defines to build Lepton with MSVC and CMake

parent be1f3073
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ if(COLVARS_LEPTON)
  if(NOT BUILD_SHARED_LIBS)
    install(TARGETS lepton EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
  endif()
  # Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC
  target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)
  set_target_properties(lepton PROPERTIES OUTPUT_NAME lammps_lepton${LAMMPS_MACHINE})
  target_include_directories(lepton PRIVATE ${LEPTON_DIR}/include)
endif()
@@ -27,6 +29,8 @@ target_link_libraries(lammps PRIVATE colvars)

if(COLVARS_LEPTON)
  target_link_libraries(lammps PRIVATE lepton)
  target_compile_options(colvars PRIVATE -DLEPTON)
  target_compile_definitions(colvars PRIVATE -DLEPTON)
  # Disable the line below when linking Lepton as a DLL with MSVC
  target_compile_definitions(colvars PRIVATE -DLEPTON_USE_STATIC_LIBRARIES)
  target_include_directories(colvars PUBLIC ${LEPTON_DIR}/include)
endif()