On Monday, 2014-01-27, 18:45:15, Mohammad Mirzadeh wrote:
> Hi guys,
> 
> This is not strictly a QtCreator question so please excuse me if this is
> the wrong mailing list.
> 
> Is there any way to ask qmake to check if a given function is defined
> inside a system hear file during the configuration step, a.k.a. running
> qmake?

You can make configure-style tests

in your .pro file:

####
# configure style tests
# QMAKE_CONFIG_TESTS_DIR defaults to dir of current .pro files + config.tests
# sets config_$test if successful
# e.g. config_cpp11 for test config.tests/cpp11

load(configure)

log($${EOL}Running configure tests...$${EOL}$${EOL})
CONFIG_TESTS = $$files($$QMAKE_CONFIG_TESTS_DIR/*.pro, true)
for(test, CONFIG_TESTS) {
    test = $$basename(test)
    test ~= s/\\.pro$//
    qtCompileTest($$test)
}

contains(CONFIG, config_cpp11) {
   # do C++11 things
}

in a sub directory config.tests add directories that contain small test 
programs. They will be built and run.
In your case only the building matters, i.e. include the system header and 
call the function or try to get its address.

Cheers,
Kevin

-- 
Kevin Krammer | [email protected] | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to