Fix GeographicLib linking - remove invalid TARGET_LINK_DIRECTORIES calls

- TARGET_LINK_DIRECTORIES is not a standard CMake command
- Rely on  full path for linking
- Applied to LtsCoordTrans library, tools, and test executable

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