[CMake] Windows library target names
Michael Jackson
mike.jackson at bluequartz.net
Thu Jul 22 16:46:08 EDT 2010
On Jul 22, 2010, at 4:38 PM, Olaf van der Spek wrote:
> On Thu, Jul 22, 2010 at 10:32 PM, Ryan Pavlik <rpavlik at iastate.edu>
> wrote:
>> Unfortunately there are as many ways to denote these differences as
>> there
>> are projects. However, unless you're setting the
>> ARCHIVE_OUTPUT_DIRECTORY,
>> LIBRARY_OUTPUT_DIRECTORY, or RUNTIME_OUTPUT_DIRECTORY (and if you
>> are, I
>> highly suggest not doing so and instead installing as-needed to a
>> local
>> prefix), the files should not collide in the build tree - in a
>> multi-config
>> generator like MSVC, each target gets a directory for each build
>> type, and
>> in a single-config generator you'll only have one build type per
>> entire
>> build tree.
>
> And then what? Having two DLLs with the same name is not going to
> work. Same for import or static libs.
>
> What about libs that don't have a naming scheme yet? Is there any
> recommended way to do this stuff?
>
> Olaf
Ya know , I go back and forth on this. In my own projects I will give
my libs a _debug suffix because I end up installing both debug and
release into a local directory and my FindXXX.cmake scripts know to
look for both a debug and release version of the library, ala,
FindQt4.cmake. I like the way Qt does this and so went with
TrollTech's "standard".
If you don't have all the infrastructure to do that then NOT having
any default naming is the best way. Also CMake's FindXXX.cmake scripts
are tuned to find libraries in their default naming scheme from the
"manufacturer", even Boost's crazy naming schemes can be found _most_
of the time.
Mike Jackson
More information about the CMake
mailing list