[Cmake] EXEC_PROGRAM and subdirs

klaas.holwerda kholwerd at xs4all.nl
Sun Sep 12 17:18:53 EDT 2004


Hi,

What can be the reason, that the following peace of cmake script ( which 
is include in the some CMakeLists.txt),
contains in the top makefile the first part of the if  as result, but in 
a SUBDIR directory the second part?
If i but a MESSAGE i only see it once, and the right part as expected by me.
Somehow Cmake seems to NOT execute the program under certain conditions 
e.g. subdirs.?

It makes no sence to me at all, some help is much appreciated.

    EXEC_PROGRAM( ${CMAKE_WX_CONFIG} ARGS --cflags OUTPUT_VARIABLE GTK2 )
        # assume wxWidget has "gtk2" in its include strings
        IF ( GTK2 MATCHES "^.*gtk2*" )
            SET( CMAKE_WX_CXX_FLAGS "${CMAKE_WX_CXX_FLAGS} 
${CMAKE_PKGCONFIG_C_FLAGS}" )
        ELSE ( GTK2 MATCHES "^.*gtk2*" )   
                SET( CMAKE_WX_CXX_FLAGS "${CMAKE_WX_CXX_FLAGS} 
`gtk-config --cflags`" )
        ENDIF ( GTK2 MATCHES "^.*gtk2*" )


BTW
In the archives i found FindPkgConfig.cmake, i have not found it yet in 
Cmake, still for Fedore core 2
this is needed to find gtk2. The script seems to work well, should it 
not become part of Camek?

Regards,

Klaas


More information about the Cmake mailing list