fix: add LINK_DIRECTORIES for GeographicLib in LtsCoordTrans

- Add LINK_DIRECTORIES() to properly link GeographicLib
- Apply to library, tools, and test targets
- Fixes undefined reference errors during DEB package build

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-10-09 14:34:58 +00:00
1 parent 9992af628a
commit b915bacc62
1 file changed
+3
@@ -27,6 +27,7 @@ if (GeographicLib_FOUND)
PRIVATE ${GeographicLib_LIBRARIES}
)
TARGET_INCLUDE_DIRECTORIES(LtsCoordTrans PRIVATE ${GeographicLib_INCLUDE_DIRS})
LINK_DIRECTORIES(${GeographicLib_LIBRARY_DIRS})
else()
message(STATUS "GeographicLib not found; building LtsCoordTrans without it")
endif()
@@ -72,6 +73,7 @@ IF(TARGET LtsCoordTrans)
${GeographicLib_LIBRARIES}
)
TARGET_INCLUDE_DIRECTORIES(${_tool} PRIVATE ${GeographicLib_INCLUDE_DIRS})
LINK_DIRECTORIES(${GeographicLib_LIBRARY_DIRS})
NGL_INSTALL_TARGET(${_tool})
ENDFOREACH()
ENDIF()
@@ -95,5 +97,6 @@ IF(BUILD_TESTING AND TARGET LtsCoordTrans)
${GeographicLib_LIBRARIES}
)
TARGET_INCLUDE_DIRECTORIES(lts_coord_trans_unit_test PRIVATE ${GeographicLib_INCLUDE_DIRS})
LINK_DIRECTORIES(${GeographicLib_LIBRARY_DIRS})
ADD_TEST(NAME lts_coord_trans_unit_test COMMAND $<TARGET_FILE:lts_coord_trans_unit_test>)
ENDIF()