Compare commits
No commits in common. "7396f77054104c378451d0066707c925f4643fd8" and "105ed96f5f9ee304d1fef7450273a4598e23942e" have entirely different histories.
7396f77054
...
105ed96f5f
@ -54,9 +54,6 @@ add_subdirectory(src/myx/core)
|
|||||||
add_subdirectory(src/myx/filesystem)
|
add_subdirectory(src/myx/filesystem)
|
||||||
add_subdirectory(src/myx/qt)
|
add_subdirectory(src/myx/qt)
|
||||||
|
|
||||||
# Цель, используемая только для установки заголовочных файлов без компиляции проекта
|
|
||||||
add_custom_target(myxlib-install-headers COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=base-dev -P
|
|
||||||
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
|
|
||||||
# Примеры
|
# Примеры
|
||||||
if(MYXLIB_BUILD_EXAMPLES)
|
if(MYXLIB_BUILD_EXAMPLES)
|
||||||
add_subdirectory(examples/core)
|
add_subdirectory(examples/core)
|
||||||
|
@ -1,32 +1,17 @@
|
|||||||
if(NOT MYXLIB_PREFIX STREQUAL CMAKE_BINARY_DIR)
|
set(MYXLIB_PREFIX "" CACHE PATH "The path to the previx of an myxlib installation")
|
||||||
set(MYXLIB_PREFIX
|
|
||||||
""
|
|
||||||
CACHE PATH "The path to the previx of an myxlib installation")
|
|
||||||
|
|
||||||
find_path(
|
find_path(MYXLIB_INCLUDE_DIRS NAMES myx/core/config.hpp PATHS ${MYXLIB_PREFIX}/include)
|
||||||
MYXLIB_INCLUDE_DIRS
|
find_library(MYXLIB_QT_LIBRARY NAMES myx-qt PATHS ${MYXLIB_PREFIX}/lib)
|
||||||
NAMES myx/core/config.hpp
|
find_library(MYXLIB_FILESYSTEM_LIBRARY NAMES myx-filesystem PATHS ${MYXLIB_PREFIX}/lib)
|
||||||
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)
|
|
||||||
|
|
||||||
if(MYXLIB_INCLUDE_DIRS
|
if(MYXLIB_INCLUDE_DIRS AND MYXLIB_QT_LIBRARY AND MYXLIB_FILESYSTEM_LIBRARY)
|
||||||
AND MYXLIB_QT_LIBRARY
|
get_filename_component(MYXLIB_LIBRARY_DIR ${MYXLIB_QT_LIBRARY} DIRECTORY CACHE)
|
||||||
AND MYXLIB_FILESYSTEM_LIBRARY)
|
|
||||||
get_filename_component(MYXLIB_LIBRARY_DIR ${MYXLIB_QT_LIBRARY} DIRECTORY
|
|
||||||
CACHE)
|
|
||||||
set(MYXLIB_FOUND TRUE)
|
set(MYXLIB_FOUND TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MYXLIB_FOUND)
|
if(MYXLIB_FOUND)
|
||||||
if(NOT MYXLIB_FIND_QUIETLY)
|
if(NOT MYXLIB_FIND_QUIETLY)
|
||||||
message(STATUS "Found myxlib")
|
MESSAGE(STATUS "Found myxlib")
|
||||||
endif()
|
endif()
|
||||||
set(HAVE_MYXLIB 1)
|
set(HAVE_MYXLIB 1)
|
||||||
elseif(MYXLIB_FOUND)
|
elseif(MYXLIB_FOUND)
|
||||||
@ -34,4 +19,3 @@ if(NOT MYXLIB_PREFIX STREQUAL CMAKE_BINARY_DIR)
|
|||||||
message(FATAL_ERROR "Could not find myxlib")
|
message(FATAL_ERROR "Could not find myxlib")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
@ -1,40 +1,14 @@
|
|||||||
# Подключение внешних проектов
|
ExternalProject_Add(
|
||||||
include(ExternalProject)
|
|
||||||
|
|
||||||
# cmake-format: off
|
|
||||||
list(APPEND _ext_project_args
|
|
||||||
myxlib
|
myxlib
|
||||||
SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/myxlib
|
SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/myxlib
|
||||||
INSTALL_DIR ${CMAKE_BINARY_DIR}
|
INSTALL_DIR ${CMAKE_BINARY_DIR}
|
||||||
DOWNLOAD_COMMAND ""
|
DOWNLOAD_COMMAND ""
|
||||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
|
CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR} ${CMLIB_EXT_PROJ_DEFAULT_ARGS} <SOURCE_DIR>
|
||||||
-DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR}
|
|
||||||
${CMLIB_EXT_PROJ_DEFAULT_ARGS}
|
|
||||||
<SOURCE_DIR>)
|
|
||||||
|
|
||||||
if(MyxlibThirdparty_FIND_COMPONENTS STREQUAL "headers")
|
|
||||||
list(APPEND _ext_project_args
|
|
||||||
BUILD_COMMAND true
|
BUILD_COMMAND true
|
||||||
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} myxlib-install-headers)
|
)
|
||||||
endif()
|
|
||||||
ExternalProject_Add(${_ext_project_args})
|
|
||||||
unset(_ext_project_args)
|
|
||||||
|
|
||||||
set(MYXLIB_IS_EXTERNAL_PROJECT ON CACHE BOOL "" FORCE)
|
set(MYXLIB_PREFIX ${CMAKE_BINARY_DIR} CACHE FILEPATH "" FORCE)
|
||||||
# cmake-format: on
|
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_PREFIX
|
set(MYXLIB_QT_LIBRARY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-qt.a CACHE FILEPATH "" FORCE)
|
||||||
${CMAKE_BINARY_DIR}
|
set(MYXLIB_FILESYSTEM_LIBRARY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-filesystem.a CACHE FILEPATH "" FORCE)
|
||||||
CACHE FILEPATH "" 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
|
|
||||||
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-qt.a
|
|
||||||
CACHE FILEPATH "" FORCE)
|
|
||||||
set(MYXLIB_FILESYSTEM_LIBRARY
|
|
||||||
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmyx-filesystem.a
|
|
||||||
CACHE FILEPATH "" FORCE)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user