Skip to content

Commit

Permalink
Merge pull request #456 from atsign-foundation/simpler-deps
Browse files Browse the repository at this point in the history
chore: Simpler deps
  • Loading branch information
XavierChanth authored Dec 5, 2024
2 parents 0f21977 + 60a442a commit c937841
Show file tree
Hide file tree
Showing 14 changed files with 1,795 additions and 1,656 deletions.
101 changes: 50 additions & 51 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ cmake_policy(SET CMP0135 NEW)
include(GNUInstallDirs)

project(
atsdk
VERSION 0.0.1
DESCRIPTION "Atsign's atSDK library"
HOMEPAGE_URL https://atsign.com
LANGUAGES C
atsdk
VERSION 0.0.1
DESCRIPTION "Atsign's atSDK library"
HOMEPAGE_URL https://atsign.com
LANGUAGES C
)

# Determine if atchops is being built as a subproject using add_subdirectory()
if (NOT DEFINED ATSDK_AS_SUBPROJECT)
set(ATSDK_AS_SUBPROJECT ON)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(ATSDK_AS_SUBPROJECT OFF)
endif ()
endif ()
if(NOT DEFINED ATSDK_AS_SUBPROJECT)
set(ATSDK_AS_SUBPROJECT ON)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(ATSDK_AS_SUBPROJECT OFF)
endif()
endif()
message(STATUS "[ATSDK] ATSDK_AS_SUBPROJECT: ${ATSDK_AS_SUBPROJECT}")

# install each package
Expand All @@ -45,47 +45,46 @@ message(STATUS "Building atauth")
set(ATAUTH_BUILD_TESTS ${ATSDK_BUILD_TESTS})
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/packages/atauth)

if (NOT ESP_PLATFORM)
# install dependencies
set(
ATSDK_TARGETS
mbedtls
mbedx509
mbedcrypto
everest
p256m
uuid4-static
atchops
cjson
atlogger
atclient
atcommons
atauth
)
if(NOT ESP_PLATFORM)
# install dependencies
set(
ATSDK_TARGETS
mbedtls
mbedx509
mbedcrypto
everest
p256m
atchops
cjson
atlogger
atclient
atcommons
atauth
)

install(
TARGETS ${ATSDK_TARGETS}
EXPORT ${PROJECT_NAME}-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(
TARGETS ${ATSDK_TARGETS}
EXPORT ${PROJECT_NAME}-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

# export dependencies
if (NOT ATSDK_AS_SUBPROJECT)
export(PACKAGE ${PROJECT_NAME})
# export dependencies
if(NOT ATSDK_AS_SUBPROJECT)
export(PACKAGE ${PROJECT_NAME})

# install as a config.cmake
install(
EXPORT ${PROJECT_NAME}-config
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
FILE ${PROJECT_NAME}-config.cmake
)
# install as a config.cmake
install(
EXPORT ${PROJECT_NAME}-config
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
FILE ${PROJECT_NAME}-config.cmake
)

# export the config.cmake
export(
EXPORT ${PROJECT_NAME}-config
NAMESPACE ${PROJECT_NAME}::
FILE "cmake/${PROJECT_NAME}-config.cmake"
)
endif ()
endif ()
# export the config.cmake
export(
EXPORT ${PROJECT_NAME}-config
NAMESPACE ${PROJECT_NAME}::
FILE "cmake/${PROJECT_NAME}-config.cmake"
)
endif()
endif()
17 changes: 0 additions & 17 deletions cmake/find_uuid4.cmake

This file was deleted.

Loading

0 comments on commit c937841

Please sign in to comment.