[CMake] Problems to use TRY_COMPILE
Bill Hoffman
bill.hoffman at kitware.com
Thu Apr 3 13:01:39 EDT 2008
Vitor Vasconcelos Araujo Silva wrote:
> Hello guys,
>
> I'm trying to use the TRY_COMPILE command and I guess I'm probaly
> making some mistake or I misunderstood the command.
>
> My command is this one:
>
> TRY_COMPILE(RESULT ${PROJECT_BINARY_DIR}
>
> ${PROJECT_SOURCE_DIR}/teste.cpp
> CMAKE_FLAGS
> COMPILE_DEFINITIONS -I${QT_INCLUDE_DIR}
> -I${QT_QTCORE_INCLUDE_DIR}
> -l${QT_QTCORE_LIBRARY}
> OUTPUT_VARIABLE MY_OUT
> )
>
> My compile parameters (-I) are working, but my link parameter is
> just throw away when compiling and, to link, it's no used. MY_OUT output
> is this: (I just marked the important commands to try to make it more
> readable).
>
You are missing LINK_LIBRARIES from Qt. I don't see where you are
passing a link parameter in??
-Bill
More information about the CMake
mailing list