[CMake] Win: Dependency for def file missing

Martin Apel martin.apel at simpack.de
Tue Dec 9 08:21:42 EST 2008


Hi all,

I am generating a DLL under Windows using a def file. The def file
itself is generated. It seems that CMake (2.6.3rc5) does not generate a
dependency between the generated def file and the DLL. When I change the
input, from which the def file is generated, the def file is rebuilt,
but not the DLL itself. The code looks as follows:

  SET(DefFile ${CMAKE_CURRENT_BINARY_DIR}/FortranInterface.def)
  ADD_CUSTOM_COMMAND(OUTPUT ${DefFile}
                     COMMAND ${PERL_EXECUTABLE}
${CMAKE_SOURCE_DIR}/scripts/create_dll_exports_file.pl
                     --export-file=${DefFile} --so-name=FortranInterface
                     ${CMAKE_CURRENT_SOURCE_DIR}/FortranInterfaceExport.txt
                     DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/FortranInterfaceExport.txt
                     )

  ADD_LIBRARY(FortranInterface SHARED ${DefFile} ${FortranSrc})
  TARGET_LINK_LIBRARIES(FortranInterface ${MY_LIBS})
  SET_TARGET_PROPERTIES(FortranInterface PROPERTIES
LINK_INTERFACE_LIBRARIES "")

  SET_SOURCE_FILES_PROPERTIES(${DefFile} PROPERTIES GENERATED 1)

To me this looks like a bug in CMake. Can somebody confirm, that this is
a bug or am I doing something wrong?

Regards,

Martin



____________
Virus checked by G DATA AntiVirus
Version: AVF 19.178 from 08.12.2008




More information about the CMake mailing list