This commit is contained in:
Andrei Astafev 2022-10-04 17:37:33 +03:00
parent 33a6c7c718
commit 5008ead41f
4 changed files with 29 additions and 4 deletions

View File

@ -1,4 +1,4 @@
set(MYX_CMAKE_PACKAGE_VERSION "1.99.77")
set(MYX_CMAKE_PACKAGE_VERSION "1.99.78")
if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()

View File

@ -36,10 +36,10 @@ if(MYX_CMAKE_DIR)
set(ENV{MYX_CMAKE_DIR} ${MYX_CMAKE_DIR})
endif()
if(DEFINED ENV{MYX_CMAKE_DIR})
find_package(MyxCMake 1.99.77 REQUIRED)
find_package(MyxCMake 1.99.78 REQUIRED)
else()
if(MYX_CMAKE_USE_SYSTEM)
find_package(MyxCMake 1.99.77 REQUIRED)
find_package(MyxCMake 1.99.78 REQUIRED)
else()
include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)
endif()

View File

@ -1 +1 @@
1.99.77
1.99.78

View File

@ -12,6 +12,31 @@ function(myx_target_setup NAME)
myx_message_fatal_error("Target ${NAME} does not exists.")
endif()
# Создание в каталоге ${CMAKE_BINARY_DIR} стандартных каталогов bin,include,lib,
# а также символических ссылок на каталоги в ${CMAKE_SOURCE_DIR}/files
if(NOT TARGET ${NAME}-populate-cmake-binary-dir)
add_custom_target(
${NAME}-populate-cmake-binary-dir
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/lib
# Ссылка на каталог с журналами
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/files/log
${CMAKE_BINARY_DIR}/log
# Ссылка на каталог с обрабатываемыми данными
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/files/var
${CMAKE_BINARY_DIR}/var
# Ссылка на каталог с постоянными данными
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/files/share
${CMAKE_BINARY_DIR}/share
# Ссылка на каталог настроек
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/files/etc
${CMAKE_BINARY_DIR}/etc)
)
add_dependencies(${NAME} ${NAME}-populate-cmake-binary-dir)
endif()
get_target_property(target_type ${NAME} TYPE)
foreach(iter ${ARG_PACKAGES})