Would set(CMAKE_POSITION_INDEPENDENT_CODE ON) be better here?
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Yes, see 482fd3ad.