From ffd19aa94dd36462fe6142fc27c0528e4b7b49ed Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Tue, 29 Jun 2021 08:14:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D0=B0=D0=BD=D0=B4=D0=B0=D1=80?= =?UTF-8?q?=D1=82=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B8=D0=BC=D1=91?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85,=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FindFsp.cmake | 45 ++++++++++++++++++++++++++++ FindFspThirdparty.cmake | 42 ++++++++++++++++++++++++++ FindIonobase.cmake | 50 ++++++++++++++++++++----------- FindIonobaseThirdparty.cmake | 13 ++++---- FindMyxlib.cmake | 47 ++++++++++++++++++----------- FindMyxlibThirdparty.cmake | 11 +++++-- FindPreproc.cmake | 50 ++++++++++++++++++++----------- FindPreprocThirdparty.cmake | 15 ++++++---- FindPreprocmath.cmake | 50 ++++++++++++++++++++----------- FindPreprocmathThirdparty.cmake | 13 ++++---- FindSignalView.cmake | 45 ++++++++++++++++++++++++++++ FindSignalViewThirdparty.cmake | 40 +++++++++++++++++++++++++ FindVeerProtocols.cmake | 14 ++++++--- FindVeerProtocolsThirdparty.cmake | 3 ++ 14 files changed, 348 insertions(+), 90 deletions(-) create mode 100644 FindFsp.cmake create mode 100644 FindFspThirdparty.cmake create mode 100644 FindSignalView.cmake create mode 100644 FindSignalViewThirdparty.cmake diff --git a/FindFsp.cmake b/FindFsp.cmake new file mode 100644 index 0000000..dd4f518 --- /dev/null +++ b/FindFsp.cmake @@ -0,0 +1,45 @@ +if(NOT FSP_IS_EXTERNAL_PROJECT) + set(FSP_PREFIX "" CACHE PATH "The path to the prefix of an libfsp installation") + set(FSP_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libfsp installation") + set(FSP_LIBRARY_DIR "" CACHE PATH "The path to the library of an libfsp installation") + + set(_search_paths "") + if(EXISTS FSP_INCLUDE_DIR) + list(APPEND _search_paths ${FSP_INCLUDE_DIR}) + endif() + if(EXISTS FSP_PREFIX) + list(APPEND _search_paths ${FSP_PREFIX}/include) + endif() + find_path( + FSP_INCLUDE_DIRS + NAMES fsp/mods.hpp + PATHS ${_search_paths}) + + set(_search_paths "") + if(EXISTS FSP_LIBRARY_DIR) + list(APPEND _search_paths ${FSP_LIBRARY_DIR}) + endif() + if(EXISTS FSP_PREFIX) + list(APPEND _search_paths ${FSP_PREFIX}/lib) + endif() + find_library( + FSP_LIBRARIES + NAMES fsp + PATHS ${_search_paths}) + unset(_search_paths) + + if(FSP_INCLUDE_DIRS AND FSP_LIBRARIES) + set(FSP_FOUND TRUE) + endif() + + if(FSP_FOUND) + if(NOT FSP_FIND_QUIETLY) + message(STATUS "Found libfsp") + endif() + set(HAVE_FSP 1) + elseif(FSP_FOUND) + if(FSP_FIND_REQUIRED) + message(FATAL_ERROR "Could not find libfsp") + endif() + endif() +endif() diff --git a/FindFspThirdparty.cmake b/FindFspThirdparty.cmake new file mode 100644 index 0000000..451bc22 --- /dev/null +++ b/FindFspThirdparty.cmake @@ -0,0 +1,42 @@ +# Подключение внешних проектов +include(ExternalProject) + +# cmake-format: off +list(APPEND _ext_project_args + libfsp + DEPENDS libpreprocmath libionobase myxlib + SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/libfsp + INSTALL_DIR ${CMAKE_BINARY_DIR} + DOWNLOAD_COMMAND "" + CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" + -DPREPROCMATH_PREFIX=${CMAKE_BINARY_DIR} + -DIONOBASE_PREFIX=${CMAKE_BINARY_DIR} + -DMYXLIB_PREFIX=${CMAKE_BINARY_DIR} + -DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR} + ${CMLIB_EXT_PROJ_DEFAULT_ARGS} ) +if(FspThirdparty_FIND_COMPONENTS STREQUAL "headers") + list(APPEND _ext_project_args + BUILD_COMMAND true + INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} fsp-install-headers) +endif() +ExternalProject_Add(${_ext_project_args}) +unset(_ext_project_args) + +set(FSP_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) +# cmake-format: on + +set(FSP_PREFIX + ${CMAKE_BINARY_DIR} + CACHE FILEPATH "" FORCE) +set(FSP_INCLUDE_DIR + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) +set(FSP_INCLUDE_DIRS + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) +set(FSP_LIBRARY_DIR + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} + CACHE PATH "" FORCE) +set(FSP_LIBRARIES + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libfsp.a + CACHE FILEPATH "" FORCE) diff --git a/FindIonobase.cmake b/FindIonobase.cmake index 9a15673..b54c560 100644 --- a/FindIonobase.cmake +++ b/FindIonobase.cmake @@ -1,28 +1,44 @@ -if(NOT LIBIONOBASE_IS_EXTERNAL_PROJECT) - set(LIBIONOBASE_PREFIX "" CACHE PATH "The path to the prefix of an libionobase installation") +if(NOT IONOBASE_IS_EXTERNAL_PROJECT) + set(IONOBASE_PREFIX "" CACHE PATH "The path to the prefix of an libionobase installation") + set(IONOBASE_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libionobase installation") + set(IONOBASE_LIBRARY_DIR "" CACHE PATH "The path to the library of an libionobase installation") + set(_search_paths "") + if(EXISTS IONOBASE_INCLUDE_DIR) + list(APPEND _search_paths ${IONOBASE_INCLUDE_DIR}) + endif() + if(EXISTS IONOBASE_PREFIX) + list(APPEND _search_paths ${IONOBASE_PREFIX}/include) + endif() find_path( - LIBIONOBASE_INCLUDE_DIRS + IONOBASE_INCLUDE_DIRS NAMES ionobase/interchfor.hpp - PATHS ${LIBIONOBASE_PREFIX}/include) - find_library( - LIBIONOBASE_LIBRARY - NAMES ionobase - PATHS ${LIBIONOBASE_PREFIX}/lib) + PATHS ${_search_paths}) - if(LIBIONOBASE_INCLUDE_DIRS AND LIBIONOBASE_LIBRARY) - get_filename_component(LIBIONOBASE_LIBRARY_DIR ${LIBIONOBASE_LIBRARY} - DIRECTORY CACHE) - set(LIBIONOBASE_FOUND TRUE) + set(_search_paths "") + if(EXISTS IONOBASE_LIBRARY_DIR) + list(APPEND _search_paths ${IONOBASE_LIBRARY_DIR}) + endif() + if(EXISTS IONOBASE_PREFIX) + list(APPEND _search_paths ${IONOBASE_PREFIX}/lib) + endif() + find_library( + IONOBASE_LIBRARIES + NAMES ionobase + PATHS ${_search_paths}) + unset(_search_paths) + + if(IONOBASE_INCLUDE_DIRS AND IONOBASE_LIBRARIES) + set(IONOBASE_FOUND TRUE) endif() - if(LIBIONOBASE_FOUND) - if(NOT LIBIONOBASE_FIND_QUIETLY) + if(IONOBASE_FOUND) + if(NOT IONOBASE_FIND_QUIETLY) message(STATUS "Found libionobase") endif() - set(HAVE_LIBIONOBASE 1) - elseif(LIBIONOBASE_FOUND) - if(LIBIONOBASE_FIND_REQUIRED) + set(HAVE_IONOBASE 1) + elseif(IONOBASE_FOUND) + if(IONOBASE_FIND_REQUIRED) message(FATAL_ERROR "Could not find libionobase") endif() endif() diff --git a/FindIonobaseThirdparty.cmake b/FindIonobaseThirdparty.cmake index 16f1cda..e22cbc0 100644 --- a/FindIonobaseThirdparty.cmake +++ b/FindIonobaseThirdparty.cmake @@ -20,18 +20,21 @@ endif() ExternalProject_Add(${_ext_project_args}) unset(_ext_project_args) -set(LIBIONOBASE_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) +set(IONOBASE_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) # cmake-format: on -set(LIBIONOBASE_PREFIX +set(IONOBASE_PREFIX ${CMAKE_BINARY_DIR} CACHE FILEPATH "" FORCE) -set(LIBIONOBASE_INCLUDE_DIRS +set(IONOBASE_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "" FORCE) -set(LIBIONOBASE_LIBRARY_DIR +set(IONOBASE_INCLUDE_DIRS + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) +set(IONOBASE_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} CACHE PATH "" FORCE) -set(LIBIONOBASE_LIBRARY +set(IONOBASE_LIBRARIES ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libionobase.a CACHE FILEPATH "" FORCE) diff --git a/FindMyxlib.cmake b/FindMyxlib.cmake index 06fc9b6..818aa23 100644 --- a/FindMyxlib.cmake +++ b/FindMyxlib.cmake @@ -1,26 +1,39 @@ if(NOT MYXLIB_IS_EXTERNAL_PROJECT) - set(MYXLIB_PREFIX - "" - CACHE PATH "The path to the prefix of an myxlib installation") + set(MYXLIB_PREFIX "" CACHE PATH "The path to the prefix of an myxlib installation") + set(MYXLIB_INCLUDE_DIR "" CACHE PATH "The path to the headers of an myxlib installation") + set(MYXLIB_LIBRARY_DIR "" CACHE PATH "The path to the library of an myxlib installation") + set(_search_paths "") + if(EXISTS MYXLIB_INCLUDE_DIR) + list(APPEND _search_paths ${MYXLIB_INCLUDE_DIR}) + endif() + if(EXISTS MYXLIB_PREFIX) + list(APPEND _search_paths ${MYXLIB_PREFIX}/include) + endif() find_path( MYXLIB_INCLUDE_DIRS NAMES myx/core/config.hpp - PATHS ${MYXLIB_PREFIX}/include) - find_library( - MYXLIB_QT_LIBRARY - NAMES myx-qt - PATHS ${MYXLIB_PREFIX}/lib) - find_library( - MYXLIB_FILESYSTEM_LIBRARY - NAMES myx-filesystem - PATHS ${MYXLIB_PREFIX}/lib) + PATHS ${_search_paths}) - if(MYXLIB_INCLUDE_DIRS - AND MYXLIB_QT_LIBRARY - AND MYXLIB_FILESYSTEM_LIBRARY) - get_filename_component(MYXLIB_LIBRARY_DIR ${MYXLIB_QT_LIBRARY} DIRECTORY - CACHE) + set(_search_paths "") + if(EXISTS MYXLIB_LIBRARY_DIR) + list(APPEND _search_paths ${MYXLIB_LIBRARY_DIR}) + endif() + if(EXISTS MYXLIB_PREFIX) + list(APPEND _search_paths ${MYXLIB_PREFIX}/lib) + endif() + find_library( + MYXLIB_QT_LIBRARIES + NAMES myx-qt + PATHS ${_search_paths}) + find_library( + MYXLIB_FILESYSTEM_LIBRARIES + NAMES myx-filesystem + PATHS ${_search_paths}) + unset(_search_paths) + set(MYXLIB_LIBRARIES ${MYXLIB_QT_LIBRARIES} ${MYXLIB_FILESYSTEM_LIBRARIES}) + + if(MYXLIB_INCLUDE_DIRS AND MYXLIB_LIBRARIES) set(MYXLIB_FOUND TRUE) endif() diff --git a/FindMyxlibThirdparty.cmake b/FindMyxlibThirdparty.cmake index 9a8d2df..2be305e 100644 --- a/FindMyxlibThirdparty.cmake +++ b/FindMyxlibThirdparty.cmake @@ -26,15 +26,22 @@ set(MYXLIB_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) set(MYXLIB_PREFIX ${CMAKE_BINARY_DIR} CACHE FILEPATH "" FORCE) +set(MYXLIB_INCLUDE_DIR + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) set(MYXLIB_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "" FORCE) set(MYXLIB_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} CACHE PATH "" FORCE) -set(MYXLIB_QT_LIBRARY +set(MYXLIB_QT_LIBRARIES ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-qt.a CACHE FILEPATH "" FORCE) -set(MYXLIB_FILESYSTEM_LIBRARY +set(MYXLIB_FILESYSTEM_LIBRARIES + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-filesystem.a + CACHE FILEPATH "" FORCE) +set(MYXLIB_LIBRARIES + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-qt.a ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-filesystem.a CACHE FILEPATH "" FORCE) diff --git a/FindPreproc.cmake b/FindPreproc.cmake index 67b159d..39410c9 100644 --- a/FindPreproc.cmake +++ b/FindPreproc.cmake @@ -1,28 +1,44 @@ -if(NOT LIBPREPROC_IS_EXTERNAL_PROJECT) - set(LIBPREPROC_PREFIX "" CACHE PATH "The path to the prefix of an libpreproc installation") +if(NOT PREPROC_IS_EXTERNAL_PROJECT) + set(PREPROC_PREFIX "" CACHE PATH "The path to the prefix of an libpreproc installation") + set(PREPROC_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libpreproc installation") + set(PREPROC_LIBRARY_DIR "" CACHE PATH "The path to the library of an libpreproc installation") + set(_search_paths "") + if(EXISTS PREPROC_INCLUDE_DIR) + list(APPEND _search_paths ${PREPROC_INCLUDE_DIR}) + endif() + if(EXISTS PREPROC_PREFIX) + list(APPEND _search_paths ${PREPROC_PREFIX}/include) + endif() find_path( - LIBPREPROC_INCLUDE_DIRS + PREPROC_INCLUDE_DIRS NAMES preproc/mark.hpp - PATHS ${LIBPREPROC_PREFIX}/include) - find_library( - LIBPREPROC_LIBRARY - NAMES preproc - PATHS ${LIBPREPROC_PREFIX}/lib) + PATHS ${_search_paths}) - if(LIBPREPROC_INCLUDE_DIRS AND LIBPREPROC_LIBRARY) - get_filename_component(LIBPREPROC_LIBRARY_DIR ${LIBPREPROC_LIBRARY} - DIRECTORY CACHE) - set(LIBPREPROC_FOUND TRUE) + set(_search_paths "") + if(EXISTS PREPROC_LIBRARY_DIR) + list(APPEND _search_paths ${PREPROC_LIBRARY_DIR}) + endif() + if(EXISTS PREPROC_PREFIX) + list(APPEND _search_paths ${PREPROC_PREFIX}/lib) + endif() + find_library( + PREPROC_LIBRARIES + NAMES fsp + PATHS ${_search_paths}) + unset(_search_paths) + + if(PREPROC_INCLUDE_DIRS AND PREPROC_LIBRARIES) + set(PREPROC_FOUND TRUE) endif() - if(LIBPREPROC_FOUND) - if(NOT LIBPREPROC_FIND_QUIETLY) + if(PREPROC_FOUND) + if(NOT PREPROC_FIND_QUIETLY) message(STATUS "Found libpreproc") endif() - set(HAVE_LIBPREPROC 1) - elseif(LIBPREPROC_FOUND) - if(LIBPREPROC_FIND_REQUIRED) + set(HAVE_PREPROC 1) + elseif(PREPROC_FOUND) + if(PREPROC_FIND_REQUIRED) message(FATAL_ERROR "Could not find libpreproc") endif() endif() diff --git a/FindPreprocThirdparty.cmake b/FindPreprocThirdparty.cmake index 85217ff..1b87cbf 100644 --- a/FindPreprocThirdparty.cmake +++ b/FindPreprocThirdparty.cmake @@ -9,7 +9,7 @@ list(APPEND _ext_project_args INSTALL_DIR ${CMAKE_BINARY_DIR} DOWNLOAD_COMMAND "" CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" - -DLIBPREPROCMATH_PREFIX=${CMAKE_BINARY_DIR} + -DPREPROCMATH_PREFIX=${CMAKE_BINARY_DIR} -DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR} ${CMLIB_EXT_PROJ_DEFAULT_ARGS} ) if(PreprocThirdparty_FIND_COMPONENTS STREQUAL "headers") @@ -20,18 +20,21 @@ endif() ExternalProject_Add(${_ext_project_args}) unset(_ext_project_args) -set(LIBPREPROC_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) +set(PREPROC_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) # cmake-format: on -set(LIBPREPROC_PREFIX +set(PREPROC_PREFIX ${CMAKE_BINARY_DIR} CACHE FILEPATH "" FORCE) -set(LIBPREPROC_INCLUDE_DIRS +set(PREPROC_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "" FORCE) -set(LIBPREPROC_LIBRARY_DIR +set(PREPROC_INCLUDE_DIRS + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) +set(PREPROC_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} CACHE PATH "" FORCE) -set(LIBPREPROC_LIBRARY +set(PREPROC_LIBRARIES ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libpreproc.a CACHE FILEPATH "" FORCE) diff --git a/FindPreprocmath.cmake b/FindPreprocmath.cmake index 70d46f0..935673b 100644 --- a/FindPreprocmath.cmake +++ b/FindPreprocmath.cmake @@ -1,28 +1,44 @@ -if(NOT LIBPREPROCMATH_IS_EXTERNAL_PROJECT) - set(LIBPREPROCMATH_PREFIX "" CACHE PATH "The path to the prefix of an libpreprocmath installation") +if(NOT PREPROCMATH_IS_EXTERNAL_PROJECT) + set(PREPROCMATH_PREFIX "" CACHE PATH "The path to the prefix of an libpreprocmath installation") + set(PREPROCMATH_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libpreprocmath installation") + set(PREPROCMATH_LIBRARY_DIR "" CACHE PATH "The path to the library of an libpreprocmath installation") + set(_search_paths "") + if(EXISTS PREPROCMATH_INCLUDE_DIR) + list(APPEND _search_paths ${PREPROCMATH_INCLUDE_DIR}) + endif() + if(EXISTS PREPROCMATH_PREFIX) + list(APPEND _search_paths ${PREPROCMATH_PREFIX}/include) + endif() find_path( - LIBPREPROCMATH_INCLUDE_DIRS + PREPROCMATH_INCLUDE_DIRS NAMES preprocmath/params.hpp - PATHS ${LIBPREPROCMATH_PREFIX}/include) - find_library( - LIBPREPROCMATH_LIBRARY - NAMES preprocmath - PATHS ${LIBPREPROCMATH_PREFIX}/lib) + PATHS ${_search_paths}) - if(LIBPREPROCMATH_INCLUDE_DIRS AND LIBPREPROCMATH_LIBRARY) - get_filename_component(LIBPREPROCMATH_LIBRARY_DIR ${LIBPREPROCMATH_LIBRARY} - DIRECTORY CACHE) - set(LIBPREPROCMATH_FOUND TRUE) + set(_search_paths "") + if(EXISTS PREPROCMATH_LIBRARY_DIR) + list(APPEND _search_paths ${PREPROCMATH_LIBRARY_DIR}) + endif() + if(EXISTS PREPROCMATH_PREFIX) + list(APPEND _search_paths ${PREPROCMATH_PREFIX}/lib) + endif() + find_library( + PREPROCMATH_LIBRARIES + NAMES preprocmath + PATHS ${_search_paths}) + unset(_search_paths) + + if(PREPROCMATH_INCLUDE_DIRS AND PREPROCMATH_LIBRARIES) + set(PREPROCMATH_FOUND TRUE) endif() - if(LIBPREPROCMATH_FOUND) - if(NOT LIBPREPROCMATH_FIND_QUIETLY) + if(PREPROCMATH_FOUND) + if(NOT PREPROCMATH_FIND_QUIETLY) message(STATUS "Found libpreprocmath") endif() - set(HAVE_LIBPREPROCMATH 1) - elseif(LIBPREPROCMATH_FOUND) - if(LIBPREPROCMATH_FIND_REQUIRED) + set(HAVE_PREPROCMATH 1) + elseif(PREPROCMATH_FOUND) + if(PREPROCMATH_FIND_REQUIRED) message(FATAL_ERROR "Could not find libpreprocmath") endif() endif() diff --git a/FindPreprocmathThirdparty.cmake b/FindPreprocmathThirdparty.cmake index 3e52f93..4829e65 100644 --- a/FindPreprocmathThirdparty.cmake +++ b/FindPreprocmathThirdparty.cmake @@ -18,18 +18,21 @@ endif() ExternalProject_Add(${_ext_project_args}) unset(_ext_project_args) -set(LIBPREPROCMATH_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) +set(PREPROCMATH_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) # cmake-format: on -set(LIBPREPROCMATH_PREFIX +set(PREPROCMATH_PREFIX ${CMAKE_BINARY_DIR} CACHE FILEPATH "" FORCE) -set(LIBPREPROCMATH_INCLUDE_DIRS +set(PREPROCMATH_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "" FORCE) -set(LIBPREPROCMATH_LIBRARY_DIR +set(PREPROCMATH_INCLUDE_DIRS + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) +set(PREPROCMATH_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} CACHE PATH "" FORCE) -set(LIBPREPROCMATH_LIBRARY +set(PREPROCMATH_LIBRARIES ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libpreprocmath.a CACHE FILEPATH "" FORCE) diff --git a/FindSignalView.cmake b/FindSignalView.cmake new file mode 100644 index 0000000..1c00106 --- /dev/null +++ b/FindSignalView.cmake @@ -0,0 +1,45 @@ +if(NOT SIGNALVIEW_IS_EXTERNAL_PROJECT) + set(SIGNALVIEW_PREFIX "" CACHE PATH "The path to the prefix of an libsignalview installation") + set(SIGNALVIEW_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libsignalview installation") + set(SIGNALVIEW_LIBRARY_DIR "" CACHE PATH "The path to the library of an libsignalview installation") + + set(_search_paths "") + if(EXISTS SIGNALVIEW_INCLUDE_DIR) + list(APPEND _search_paths ${SIGNALVIEW_INCLUDE_DIR}) + endif() + if(EXISTS SIGNALVIEW_PREFIX) + list(APPEND _search_paths ${SIGNALVIEW_PREFIX}/include) + endif() + find_path( + SIGNALVIEW_INCLUDE_DIRS + NAMES signalview/wndSignalView.hpp + PATHS ${_search_paths}) + + set(_search_paths "") + if(EXISTS SIGNALVIEW_LIBRARY_DIR) + list(APPEND _search_paths ${SIGNALVIEW_LIBRARY_DIR}) + endif() + if(EXISTS SIGNALVIEW_PREFIX) + list(APPEND _search_paths ${SIGNALVIEW_PREFIX}/lib) + endif() + find_library( + SIGNALVIEW_LIBRARIES + NAMES fsp + PATHS ${_search_paths}) + unset(_search_paths) + + if(SIGNALVIEW_INCLUDE_DIRS AND SIGNALVIEW_LIBRARIES) + set(SIGNALVIEW_FOUND TRUE) + endif() + + if(SIGNALVIEW_FOUND) + if(NOT SIGNALVIEW_FIND_QUIETLY) + message(STATUS "Found libsignalview") + endif() + set(HAVE_SIGNALVIEW 1) + elseif(SIGNALVIEW_FOUND) + if(SIGNALVIEW_FIND_REQUIRED) + message(FATAL_ERROR "Could not find libsignalview") + endif() + endif() +endif() diff --git a/FindSignalViewThirdparty.cmake b/FindSignalViewThirdparty.cmake new file mode 100644 index 0000000..b9ce1b2 --- /dev/null +++ b/FindSignalViewThirdparty.cmake @@ -0,0 +1,40 @@ +# Подключение внешних проектов +include(ExternalProject) + +# cmake-format: off +list(APPEND _ext_project_args + libsignalview + DEPENDS libpreprocmath + SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/libsignalview + INSTALL_DIR ${CMAKE_BINARY_DIR} + DOWNLOAD_COMMAND "" + CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" + -DPREPROCMATH_PREFIX=${CMAKE_BINARY_DIR} + -DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR} + ${CMLIB_EXT_PROJ_DEFAULT_ARGS} ) +if(SignalViewThirdparty_FIND_COMPONENTS STREQUAL "headers") + list(APPEND _ext_project_args + BUILD_COMMAND true + INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} signalview-install-headers) +endif() +ExternalProject_Add(${_ext_project_args}) +unset(_ext_project_args) + +set(SIGNALVIEW_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) +# cmake-format: on + +set(SIGNALVIEW_PREFIX + ${CMAKE_BINARY_DIR} + CACHE FILEPATH "" FORCE) +set(SIGNALVIEW_INCLUDE_DIR + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) +set(SIGNALVIEW_INCLUDE_DIRS + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) +set(SIGNALVIEW_LIBRARY_DIR + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} + CACHE PATH "" FORCE) +set(SIGNALVIEW_LIBRARIES + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libsignalview.a + CACHE FILEPATH "" FORCE) diff --git a/FindVeerProtocols.cmake b/FindVeerProtocols.cmake index 5547a4e..2caa676 100644 --- a/FindVeerProtocols.cmake +++ b/FindVeerProtocols.cmake @@ -1,12 +1,18 @@ if(NOT VEER_PROTOCOLS_IS_EXTERNAL_PROJECT) - set(VEER_PROTOCOLS_PREFIX - "" - CACHE PATH "The path to the prefix of an veer protocols installation") + set(VEER_PROTOCOLS_PREFIX "" CACHE PATH "The path to the prefix of an veer protocols installation") + set(VEER_PROTOCOLS_INCLUDE_DIR "" CACHE PATH "The path to the headers of an libfsp installation") + set(_search_paths "") + if(EXISTS VEER_PROTOCOLS_INCLUDE_DIR) + list(APPEND _search_paths ${VEER_PROTOCOLS_INCLUDE_DIR}) + endif() + if(EXISTS VEER_PROTOCOLS_PREFIX) + list(APPEND _search_paths ${VEER_PROTOCOLS_PREFIX}/include) + endif() find_path( VEER_PROTOCOLS_INCLUDE_DIRS NAMES veer/common/ports.hpp - PATHS ${VEER_PROTOCOLS_PREFIX}/include) + PATHS ${_search_paths}) if(VEER_PROTOCOLS_INCLUDE_DIRS) set(VEER_PROTOCOLS_FOUND TRUE) diff --git a/FindVeerProtocolsThirdparty.cmake b/FindVeerProtocolsThirdparty.cmake index e3d1dd7..4b8742f 100644 --- a/FindVeerProtocolsThirdparty.cmake +++ b/FindVeerProtocolsThirdparty.cmake @@ -26,6 +26,9 @@ set(VEER_PROTOCOLS_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE) set(VEER_PROTOCOLS_PREFIX ${CMAKE_BINARY_DIR} CACHE FILEPATH "" FORCE) +set(VEER_PROTOCOLS_INCLUDE_DIR + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} + CACHE PATH "" FORCE) set(VEER_PROTOCOLS_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "" FORCE)