<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Have a look for install_qt4_executable. We've been using that instead of having to explicitly install the Qt libraries ourselves. Much easier to maintain and it seems to deal well with all the platform differences.</div><div><br></div><div>PS: I'm going from memory so I might have the name of that function slightly wrong.&nbsp;<br><br>--<div>Craig Scott</div><div><br></div></div><div><br>On 29/08/2013, at 7:04 PM, Lars Lars &lt;<a href="mailto:laasunde@hotmail.com">laasunde@hotmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>

<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr"><span lang="NO-BOK">Hello,<br>

I have the following configuration;<br>

FIND_PACKAGE(Qt4 4.7.1 COMPONENTS QtCore)<br>
IF (Qt4_FOUND)<br>
 &nbsp;&nbsp; INCLUDE(${QT_USE_FILE})<br>
 &nbsp;&nbsp; MESSAGE(STATUS "QT_LIBRARIES:${QT_LIBRARIES}")<br>
ENDIF()<br>&nbsp;<br>

# setup header and source files<br>

&nbsp;<br>ADD_EXECUTABLE(TBD ${_SOURCES} ${_HEADERS})<br>
TARGET_LINK_LIBRARIES(TBD ${QT_LIBRARIES})<br>

&nbsp;<br>The message outputs;<br>
QT_LIBRARIES:optimized;c:/tools/Qt_r/4.7.1-vs2005/lib/QtCore4.lib;debug;c:/tools/Qt_r/4.7.1-vs2005/lib/QtCored4.lib<br>

&nbsp;<br>So the target_link_libraries decode the content in QT_LIBRARIES variable to determine which library to link against. In this example that means if cmake_build_type is equal "release" then the optimized library is used. If cmake_build_type is equal "debug" then the debug library is used. This is a simple description of what happens.<br>&nbsp;<br>

Next I need to install the qt libraries. I am able to determine library path based on lib path. How do I determine to use "optimized" or "debug" or "general"? It would be great if this algorithm was the same as the one used by target_link_libraries api to select which library to link against.<br>&nbsp;<br>Appreciate any input.<br>
</span>                                               </div>
</div></blockquote><blockquote type="cite"><div><span>--</span><br><span></span><br><span>Powered by <a href="http://www.kitware.com">www.kitware.com</a></span><br><span></span><br><span>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a></span><br><span></span><br><span>Kitware offers various services to support the CMake community. For more information on each offering, please visit:</span><br><span></span><br><span>CMake Support: <a href="http://cmake.org/cmake/help/support.html">http://cmake.org/cmake/help/support.html</a></span><br><span>CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html">http://cmake.org/cmake/help/consulting.html</a></span><br><span>CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html">http://cmake.org/cmake/help/training.html</a></span><br><span></span><br><span>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></span><br><span></span><br><span>Follow this link to subscribe/unsubscribe:</span><br><span><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></span></div></blockquote></body></html>