diff --git a/CMakeLists.txt b/CMakeLists.txt index f20893d..f18c286 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,10 @@ set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "Generated Files") # See cmake/YarpOptions.cmake. #include(YarpOptions) +######################################################################### +# Compile libraries using -fPIC to produce position independent code. +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + ######################################################################### # Control whether libraries are shared or static (imported from YarpOptions)