Hello,

I have the following configuration;


FIND_PACKAGE(Qt4 4.7.1 COMPONENTS QtCore)

IF (Qt4_FOUND)

    INCLUDE(${QT_USE_FILE})

    MESSAGE(STATUS "QT_LIBRARIES:${QT_LIBRARIES}")

ENDIF()
 


# setup header and source files


 
ADD_EXECUTABLE(TBD ${_SOURCES} ${_HEADERS})

TARGET_LINK_LIBRARIES(TBD ${QT_LIBRARIES})


 
The message outputs;

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


 
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.
 


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.
 
Appreciate any input.

                                          
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to