Compare commits

...

4 Commits

Author SHA1 Message Date
c2b09e5cb2 myx-geo 2021-10-07 09:18:36 +03:00
ca4bce61f8 GeographicLib 2021-09-27 16:54:06 +03:00
0c2bf14955 MyxMath 2021-09-22 14:37:40 +03:00
5ab7845462 PvdProtocol 2021-09-22 14:24:51 +03:00
7 changed files with 270 additions and 0 deletions

40
FindGeographicLib.cmake Normal file
View File

@@ -0,0 +1,40 @@
# Look for GeographicLib
#
# Set
# GeographicLib_FOUND = GEOGRAPHICLIB_FOUND = TRUE
# GeographicLib_INCLUDE_DIRS = /usr/local/include
# GeographicLib_LIBRARIES = /usr/local/lib/libGeographic.so
# GeographicLib_LIBRARY_DIRS = /usr/local/lib
find_library (GeographicLib_LIBRARIES Geographic
PATHS "${CMAKE_INSTALL_PREFIX}/../GeographicLib/lib")
if (GeographicLib_LIBRARIES)
get_filename_component (GeographicLib_LIBRARY_DIRS
"${GeographicLib_LIBRARIES}" PATH)
get_filename_component (_ROOT_DIR "${GeographicLib_LIBRARY_DIRS}" PATH)
set (GeographicLib_INCLUDE_DIRS "${_ROOT_DIR}/include")
set (GeographicLib_BINARY_DIRS "${_ROOT_DIR}/bin")
if (NOT EXISTS "${GeographicLib_INCLUDE_DIRS}/GeographicLib/Config.h")
# On Debian systems the library is in e.g.,
# /usr/lib/x86_64-linux-gnu/libGeographic.so
# so try stripping another element off _ROOT_DIR
get_filename_component (_ROOT_DIR "${_ROOT_DIR}" PATH)
set (GeographicLib_INCLUDE_DIRS "${_ROOT_DIR}/include")
set (GeographicLib_BINARY_DIRS "${_ROOT_DIR}/bin")
if (NOT EXISTS "${GeographicLib_INCLUDE_DIRS}/GeographicLib/Config.h")
unset (GeographicLib_INCLUDE_DIRS)
unset (GeographicLib_LIBRARIES)
unset (GeographicLib_LIBRARY_DIRS)
unset (GeographicLib_BINARY_DIRS)
endif ()
endif ()
unset (_ROOT_DIR)
endif ()
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (GeographicLib DEFAULT_MSG
GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES
GeographicLib_INCLUDE_DIRS)
mark_as_advanced (GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES
GeographicLib_INCLUDE_DIRS)

45
FindMyxGeo.cmake Normal file
View File

@@ -0,0 +1,45 @@
if(NOT MYX_GEO_IS_EXTERNAL_PROJECT)
set(MYX_GEO_PREFIX "" CACHE PATH "The path to the prefix of an myx-geo installation")
set(MYX_GEO_INCLUDE_DIR "" CACHE PATH "The path to the headers of an myx-geo installation")
set(MYX_GEO_LIBRARY_DIR "" CACHE PATH "The path to the library of an myx-geo installation")
set(_search_paths "")
if(MYX_GEO_INCLUDE_DIR AND EXISTS ${MYX_GEO_INCLUDE_DIR})
list(APPEND _search_paths ${MYX_GEO_INCLUDE_DIR})
endif()
if(MYX_GEO_PREFIX AND EXISTS ${MYX_GEO_PREFIX})
list(APPEND _search_paths "${MYX_GEO_PREFIX}/include")
endif()
find_path(
MYX_GEO_INCLUDE_DIRS
NAMES myx/geo/const.hpp
PATHS ${_search_paths})
set(_search_paths "")
if(MYX_GEO_LIBRARY_DIR AND EXISTS ${MYX_GEO_LIBRARY_DIR})
list(APPEND _search_paths ${MYX_GEO_LIBRARY_DIR})
endif()
if(MYX_GEO_PREFIX AND EXISTS ${MYX_GEO_PREFIX})
list(APPEND _search_paths "${MYX_GEO_PREFIX}/lib")
endif()
find_library(
MYX_GEO_LIBRARIES
NAMES myx-geo
PATHS ${_search_paths})
unset(_search_paths)
if(MYX_GEO_INCLUDE_DIRS AND MYX_GEO_LIBRARIES)
set(MYX_GEO_FOUND TRUE)
endif()
if(MYX_GEO_FOUND)
if(NOT MYX_GEO_FIND_QUIETLY)
message(STATUS "Found myx-geo")
endif()
set(HAVE_MYX_GEO 1)
elseif(MYX_GEO_FOUND)
if(MYX_GEO_FIND_REQUIRED)
message(FATAL_ERROR "Could not find myx-geo")
endif()
endif()
endif()

