Re: [CMake] How to add -fPIC to a static library?

2016-08-28 Thread Steve Lorimer
Thanks Nicholas, you are indeed correct! On 28 August 2016 at 17:35, Nicholas Braden wrote: > Have you tried set_property(TARGET cpp-netlib_pic PROPERTY > POSITION_INDEPENDENT_CODE ON)? I think you must specify the value ON > for it to work. > > On Sun, Aug 28, 2016 at 4:28 PM, Steve Lorimer >

Re: [CMake] How to add -fPIC to a static library?

2016-08-28 Thread Nicholas Braden
Have you tried set_property(TARGET cpp-netlib_pic PROPERTY POSITION_INDEPENDENT_CODE ON)? I think you must specify the value ON for it to work. On Sun, Aug 28, 2016 at 4:28 PM, Steve Lorimer wrote: > I'm trying to create a static library with -fPIC specified. > > add_library(cpp-netlib_pic >

[CMake] How to add -fPIC to a static library?

2016-08-28 Thread Steve Lorimer
I'm trying to create a static library with -fPIC specified. add_library(cpp-netlib_pic STATIC ${SRCS}) set_property(TARGET cpp-netlib_pic PROPERTY POSITION_INDEPENDENT_CODE) This doesn't work. The library (cpp-netlib_pic) is built without the -fPIC flags. Other targets which link agains

Re: [CMake] Using a pathless library in an imported target.

2016-08-28 Thread Benjamin Ballet via CMake
Create an imported interface instead of a static library. Then you can set either INTERFACE_COMPILE_OPTIONS or INTERFACE_LINK_LIBRARIES properties. 2016-08-27 21:39 GMT+02:00 Yaron Cohen-Tal : > Hi, > > I try to make an imported target out of OpenGL, and I have some > difficulty. Usually "OPENGL_

[CMake] How to link against PIC version of a library's dependency in CMake?

2016-08-28 Thread Steve Lorimer
*CMake:* We have a dependency on cpp-netlib . We build it from source as part of our build system. cpp-netlib/CMakeLists.txt: add_library(cpp-netlib STATIC ${SRCS}) For one particular use case, we have to use it in a shared library, so I've created a second libr