update
This commit is contained in:
11
cmake/myx/lib/macro/CreateSymlink.cmake
Normal file
11
cmake/myx/lib/macro/CreateSymlink.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
macro(create_symlink original linkname)
|
||||
if(NOT EXISTS ${linkname})
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${original} ${linkname})
|
||||
else()
|
||||
file(CREATE_LINK ${original} ${linkname} SYMBOLIC)
|
||||
endif()
|
||||
endif()
|
||||
endmacro(create_symlink original linkname)
|
35
cmake/myx/lib/macro/FindPackages.cmake
Normal file
35
cmake/myx/lib/macro/FindPackages.cmake
Normal file
@ -0,0 +1,35 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
macro(myx_find_packages)
|
||||
set(options)
|
||||
set(oneValueArgs)
|
||||
set(multiValueArgs PACKAGES Boost Qt5 Qt5Private)
|
||||
|
||||
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
foreach(iter ${ARG_PACKAGES})
|
||||
find_package(${iter} REQUIRED)
|
||||
endforeach()
|
||||
|
||||
if(ARG_Boost)
|
||||
find_package(Boost COMPONENTS ${ARG_Boost} REQUIRED)
|
||||
endif()
|
||||
|
||||
if(ARG_Qt5)
|
||||
find_package(Qt5 COMPONENTS ${ARG_Qt5} REQUIRED)
|
||||
endif()
|
||||
|
||||
if(ARG_Qt5Private)
|
||||
foreach(iter ${ARG_Qt5Private})
|
||||
find_package("Qt5${iter}" COMPONENTS Private REQUIRED)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
foreach(iter IN LISTS oneValueArgs multiValueArgs)
|
||||
unset(ARG_${iter})
|
||||
endforeach()
|
||||
unset(ARG_UNPARSED_ARGUMENTS)
|
||||
unset(multiValueArgs)
|
||||
unset(oneValueArgs)
|
||||
unset(options)
|
||||
endmacro(myx_find_packages)
|
19
cmake/myx/lib/macro/InstallRelative.cmake
Normal file
19
cmake/myx/lib/macro/InstallRelative.cmake
Normal file
@ -0,0 +1,19 @@
|
||||
#[=======================================================================[.rst:
|
||||
install_relative
|
||||
----------------
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
macro(install_relative STRIP_DIRECTORY)
|
||||
set(options)
|
||||
set(oneValueArgs DESTINATION)
|
||||
set(multiValueArgs FILES)
|
||||
|
||||
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
foreach(FILE ${ARG_FILES})
|
||||
get_filename_component(DIR ${FILE} DIRECTORY)
|
||||
string(REPLACE ${STRIP_DIRECTORY} "" RELATIVE_DIR ${DIR})
|
||||
INSTALL(FILES ${FILE} DESTINATION ${ARG_DESTINATION}/${RELATIVE_DIR} ${ARG_UNPARSED_ARGUMENTS})
|
||||
endforeach()
|
||||
endmacro(install_relative STRIP_DIRECTORY)
|
Reference in New Issue
Block a user