This commit is contained in:
Andrei Astafev 2021-06-24 12:03:01 +03:00
parent c79d5268d3
commit aebd1d3088
2 changed files with 23 additions and 25 deletions

View File

@ -1,13 +1,13 @@
if(NOT LIBIONOBASE_PREFIX STREQUAL CMAKE_BINARY_DIR) if(NOT LIBIONOBASE_IS_EXTERNAL_PROJECT)
set(LIBIONOBASE_PREFIX "" CACHE PATH "The path to the prefix of an libionobase installation") set(LIBIONOBASE_PREFIX "" CACHE PATH "The path to the prefix of an libionobase installation")
find_path( find_path(
LIBIONOBASE_INCLUDE_DIRS LIBIONOBASE_INCLUDE_DIRS
NAMES preprocmath/params.hpp NAMES ionobase/interchfor.hpp
PATHS ${LIBIONOBASE_PREFIX}/include) PATHS ${LIBIONOBASE_PREFIX}/include)
find_library( find_library(
LIBIONOBASE_LIBRARY LIBIONOBASE_LIBRARY
NAMES preprocmath NAMES ionobase
PATHS ${LIBIONOBASE_PREFIX}/lib) PATHS ${LIBIONOBASE_PREFIX}/lib)
if(LIBIONOBASE_INCLUDE_DIRS AND LIBIONOBASE_LIBRARY) if(LIBIONOBASE_INCLUDE_DIRS AND LIBIONOBASE_LIBRARY)

View File

@ -1,29 +1,27 @@
# Подключение внешних проектов # Подключение внешних проектов
include(ExternalProject) include(ExternalProject)
if(${IonobaseThirdparty_FIND_COMPONENTS} STREQUAL "headers") # cmake-format: off
ExternalProject_Add( list(APPEND _ext_project_args
libionobase libionobase
SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/libionobase SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/libionobase
INSTALL_DIR ${CMAKE_BINARY_DIR} INSTALL_DIR ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND "" DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR}
-DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR} ${CMLIB_EXT_PROJ_DEFAULT_ARGS} ${CMLIB_EXT_PROJ_DEFAULT_ARGS}
<SOURCE_DIR>
BUILD_COMMAND true
INSTALL_COMMAND make ionobase-install-headers)
else()
ExternalProject_Add(
libionobase
SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/libionobase
INSTALL_DIR ${CMAKE_BINARY_DIR}
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND
${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR} ${CMLIB_EXT_PROJ_DEFAULT_ARGS}
<SOURCE_DIR>) <SOURCE_DIR>)
if(IonobaseThirdparty_FIND_COMPONENTS STREQUAL "headers")
list(APPEND _ext_project_args
BUILD_COMMAND true
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} ionobase-install-headers)
endif() endif()
ExternalProject_Add(${_ext_project_args})
unset(_ext_project_args)
set(LIBIONOBASE_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE)
# cmake-format: on
set(LIBIONOBASE_PREFIX set(LIBIONOBASE_PREFIX
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}