Re: [CMake] LINK_FLAGS works incorrectly,

2011-04-18 Thread Michael Wild
On 04/18/2011 03:25 PM, Łukasz Tasz wrote:
 Hi all,
 
 I got a simple question,
 
 What is idea behind target property LINK_FLAGS?
 
 When I add linker flag e.g --no-undefined then cmake is not alligning
 it to real linker that will be used during linking.
 
 for example --no-undefined is a valid ld switch, but when I specify it
 LINK_FLAGS it will not reach linker since cmake is deciding to use g++
 and is forgeting about adding -Wl, at the begining.
 
 In my opoinion it should be in a way:
 1. User is specyfing:
 set_property(TARGET TEST property LINK_FLAGS --no-undefined)
 2. cmake is coosing g++ as a linker, then variable CMAKE_SHARED_LINKING_FLAGS
 should be extended with -Wl,--noundefined
 3. during make ld is called via g++ with passed flags --no-undefined.
 
 thanks in advance for your help
 
 Lukasz Tasz
 
 

Thing is, with that property you can pass *everything* on the link-line,
so it would be pretty bad if CMake just prefixed everything with -Wl,.
Just do it yourself. And please, put it in a conditional
block where you test for CMAKE_COMPILER_IS_GNUCXX).

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

Re: [CMake] LINK_FLAGS works incorrectly,

2011-04-18 Thread t m
 I got a simple question,

 What is idea behind target property LINK_FLAGS?

 When I add linker flag e.g --no-undefined then cmake is not alligning
 it to real linker that will be used during linking.

 for example --no-undefined is a valid ld switch, but when I specify it
 LINK_FLAGS it will not reach linker since cmake is deciding to use g++
 and is forgeting about adding -Wl, at the begining.

 In my opoinion it should be in a way:
 1. User is specyfing:
 set_property(TARGET TEST property LINK_FLAGS --no-undefined)
 2. cmake is coosing g++ as a linker, then variable CMAKE_SHARED_LINKING_FLAGS
 should be extended with -Wl,--noundefined
 3. during make ld is called via g++ with passed flags --no-undefined.


 Thing is, with that property you can pass *everything* on the link-line,
 so it would be pretty bad if CMake just prefixed everything with -Wl,.
 Just do it yourself. And please, put it in a conditional
 block where you test for CMAKE_COMPILER_IS_GNUCXX).

Hi

Is it possible to prepare on-fly translation from g++ wrapped format
to the pure ld?. The following scenario would be useful:

 * common section will provide mapping. The common logic will be
include in all CMakeLists.txt files and in the body of all
CMakeLists.txt you will use
just flags as those are provided in the man of the linker. This will
separate the linker flags from the way howe those are finally passed
to the ld: directly or thrue the g++.

regards, T Majchrowski.
___
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


Re: [CMake] LINK_FLAGS works incorrectly,

2011-04-18 Thread Hendrik Sattler
Am Montag 18 April 2011, 15:25:24 schrieb Łukasz Tasz:
 Hi all,
 
 I got a simple question,
 
 What is idea behind target property LINK_FLAGS?
 
 When I add linker flag e.g --no-undefined then cmake is not alligning
 it to real linker that will be used during linking.
 
 for example --no-undefined is a valid ld switch, but when I specify it
 LINK_FLAGS it will not reach linker since cmake is deciding to use g++
 and is forgeting about adding -Wl, at the begining.

However, there are flags for the linking stage of the compiler that do not 
directly translate to -Wl,--somthing but e.g. instruct gcc what libraries to 
use (or not) for linking.
Just look at Options for Linking in  man gcc.

HS
___
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

Re: [CMake] LINK_FLAGS works incorrectly,

2011-04-18 Thread Łukasz Tasz
Hi,

Of course I read manual. But I'm a little bit confused. That's why I'm
asking about idea behind LINK_FLAGS,

Cmake is not consequent because when I'm adding:

add_library(test foo.cxx bar.cxx)
SET_TARGET_PROPERTIES( test PROPERTIES SOVERSION 1.2 VERSION 1.1)

it 'magicaly knows' how to build linking commands and according to gcc
manual it is done in a way:

-Wl,-soname,libtest.so.1.2


I'm also fine with answer that it is not implemented, and I need to
handle it by myself.
I would like to understand why for some linker switches cmake is
aligning it correctly, for some not.

best regards
Lukasz


 However, there are flags for the linking stage of the compiler that do not
 directly translate to -Wl,--somthing but e.g. instruct gcc what libraries to
 use (or not) for linking.
 Just look at Options for Linking in  man gcc.

 HS




-- 
Lukasz Tasz
___
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


Re: [CMake] LINK_FLAGS works incorrectly,

2011-04-18 Thread Michael Wild
On 04/18/2011 07:37 PM, Łukasz Tasz wrote:
 Hi,
 
 Of course I read manual. But I'm a little bit confused. That's why I'm
 asking about idea behind LINK_FLAGS,
 
 Cmake is not consequent because when I'm adding:
 
 add_library(test foo.cxx bar.cxx)
 SET_TARGET_PROPERTIES( test PROPERTIES SOVERSION 1.2 VERSION 1.1)
 
 it 'magicaly knows' how to build linking commands and according to gcc
 manual it is done in a way:
 
 -Wl,-soname,libtest.so.1.2
 
 
 I'm also fine with answer that it is not implemented, and I need to
 handle it by myself.
 I would like to understand why for some linker switches cmake is
 aligning it correctly, for some not.
 
 best regards
 Lukasz
 

 However, there are flags for the linking stage of the compiler that do not
 directly translate to -Wl,--somthing but e.g. instruct gcc what libraries to
 use (or not) for linking.
 Just look at Options for Linking in  man gcc.

 HS

 
 
 

CMake can't possibly know all flags of each version of all tools out
there, that's just plain ludicrous. SOVERSION and VERSION are directly
supported by CMake, and the maintainers try very hard to make sure these
features work as expected. For the rest it's your responsibility to do so.

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