init
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# Same syntax as find_package
|
||||
find_dependency(Threads REQUIRED)
|
||||
|
||||
# Add the targets file
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/unitree_sdk2Targets.cmake")
|
@@ -0,0 +1,52 @@
|
||||
# This is a basic version file for the Config-mode of find_package().
|
||||
# It is used by write_basic_package_version_file() as input file for configure_file()
|
||||
# to create a version-file which can be installed along a config.cmake file.
|
||||
#
|
||||
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
||||
# the requested version string are exactly the same and it sets
|
||||
# PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version.
|
||||
# The tweak version component is ignored.
|
||||
# The variable CVF_VERSION must be set before calling configure_file().
|
||||
|
||||
|
||||
set(PACKAGE_VERSION "2.0.0")
|
||||
|
||||
if("2.0.0" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
|
||||
set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
set(CVF_VERSION_NO_TWEAK "2.0.0")
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
|
||||
set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
|
||||
endif()
|
||||
|
||||
if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
|
||||
|
||||
# if the installed project requested no architecture check, don't perform the check
|
||||
if("FALSE")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
|
||||
math(EXPR installedBits "8 * 8")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
endif()
|
96
unitree_SDK/lib/cmake/unitree_sdk2/unitree_sdk2Targets.cmake
Normal file
96
unitree_SDK/lib/cmake/unitree_sdk2/unitree_sdk2Targets.cmake
Normal file
@@ -0,0 +1,96 @@
|
||||
if(CMAKE_VERSION VERSION_LESS 3.5.0)
|
||||
message(FATAL_ERROR "This file relies on consumers using CMake 3.5.0 or greater.")
|
||||
endif()
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(VERSION 2.6)
|
||||
|
||||
# Commands may need to know the format version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
|
||||
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
||||
set(_targetsDefined)
|
||||
set(_targetsNotDefined)
|
||||
set(_expectedTargets)
|
||||
foreach(_expectedTarget unitree_sdk2)
|
||||
list(APPEND _expectedTargets ${_expectedTarget})
|
||||
if(NOT TARGET ${_expectedTarget})
|
||||
list(APPEND _targetsNotDefined ${_expectedTarget})
|
||||
endif()
|
||||
if(TARGET ${_expectedTarget})
|
||||
list(APPEND _targetsDefined ${_expectedTarget})
|
||||
endif()
|
||||
endforeach()
|
||||
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
|
||||
unset(_targetsDefined)
|
||||
unset(_targetsNotDefined)
|
||||
unset(_expectedTargets)
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
return()
|
||||
endif()
|
||||
if(NOT "${_targetsDefined}" STREQUAL "")
|
||||
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
|
||||
endif()
|
||||
unset(_targetsDefined)
|
||||
unset(_targetsNotDefined)
|
||||
unset(_expectedTargets)
|
||||
|
||||
|
||||
# Compute the installation prefix relative to this file.
|
||||
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
if(_IMPORT_PREFIX STREQUAL "/")
|
||||
set(_IMPORT_PREFIX "")
|
||||
endif()
|
||||
|
||||
# Create imported target ddsc and ddscxx
|
||||
add_library(ddsc SHARED IMPORTED GLOBAL)
|
||||
set_target_properties(ddsc PROPERTIES
|
||||
IMPORTED_LOCATION ${_IMPORT_PREFIX}/lib/libddsc.so
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include"
|
||||
INTERFACE_LINK_LIBRARIES "Threads::Threads"
|
||||
IMPORTED_NO_SONAME TRUE)
|
||||
|
||||
add_library(ddscxx SHARED IMPORTED GLOBAL)
|
||||
set_target_properties(ddscxx PROPERTIES
|
||||
IMPORTED_LOCATION ${_IMPORT_PREFIX}/lib/libddscxx.so
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include/ddscxx"
|
||||
INTERFACE_LINK_LIBRARIES "Threads::Threads"
|
||||
IMPORTED_NO_SONAME TRUE)
|
||||
|
||||
# Create imported target unitree_sdk2
|
||||
add_library(unitree_sdk2 STATIC IMPORTED GLOBAL)
|
||||
set_target_properties(unitree_sdk2 PROPERTIES
|
||||
IMPORTED_LOCATION ${_IMPORT_PREFIX}/lib/libunitree_sdk2.a
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include"
|
||||
INTERFACE_LINK_LIBRARIES "ddsc;ddscxx;Threads::Threads"
|
||||
LINKER_LANGUAGE CXX
|
||||
)
|
||||
|
||||
# Cleanup temporary variables.
|
||||
set(_IMPORT_PREFIX)
|
||||
|
||||
# Loop over all imported files and verify that they actually exist
|
||||
foreach(target ${_IMPORT_CHECK_TARGETS} )
|
||||
foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
|
||||
if(NOT EXISTS "${file}" )
|
||||
message(FATAL_ERROR "The imported target \"${target}\" references the file
|
||||
\"${file}\"
|
||||
but this file does not exist. Possible reasons include:
|
||||
* The file was deleted, renamed, or moved to another location.
|
||||
* An install or uninstall procedure did not complete successfully.
|
||||
* The installation package was faulty and contained
|
||||
\"${CMAKE_CURRENT_LIST_FILE}\"
|
||||
but not all the files it references.
|
||||
")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_IMPORT_CHECK_FILES_FOR_${target})
|
||||
endforeach()
|
||||
unset(_IMPORT_CHECK_TARGETS)
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
BIN
unitree_SDK/lib/libddsc.so
Normal file
BIN
unitree_SDK/lib/libddsc.so
Normal file
Binary file not shown.
1
unitree_SDK/lib/libddsc.so.0
Normal file
1
unitree_SDK/lib/libddsc.so.0
Normal file
@@ -0,0 +1 @@
|
||||
libddsc.so
|
BIN
unitree_SDK/lib/libddscxx.so
Normal file
BIN
unitree_SDK/lib/libddscxx.so
Normal file
Binary file not shown.
1
unitree_SDK/lib/libddscxx.so.0
Normal file
1
unitree_SDK/lib/libddscxx.so.0
Normal file
@@ -0,0 +1 @@
|
||||
libddscxx.so
|
BIN
unitree_SDK/lib/libunitree_sdk2.a
Normal file
BIN
unitree_SDK/lib/libunitree_sdk2.a
Normal file
Binary file not shown.
Reference in New Issue
Block a user