From 9d0d26c1f979caef17fac551bc24b26dc45b7cf8 Mon Sep 17 00:00:00 2001 From: Vahan Aghajanyan Date: Thu, 2 Nov 2023 10:27:15 +0100 Subject: [PATCH] Use proper CMake constant to prevent usage conflicts. --- src/CMakeLists.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ccb807b..ad88fd6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,18 +1,17 @@ set(TARGET erkir) set(HEADERS - ${CMAKE_SOURCE_DIR}/include/cartesianpoint.h - ${CMAKE_SOURCE_DIR}/include/coordinate.h - ${CMAKE_SOURCE_DIR}/include/datum.h - ${CMAKE_SOURCE_DIR}/include/ellipsoidalpoint.h - ${CMAKE_SOURCE_DIR}/include/export.h - ${CMAKE_SOURCE_DIR}/include/point.h - ${CMAKE_SOURCE_DIR}/include/sphericalpoint.h - ${CMAKE_SOURCE_DIR}/include/vector3d.h + ${CMAKE_CURRENT_SOURCE_DIR}/../include/cartesianpoint.h + ${CMAKE_CURRENT_SOURCE_DIR}/../include/coordinate.h + ${CMAKE_CURRENT_SOURCE_DIR}/../include/datum.h + ${CMAKE_CURRENT_SOURCE_DIR}/../include/ellipsoidalpoint.h + ${CMAKE_CURRENT_SOURCE_DIR}/../include/export.h + ${CMAKE_CURRENT_SOURCE_DIR}/../include/point.h + ${CMAKE_CURRENT_SOURCE_DIR}/../include/sphericalpoint.h + ${CMAKE_CURRENT_SOURCE_DIR}/../include/vector3d.h ) -add_library(${TARGET} - ${HEADERS} +set(SOURCES cartesianpoint.cpp coordinate.cpp datum.cpp @@ -22,6 +21,8 @@ add_library(${TARGET} vector3d.cpp ) +add_library(${TARGET} ${HEADERS} ${SOURCES}) + add_library(erkir::erkir ALIAS erkir) # Append a postfix for the debug version of the library @@ -30,7 +31,7 @@ set_target_properties(${TARGET} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX} # Specify the include directories for the target target_include_directories(${TARGET} PUBLIC - "$" + "$" "$") if (MSVC)