[CMake] FIND_PACKAGE(SWIG) in cmake 1.8

James Bigler bigler at cs.utah.edu
Wed Aug 24 18:04:52 EDT 2005


Brad King wrote:
> James Bigler wrote:
> 
>> I know this works in 2.0, but I need to know how I can fix the 
>> following code to work in 1.8 without breaking:
>>
>> FIND_PACKAGE(SWIG)
>> IF (SWIG_FOUND)
>>   SET(MAIN_SUBDIRS ${MAIN_SUBDIRS} SwigInterface)
>> ENDIF (SWIG_FOUND)
>>
>> I get errors from withing ccmake when swig isn't found saying this:
>>
>>  CMake Error: SWIG_DIR is not set.  It must be set to the directory
>>  containing SWIGConfig.cmake so in order to use SWIG.
>>
>> Is this a feature that is only found in 2.0?
> 
> 
> SWIG support was not added until CMake 2.0.
> 
> -Brad

How can I only make the test if I have at least version 2.0?

Thanks,
James


More information about the CMake mailing list