mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
1086016477
- Simplify error checking when using execute_process. - Set BUILD_SHARED_LIBS to OFF when building dependencies. This is normally not needed, but msgpack interprets an unset BUILD_SHARED_LIBS to build a shared library, which is the opposite of the cmake behavior. - Move function check_lua_module to Util.cmake. - Remove unnecessary code. - Make variable naming more consistent
21 lines
506 B
CMake
21 lines
506 B
CMake
# Copy multiple files to destination, based on a glob expression
|
|
# - FROM_GLOB
|
|
# - TO
|
|
|
|
if(NOT FROM_GLOB)
|
|
message(FATAL_ERROR "FROM_GLOB must be set")
|
|
endif()
|
|
if(NOT TO)
|
|
message(FATAL_ERROR "TO must be set")
|
|
endif()
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TO})
|
|
|
|
file(GLOB files ${FROM_GLOB})
|
|
foreach(file ${files})
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${file} ${TO} RESULT_VARIABLE rv)
|
|
if(rv)
|
|
message(FATAL_ERROR "Error copying ${file}")
|
|
endif()
|
|
endforeach()
|