[CMake] How can I avoid the addition of Debug/Release to the link path?

Mike Jackson imikejackson at gmail.com
Tue Oct 9 12:41:06 EDT 2007



On Oct 9, 2007, at 12:27 PM, Sylvain Benner wrote:

>
>> This has to be this way, or the cmake generated projects will not  
>> be able to find
>> libraries in other projects of the same build type.  Can someone  
>> explain the issue
>> with this?   We are using this for VTK and several other larger  
>> projects, and
>> it works fine.
>>
>> -Bill
> Ok I understand but library files are not necessary in "$ 
> (CONFIGURATION)" folder, they can be in "$(CONFIGURATION)/ 
> subfolder" for instance.
>
> I think it should not be hardcoded because the paths where the  
> libraries are can be anything.
>
> It should be handled like this I guess:
>
> LINK_DIRECTORIES( my_path_debug, my_path_release, ....)
> LINK_LIBRARIES(DEBUG my_lib_debug OPTIMIZE my_lib_release)
>
> The librairies should have different names but this is often the case.
>
> --Sylvain


I think this is more of an Xcode issue than a Cmake issue. Xcode by  
default will have 2 types of "Configurations", Debug and Release.  
Xcode _will_ make the subdirectories (just like VS) named after the  
configuration. This is hard coded into Xcode and from what I can  
tell, can not be changed. The most you can do is get rid of all but  
ONE configuration. Just my 2 cents.

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services




More information about the CMake mailing list