Hi, In theory, one can compose CMake projects like that, but we have not tried to make that work with GROMACS. A better approach is probably to use a CMake external project to build GROMACS and thereby install it into the build tree. That installation has a FindGROMACS.cmake file that your main project can be told to use.
Mark On Sat, Jan 27, 2018, 04:12 Cory J. Geesaman <c...@biocoin.org> wrote: > Is it possible to use libgromacs in a CMake based project which links the > library in at build time (but from source as opposed to a system-wide > installation?) > > > > So far I have the gromacs source included as a submodule from > https://github.com/gromacs/gromacs.git located in the subdirectory > 3rdparty/gromacs/ > > > > In my CMakeLists.txt I have: > > > > > include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/gromacs/src/gromacs > ) > > > > and a bit further down: > > > > target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} libgromacs) > > > > Which seems to pass the CMake tests, but when it gets to actually building > the project I get the error: > > > > > c:/progra~1/mingw/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64 > -w64-mingw32/bin/ld.exe: cannot find -llibgromacs > > collect2.exe: error: ld returned 1 exit status > > > > I'm sure this is some kind of CMake error but I don't know what it could be > precisely because I'm relatively new to CMake. I'm building with > CLion+MinGW on Windows 7 (but also intend to build on Linux.) > > > > Additionally, are there any significant gromacs-specific performance > concerns I should be aware of building Windows binaries with MinGW or will > it work as well as with a Windows build platform like visual c++? > > > > Thanks for any information, > > Cory > > -- > Gromacs Users mailing list > > * Please search the archive at > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before > posting! > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists > > * For (un)subscribe requests visit > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or > send a mail to gmx-users-requ...@gromacs.org. > -- Gromacs Users mailing list * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting! * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists * For (un)subscribe requests visit https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a mail to gmx-users-requ...@gromacs.org.