Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
cmake: add Findamxp.cmake file
Browse files Browse the repository at this point in the history
Add Findamxp.cmake file to locate AMXP library of BAAPI and relevant
header files.

Signed-off-by: Anton Bilohai <[email protected]>
  • Loading branch information
abelog committed Jul 21, 2020
1 parent e85b88d commit 4b31821
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cmake/Findamxp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
# SPDX-FileCopyrightText: 2019-2020 the prplMesh contributors (see AUTHORS.md)
#
# This code is subject to the terms of the BSD+Patent license.
# See LICENSE file for more details.

find_library(AMXP_LIBRARY "libamxp.so" PATHS ${CMAKE_PREFIX_PATH}/usr/lib/)
find_path(AMXP_INCLUDE_DIRS
NAMES amxp_types.h amxp_register.h amxp_invoke.h amxp.h amxp_connect.h amxp_common.h amxp_error.h amxp_operators.h amxp_be_intf.h amxp_be.h amxp_subscribe.h amxp_be_mngr.h
PATH_SUFFIXES amxp
)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(amxp DEFAULT_MSG
AMXP_LIBRARY
AMXP_INCLUDE_DIRS
)

if (amxp_FOUND)
add_library(amxp UNKNOWN IMPORTED)

# Includes
set_target_properties(amxp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${AMXP_INCLUDE_DIRS}/"
)

# Library
set_target_properties(amxp PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${AMXP_LIBRARY}"
)

endif()

0 comments on commit 4b31821

Please sign in to comment.