Hi,

I have a C++ project with two subprojects written in Fortran, sub1 and
sub2. To be able to build them on Windows with MinGW's gfortran, the
subprojects are added to the main project with
cmake_add_fortran_subdirectory as described in
http://www.kitware.com/blog/home/post/231. Moreover, sub2 calls functions
defined in sub1, so I link sub1 to sub2 using the following cmake command:

  target_link_libraries(sub2 sub1)

This woks fine on Linux but when I try to compile the project on Windows
with Visual C++ and gfortran I get the following error:

  ld.exe: cannot find -lsub1

Is there a way to link the library from another Fortran project so that it
worked on Windows with gfortran & VC++ too?

Thanks,
Victor
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to