[CMake] Win: Dependency for def file missing

Bill Hoffman bill.hoffman at kitware.com
Tue Dec 9 10:45:42 EST 2008


Martin Apel wrote:
> Bill Hoffman wrote:
>> Martin Apel wrote:
>>> 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?
>>>
>> What version of VS are you using?   Also, nmake or VS IDE?
>>
> Hi Bill and all the rest,
> 
> sorry, I forgot to state this: VS version is 2005 and I am using nmake.
> 

Can you send me your binary tree (after a make clean) so I can see the 
makefiles that were generated?  You can send it off the list if you want.

-Bill


More information about the CMake mailing list