[CMake] FIND_PACKAGE(SWIG) in cmake 1.8
Brad King
brad.king at kitware.com
Wed Aug 24 18:28:13 EDT 2005
James Bigler wrote:
> 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?
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.9)
-Brad
More information about the CMake
mailing list