View File

@@ -0,0 +1,39 @@
# Подключение внешних проектов
include(ExternalProject)
set(MYX_GEO_PREFIX
${CMAKE_BINARY_DIR}
CACHE FILEPATH "" FORCE)
set(MYX_GEO_INCLUDE_DIR
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}
CACHE PATH "" FORCE)
set(MYX_GEO_INCLUDE_DIRS
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}
CACHE PATH "" FORCE)
set(MYX_GEO_LIBRARY_DIR
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
CACHE PATH "" FORCE)
set(MYX_GEO_LIBRARIES
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-geo.a
CACHE FILEPATH "" FORCE)
# cmake-format: off
list(APPEND _ext_project_args
myx-geo
SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/myx-geo
INSTALL_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS ${CMLIB_EXT_PROJ_DEFAULT_ARGS}
<SOURCE_DIR>)
if(MyxGeoThirdparty_FIND_COMPONENTS STREQUAL "headers")
list(APPEND _ext_project_args
BUILD_COMMAND true
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} myx-geo-install-headers)
else()
list(APPEND _ext_project_args
BUILD_BYPRODUCTS ${MYX_GEO_LIBRARIES})
endif()
ExternalProject_Add(${_ext_project_args})
unset(_ext_project_args)
set(MYX_GEO_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE)
# cmake-format: on

45
FindMyxMath.cmake Normal file
View File

@@ -0,0 +1,45 @@
if(NOT MYX_MATH_IS_EXTERNAL_PROJECT)
set(MYX_MATH_PREFIX "" CACHE PATH "The path to the prefix of an myx-math installation")
set(MYX_MATH_INCLUDE_DIR "" CACHE PATH "The path to the headers of an myx-math installation")
set(MYX_MATH_LIBRARY_DIR "" CACHE PATH "The path to the library of an myx-math installation")
set(_search_paths "")
if(MYX_MATH_INCLUDE_DIR AND EXISTS ${MYX_MATH_INCLUDE_DIR})
list(APPEND _search_paths ${MYX_MATH_INCLUDE_DIR})
endif()
if(MYX_MATH_PREFIX AND EXISTS ${MYX_MATH_PREFIX})
list(APPEND _search_paths "${MYX_MATH_PREFIX}/include")
endif()
find_path(
MYX_MATH_INCLUDE_DIRS
NAMES myx/math/constants.hpp
PATHS ${_search_paths})
set(_search_paths "")
if(MYX_MATH_LIBRARY_DIR AND EXISTS ${MYX_MATH_LIBRARY_DIR})
list(APPEND _search_paths ${MYX_MATH_LIBRARY_DIR})
endif()
if(MYX_MATH_PREFIX AND EXISTS ${MYX_MATH_PREFIX})
list(APPEND _search_paths "${MYX_MATH_PREFIX}/lib")
endif()
find_library(
MYX_MATH_LIBRARIES
NAMES myx-math
PATHS ${_search_paths})
unset(_search_paths)
if(MYX_MATH_INCLUDE_DIRS AND MYX_MATH_LIBRARIES)
set(MYX_MATH_FOUND TRUE)
endif()
if(MYX_MATH_FOUND)
if(NOT MYX_MATH_FIND_QUIETLY)
message(STATUS "Found myx-math")
endif()
set(HAVE_MYX_MATH 1)
elseif(MYX_MATH_FOUND)
if(MYX_MATH_FIND_REQUIRED)
message(FATAL_ERROR "Could not find myx-math")
endif()
endif()
endif()

