From 0881b574dd89f577df8dfdbdc0c34989772b45e5 Mon Sep 17 00:00:00 2001 From: Alopez <alopez@iri.upc.edu> Date: Mon, 26 Aug 2019 13:51:41 +0200 Subject: [PATCH] Adapted to CMake plural variables *_DIRS and *_LIBRARIES --- Findasterx1_gps.cmake | 11 +++++++---- Findasterx1_process.cmake | 11 +++++++---- src/CMakeLists.txt | 12 ++++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Findasterx1_gps.cmake b/Findasterx1_gps.cmake index 9390402..f4aee72 100644 --- a/Findasterx1_gps.cmake +++ b/Findasterx1_gps.cmake @@ -1,17 +1,20 @@ #edit the following line to add the librarie's header files FIND_PATH(asterx1_gps_INCLUDE_DIR asterx1_gps.h asterx1exceptions.h stream_gps.h gps_types.h /usr/local/include/iri/asterx1_gps /usr/include/iri/asterx1_gps) -FIND_LIBRARY(asterx1_gps_LIBRARY +FIND_LIBRARY(asterx1_gps_LIBRARIES NAMES asterx1_gps PATHS /usr/local/lib/iri/asterx1_gps /usr/lib/iri/asterx1_gps) -IF (asterx1_gps_INCLUDE_DIR AND asterx1_gps_LIBRARY) +IF (asterx1_gps_INCLUDE_DIRS AND asterx1_gps_LIBRARIES) SET(asterx1_gps_FOUND TRUE) -ENDIF (asterx1_gps_INCLUDE_DIR AND asterx1_gps_LIBRARY) +ENDIF (asterx1_gps_INCLUDE_DIRS AND asterx1_gps_LIBRARIES) + +SET(asterx1_gps_INCLUDE_DIR ${asterx1_gps_INCLUDE_DIRS}) +SET(asterx1_gps_LIBRARY ${asterx1_gps_LIBRARIES}) IF (asterx1_gps_FOUND) IF (NOT asterx1_gps_FIND_QUIETLY) - MESSAGE(STATUS "Found asterx1_gps: ${asterx1_gps_LIBRARY}") + MESSAGE(STATUS "Found asterx1_gps: ${asterx1_gps_LIBRARIES}") ENDIF (NOT asterx1_gps_FIND_QUIETLY) ELSE (asterx1_gps_FOUND) IF (asterx1_gps_FIND_REQUIRED) diff --git a/Findasterx1_process.cmake b/Findasterx1_process.cmake index a6ae593..4756711 100644 --- a/Findasterx1_process.cmake +++ b/Findasterx1_process.cmake @@ -1,17 +1,20 @@ #edit the following line to add the librarie's header files FIND_PATH(asterx1_process_INCLUDE_DIR asterx1_process.h gps_types.h /usr/local/include/iri/asterx1_gps /usr/include/iri/asterx1_gps) -FIND_LIBRARY(asterx1_process_LIBRARY +FIND_LIBRARY(asterx1_process_LIBRARIES NAMES asterx1_process PATHS /usr/local/lib/iri/asterx1_gps /usr/lib/iri/asterx1_gps) -IF (asterx1_process_INCLUDE_DIR AND asterx1_process_LIBRARY) +IF (asterx1_process_INCLUDE_DIRS AND asterx1_process_LIBRARIES) SET(asterx1_process_FOUND TRUE) -ENDIF (asterx1_process_INCLUDE_DIR AND asterx1_process_LIBRARY) +ENDIF (asterx1_process_INCLUDE_DIRS AND asterx1_process_LIBRARIES) + +SET(asterx1_process_INCLUDE_DIR ${asterx1_process_INCLUDE_DIRS}) +SET(asterx1_process_LIBRARY ${asterx1_process_LIBRARIES}) IF (asterx1_process_FOUND) IF (NOT asterx1_process_FIND_QUIETLY) - MESSAGE(STATUS "Found asterx1_process: ${asterx1_process_LIBRARY}") + MESSAGE(STATUS "Found asterx1_process: ${asterx1_process_LIBRARIES}") ENDIF (NOT asterx1_process_FIND_QUIETLY) ELSE (asterx1_process_FOUND) IF (asterx1_process_FIND_REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 804091e..2d85f7d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,15 +16,15 @@ FIND_PACKAGE(comm) # add the necessary include directories INCLUDE_DIRECTORIES(../include/) -INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR}) -INCLUDE_DIRECTORIES(${comm_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${comm_INCLUDE_DIRS}) # create the shared library ADD_LIBRARY(asterx1_gps SHARED ${sources}) # link necessary libraries -TARGET_LINK_LIBRARIES(asterx1_gps ${iriutils_LIBRARY}) -TARGET_LINK_LIBRARIES(asterx1_gps ${comm_LIBRARY}) +TARGET_LINK_LIBRARIES(asterx1_gps ${iriutils_LIBRARIES}) +TARGET_LINK_LIBRARIES(asterx1_gps ${comm_LIBRARIES}) INSTALL(TARGETS asterx1_gps RUNTIME DESTINATION bin @@ -43,8 +43,8 @@ IF(gpstk_LIBRARY) # create the shared library ADD_LIBRARY(asterx1_process SHARED ${process_sources}) - TARGET_LINK_LIBRARIES(asterx1_process ${iriutils_LIBRARY}) - TARGET_LINK_LIBRARIES(asterx1_process ${comm_LIBRARY}) + TARGET_LINK_LIBRARIES(asterx1_process ${iriutils_LIBRARIES}) + TARGET_LINK_LIBRARIES(asterx1_process ${comm_LIBRARIES}) TARGET_LINK_LIBRARIES(asterx1_process gpstk) INSTALL(TARGETS asterx1_process -- GitLab