Hi,
In some FindXXX.cmake, pkgconfig is used to locate include directories 
libraries, definitions etc. I would like to set the environment variable 
PKG_CONFIG_PATH to $MYLIBDIR:$PKG_CONFIG_PATH,  hence pkg-config will look 
first for $MYLIBDIR/mylib.pc
EXECUTE_PROCESS and EXEC_PROGRAM allow to execute processes but they do not 
allow to change environment variable.
A non portable workaround for unix is to call export:
    EXECUTE_PROCESS(COMMAND sh -c "export PKG_CONFIG_PATH=${_pkgpath}"  
COMMAND ${PKGCONFIG_EXECUTABLE} --print-errors --exists${_package} 
RESULT_VARIABLE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )



_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to