Re: [CMake] Re: [Insight-developers] can cmake generate an error if a variable doesn't exist ?

Alexander Neundorf a.neundorf-work at gmx.net
Fri Jan 13 07:21:14 EST 2006


> Von: "Gaetan Lehmann" <gaetan.lehmann at jouy.inra.fr> 
... 
> I was thinking to something like 
>  
> MESSAGE("VAR value is: ${VAR}") 
>  
> where VAR is not defined. I would like to get an error, or at least a   
> warning, instead of an empty value. 
>  
> > Also, this discussion really belongs on the 
> > cmake mailing list. 
>  
> Ok, so lets continue there. 
 
I have a slightly related issue/wish/problem. 
I'd like to append files to the OBJECT_DEPENDS property. 
 
GET_SOURCE_FILE_PROPERTY(deps main.c OBJECT_DEPENDS) 
 
If OBJECT_DEPENDS wasn't set before, deps will be "NOTFOUND" after this 
call. That's ok but in my case it would be better if it would be empty. 
Because as it is now I have to do the following: 
 
MACRO(ADD_DEP source dep) 
 GET_SOURCE_FILE_PROPERTY(deps ${source} OBJECT_DEPENDS) 
 IF(deps) 
   SET(deps ${deps} ${dep} )  
 ELSE(deps) 
   SET(deps ${dep} )  
 ENDIF(deps) 
 SET_SOURCE_FILES_PROPERTIES(${source} PROPERTIES OBJECT_DEPENDS ${deps}) 
ENDMACRO(ADD_DEP source dep) 
 
instead of  
 
MACRO(ADD_DEP source dep) 
 GET_SOURCE_FILE_PROPERTY(deps ${source} OBJECT_DEPENDS) 
 SET(deps ${deps} ${dep} )  
 SET_SOURCE_FILES_PROPERTIES(${source} PROPERTIES OBJECT_DEPENDS ${deps}) 
ENDMACRO(ADD_DEP source dep) 
 
Bye 
Alex 
 

-- 
10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail
+++ GMX - die erste Adresse für Mail, Message, More +++


More information about the CMake mailing list