Hi,
Is there a nice way to find out if a target is using -fPIC ?
Indeed, this information is needed for generating compiled header. 
At the moment, a kludge is to use the following code:

    #If the target is a shared library, add -fPIC to compile
    GET_TARGET_PROPERTY(_targetType ${_targetName} TYPE)
    IF(${_targetType} STREQUAL SHARED_LIBRARY)
      SET(_compile_FLAGS "${_compile_FLAGS} -fPIC")
    ENDIF(${_targetType} STREQUAL SHARED_LIBRARY)

This works but is not a proper solution, one shall not know in which 
case -fPIC is used or not.
Thanks,
Frederic Heem
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to