Fix GeographicLib linking to use variables instead of imported target

- FindGeographicLib.cmake sets GeographicLib_LIBRARIES variable, not imported target
- Changed GeographicLib::GeographicLib_SHARED to ${GeographicLib_LIBRARIES}
- Added TARGET_INCLUDE_DIRECTORIES for GeographicLib_INCLUDE_DIRS

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
TorstenandCopilot committed 2026-10-09 14:09:05 +00:00
1 parent e771c1252f
commit 9caa2573ca
1 file changed
+6 -3
@@ -24,8 +24,9 @@ NGL_TARGET_LINK_LIBRARIES(LtsCoordTrans
) )
if (GeographicLib_FOUND) if (GeographicLib_FOUND)
NGL_TARGET_LINK_LIBRARIES(LtsCoordTrans NGL_TARGET_LINK_LIBRARIES(LtsCoordTrans
PRIVATE GeographicLib::GeographicLib_SHARED PRIVATE ${GeographicLib_LIBRARIES}
) )
TARGET_INCLUDE_DIRECTORIES(LtsCoordTrans PRIVATE ${GeographicLib_INCLUDE_DIRS})
else() else()
message(STATUS "GeographicLib not found; building LtsCoordTrans without it") message(STATUS "GeographicLib not found; building LtsCoordTrans without it")
endif() endif()
@@ -68,8 +69,9 @@ IF(TARGET LtsCoordTrans)
NGL_ADD_EXECUTABLE(ALL ${_tool} ${_tool}.cpp) NGL_ADD_EXECUTABLE(ALL ${_tool} ${_tool}.cpp)
NGL_TARGET_LINK_LIBRARIES(${_tool} NGL_TARGET_LINK_LIBRARIES(${_tool}
Qt6::Core Qt6::Core
GeographicLib::GeographicLib_SHARED ${GeographicLib_LIBRARIES}
) )
TARGET_INCLUDE_DIRECTORIES(${_tool} PRIVATE ${GeographicLib_INCLUDE_DIRS})
NGL_INSTALL_TARGET(${_tool}) NGL_INSTALL_TARGET(${_tool})
ENDFOREACH() ENDFOREACH()
ENDIF() ENDIF()
@@ -90,7 +92,8 @@ IF(BUILD_TESTING AND TARGET LtsCoordTrans)
TARGET_LINK_LIBRARIES(lts_coord_trans_unit_test TARGET_LINK_LIBRARIES(lts_coord_trans_unit_test
LtsCoordTrans LtsCoordTrans
Qt6::Test Qt6::Test
GeographicLib::GeographicLib_SHARED ${GeographicLib_LIBRARIES}
) )
TARGET_INCLUDE_DIRECTORIES(lts_coord_trans_unit_test PRIVATE ${GeographicLib_INCLUDE_DIRS})
ADD_TEST(NAME lts_coord_trans_unit_test COMMAND $<TARGET_FILE:lts_coord_trans_unit_test>) ADD_TEST(NAME lts_coord_trans_unit_test COMMAND $<TARGET_FILE:lts_coord_trans_unit_test>)
ENDIF() ENDIF()