multiscale / muscle3

The third major version of the MUltiScale Coupling Library and Environment
Apache License 2.0
25 stars 13 forks source link

Add instructions for linking to MUSCLE3 from CMake #82

Open LourensVeen opened 3 years ago

LourensVeen commented 3 years ago

Some instructions on how to link to MUSCLE3 from a CMakeLists.txt would be useful. It seems the following works on CMake 2.8 and up:

pkg_check_modules (LIBMUSCLE REQUIRED IMPORTED_TARGET libmuscle)
pkg_check_modules (YMMSL REQUIRED IMPORTED_TARGET ymmsl)
ADD_EXECUTABLE(myprogram myprogram.cpp)
TARGET_LINK_LIBRARIES(myprogram PkgConfig::LIBMUSCLE)
TARGET_LINK_LIBRARIES(myprogram PkgConfig::YMMSL)