CMAKE : how to link executable to winmm imm32 version on windows with Visual Studio?
Asked Answered
P

1

2

Is it possible to find these libraries easily?

I do not want to reinvent the wheel and write uber-long find_library call!

Even more, I just want to put line "winmm.lib etc" into

"Librarian" => "Additional dependencies"
or
"Linker" => "Additional dependencies"

These libraries are good friends of Windows and Visual Studio so they know very well how to find them.

Phenformin answered 3/7, 2011 at 16:52 Comment(3)
Why would you need to 'find' these libs? Simply add them to your target_link_libraries and it should work. Visual Studio already knows where to find them in its default library-search directories.Coir
this will not work, target_link_libraries takes only "found" stuff ;)Phenformin
I hate to say this, but... it works for me. Did you try it? When I make my own small project with a simple CMakeLists.txt and add imm32.lib to the target_link_libraries, it will be added to the AdditionalDependencies section of my .vcxproj file. Together with kernel32.lib; user32.lib; etcCoir
S
8

Solution from Andre works. In my project this line did the trick:

target_link_libraries(${target_name} winmm.lib)
Symptom answered 11/7, 2011 at 20:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.