draft: cmake <-> kdevelop integration

Matt Rogers mattr at kde.org
Wed Oct 4 23:26:22 UTC 2006


On Wednesday 04 October 2006 11:46, Alexander Dymo wrote:
> Matt, do you know the answer to one important question about cmake
> which Alex didn't emphasize.
>
> Let's get back to his example:
> ---------8<------------8<-------------8<----------
> #00
> #01 set(myLinkLibs foo)
> #02 set(myIncDirs foo/include)
> #03
> #04 set(mySrcs main.cpp foo.cpp)
> #05
> #06 find_package(PNG)
> #07
> #08 if (PNG_FOUND)
> #09    set( mySrcs ${mySrcs} pngview.cpp)
> #10    set(myLinkLibs ${myLinkLibs} ${PNG_LIBRARIES})
> #11    set(myIncDirs ${myIncDirs} ${PNG_INCLUDE_DIR})
> #12 endif (PNG_FOUND)
> #13
> #14 if (WIN32)
> #15    set( mySrcs ${mySrcs} pngview.cpp)
> #16 else (WIN32)
> #17    set( mySrcs ${mySrcs} pngview.cpp)
> #18 endif (WIN32)
> #19
> #20 include_directories( ${myIncDirs})
> #21
> #22 add_executable(hello ${mySrcs})
> #23
> #24 target_link_libraries(hello ${myLinkLibs})
>
> ---------8<------------8<-------------8<----------
>
> Does your xml generator recognize all these cmake conditions
> or does it simply evaluate the value of mySrcs depending on the
> configuration stage?
>

No, the XML generator does not recognize all these cmake conditions since 
CMake doesn't make them available (AFAIK). Whatever CMake puts into the the 
sources list for a target is what I get in the XML generator.
-- 
Matt




More information about the KDevelop-devel mailing list