diff --git a/FindIonobase.cmake b/FindIonobase.cmake index bf37eae..9a15673 100644 --- a/FindIonobase.cmake +++ b/FindIonobase.cmake @@ -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") find_path( LIBIONOBASE_INCLUDE_DIRS - NAMES preprocmath/params.hpp + NAMES ionobase/interchfor.hpp PATHS ${LIBIONOBASE_PREFIX}/include) find_library( LIBIONOBASE_LIBRARY - NAMES preprocmath + NAMES ionobase PATHS ${LIBIONOBASE_PREFIX}/lib) if(LIBIONOBASE_INCLUDE_DIRS AND LIBIONOBASE_LIBRARY) diff --git a/FindIonobaseThirdparty.cmake b/FindIonobaseThirdparty.cmake index 1124bef..16f1cda 100644 --- a/FindIonobaseThirdparty.cmake +++ b/FindIonobaseThirdparty.cmake @@ -1,29 +1,27 @@ # Подключение внешних проектов include(ExternalProject) -if(${IonobaseThirdparty_FIND_COMPONENTS} STREQUAL "headers") - 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} - - 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} - ) +# cmake-format: off +list(APPEND _ext_project_args + 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} + ) + +if(IonobaseThirdparty_FIND_COMPONENTS STREQUAL "headers") + list(APPEND _ext_project_args + BUILD_COMMAND true + INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} ionobase-install-headers) 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 ${CMAKE_BINARY_DIR}