From: <sm...@us...> - 2009-03-19 20:59:19
|
Revision: 9760 http://plplot.svn.sourceforge.net/plplot/?rev=9760&view=rev Author: smekal Date: 2009-03-19 20:58:58 +0000 (Thu, 19 Mar 2009) Log Message: ----------- CMake does not produce an import library of the libplplotf77d.dll dynamic library for the MinGW g77 Fortran compiler even if the definition file is added to the target. I have found not other way then to add a custom post-build target which produces the import library using the MinGW dlltool. Fortran examples link now. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2009-03-19 20:51:57 UTC (rev 9759) +++ trunk/bindings/f77/CMakeLists.txt 2009-03-19 20:58:58 UTC (rev 9760) @@ -130,12 +130,23 @@ configurable.f ) -if(WIN32 AND BUILD_SHARED_LIBS) - SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77.def) -endif(WIN32 AND BUILD_SHARED_LIBS) +if(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW) + set(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77.def) +endif(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW) add_library(plplotf77${LIB_TAG} ${plplotf77${LIB_TAG}_LIB_SRCS}) +if(MINGW AND BUILD_SHARED_LIBS) + add_custom_command( + TARGET plplotf77${LIB_TAG} + POST_BUILD + COMMAND dlltool libplplotf77${LIB_TAG}.dll -d ${CMAKE_CURRENT_SOURCE_DIR}/plplotf77_mingw.def -l libplplotf77${LIB_TAG}.dll.a + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dll + COMMENT "Creating library file: libplplotf77${LIB_TAG}.dll.a" + ) +endif(MINGW AND BUILD_SHARED_LIBS) + + target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) if(USE_RPATH) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |