2011/3/4 Alexey Livshits <[email protected]>:
>> You can definition two different library target
>> and use OUTPUT_NAME property to adjust the name
>>
>> add_library(foo1 ${foo_source})
>> set_target_properties(foo1 PROPERTIES
>>                                       OUTPUT_NAME foo)
>>
>> add_library(foo2 ${foo_source})
>> set_target_properties(foo2 PROPERTIES
>>                                       OUTPUT_NAME foo)
>>
>> You probably want to adjust COMPILE_FLAGS and/or LINK_FLAGS
>> for each target as well.
>
> That's what I already do. I also set different *_OUTPUT_DIRECTORY to
> avoid collisions. The problem is, I cannot define different PROJECTs,
> so foo_1 and foo_2 are in the same VS workspace.

I am not a Visual Studio user so I may be missing your point here
but why having foo_1 and foo_2 ending up in the same workspace is a problem?

As long as the lib/dll end up in separate dirs (using *_OUTPUT_DIRECTORY).

>> If you intend to build those librarie during the same build then
>> you'll have to define those targets in separate directories
>> (with shared source are shared).
>
> So?
>
> foo
> |
> |- foo_1
>   |- CMakelists.txt
> |- foo_2
>   |- CMakelists.txt
> |
> |- foo.cpp

Should work too.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
_______________________________________________
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