View File

@@ -0,0 +1,39 @@
# Подключение внешних проектов
include(ExternalProject)
set(MYX_MATH_PREFIX
${CMAKE_BINARY_DIR}
CACHE FILEPATH "" FORCE)
set(MYX_MATH_INCLUDE_DIR
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}
CACHE PATH "" FORCE)
set(MYX_MATH_INCLUDE_DIRS
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}
CACHE PATH "" FORCE)
set(MYX_MATH_LIBRARY_DIR
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
CACHE PATH "" FORCE)
set(MYX_MATH_LIBRARIES
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-math.a
CACHE FILEPATH "" FORCE)
# cmake-format: off
list(APPEND _ext_project_args
myx-math
SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/myx-math
INSTALL_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS ${CMLIB_EXT_PROJ_DEFAULT_ARGS}
<SOURCE_DIR>)
if(MyxRedisThirdparty_FIND_COMPONENTS STREQUAL "headers")
list(APPEND _ext_project_args
BUILD_COMMAND true
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} myx-math-install-headers)
else()
list(APPEND _ext_project_args
BUILD_BYPRODUCTS ${MYX_MATH_LIBRARIES})
endif()
ExternalProject_Add(${_ext_project_args})
unset(_ext_project_args)
set(MYX_MATH_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE)
# cmake-format: on

32
FindPvdProtocol.cmake Normal file
View File

@@ -0,0 +1,32 @@
if(NOT PVD_PROTOCOL_IS_EXTERNAL_PROJECT)
set(PVD_PROTOCOL_PREFIX "" CACHE PATH "The path to the prefix of an PVD protocols installation")
set(PVD_PROTOCOL_INCLUDE_DIR "" CACHE PATH "The path to the headers of an PVD protocols installation")
set(_search_paths "")
if(EXISTS PVD_PROTOCOL_INCLUDE_DIR)
list(APPEND _search_paths ${PVD_PROTOCOL_INCLUDE_DIR})
endif()
if(EXISTS PVD_PROTOCOL_PREFIX)
list(APPEND _search_paths "${PVD_PROTOCOL_PREFIX}/include")
endif()
find_path(
PVD_PROTOCOL_INCLUDE_DIRS
NAMES pvd/zg108g6/fsp/header.hpp
PATHS ${_search_paths})
unset(_search_paths)
if(PVD_PROTOCOL_INCLUDE_DIRS)
set(PVD_PROTOCOL_FOUND TRUE)
endif()
if(PVD_PROTOCOL_FOUND)
if(NOT PVD_PROTOCOL_FIND_QUIETLY)
message(STATUS "Found PVD protocol")
endif()
set(HAVE_PVD_PROTOCOL 1)
elseif(PVD_PROTOCOL_FOUND)
if(PVD_PROTOCOL_FIND_REQUIRED)
message(FATAL_ERROR "Could not find PVD protocol")
endif()
endif()
endif()

View File

@@ -0,0 +1,30 @@
# Подключение внешних проектов
include(ExternalProject)
set(PVD_PROTOCOL_PREFIX
${CMAKE_BINARY_DIR}
CACHE FILEPATH "" FORCE)
set(PVD_PROTOCOL_INCLUDE_DIR
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}
CACHE PATH "" FORCE)
set(PVD_PROTOCOL_INCLUDE_DIRS
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}
CACHE PATH "" FORCE)
# cmake-format: off
list(APPEND _ext_project_args
pvd-protocol
SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/pvd-protocol
INSTALL_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS ${CMLIB_EXT_PROJ_DEFAULT_ARGS}
<SOURCE_DIR>)
if(FcProtocolThirdparty_FIND_COMPONENTS STREQUAL "headers")
list(APPEND _ext_project_args
BUILD_COMMAND true
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} pvd-protocol-install-headers)
endif()
ExternalProject_Add(${_ext_project_args})
unset(_ext_project_args)
set(PVD_PROTOCOL_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE)
# cmake-format: on