On 02/14/2011 03:45 PM, Robert Bielik wrote:
> Eric Noulard skrev 2011-02-14 15:42:
>>> I seem to be missing something, cause I cannot find a target property
>>> for
>>> setting additional library directories (for a MSVC project)
>>
>> Usually you do not specify "additional lib directories" you should
>> specify all libs you need with "target_link_libraries".
>>
> 
> Ok, you mean like:
> 
> add_library(dsound SHARED IMPORTED)
> set_target_properties(dsound PROPERTIES IMPORTED_LOCATION
> "${DSOUND_LIBRARY}/dsound.lib")
> 
> target_link_libraries(MyTarget dsound)
> 
> ??
> /Rob

That's the fancy way, an alternative would be

find_library(DSOUND_LIBRARY dsound)
target_link_libraries(MyTarget ${DSOUND_LIBRARY})

Probably you could make the find_library call more robust by appropriate
PATHS options, but I currently don't have a windows available, so I
can't check whether the registry would help.

HTH

Michael
_______________________________________________
Powered by www.kitware.com

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

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

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

Reply via email to