[CMake] Adding object files to library

Brad King brad.king at kitware.com
Sat Dec 4 12:46:09 EST 2004


Karl Merkley wrote:
> 
> I have a problem with the current CVS version.  I am trying to do the 
> following
> 
> ADD_LIBRARY(cml ${CML_SRCS} ${CML_HDRS} ${INR_C_SRCS} ${INR_OBJS})
> 
> where INR_OBJS is a list of object files generated from Fortran source. 
>  I can use MESSAGE(STATUS "${IN_OBJS}") and print out the list of object 
> files from cmake but they never show up in Makefile.
> 
> This process works with the 2.0.3 version of CMake but not with the 
> latest version out of CVS.  (I moved to the CVS version to fix some 
> problems with Mac OSX).

Have you tried 2.0.5?  What problems exist on the Mac in 2.0.x that do 
not in the CVS version?

> I traced this through the source code and find that I do not get past 
> the following statement
> 
>          if(outExt.size() && !(*i)->GetPropertyAsBool("EXTERNAL_OBJECT") 
> ) // cmLocalUnixMakefileGenerator.cxx" line 487
> 
> I tried adding
> 
> SET_SOURCE_FILES_PROPERTIES(${var} PROPERTIES EXTERNAL_OBJECT OFF) to my 
> CMakeLists.txt but it doesn't help.
> 
> Is this a bug or is there another way to work around this and set the 
> correct property on an object file?

I suspect it is a bug.  Please report it here:

http://www.cmake.org/Bug

so we can make sure it is fixed before the next release.

Thanks,
-Brad


More information about the CMake mailing list