change STREQUAL to cmake_path(COMPARE

This commit is contained in:
pappeste
2021-06-15 19:24:13 -07:00
parent 1121299efc
commit daacd25fc9
2 changed files with 6 additions and 2 deletions
@@ -9,9 +9,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
cmake_policy(SET CMP0012 NEW) # new policy for the if that evaluates a boolean out of "if(NOT ${same_location})"
function(ly_copy source_file target_directory)
get_filename_component(target_filename "${source_file}" NAME)
if(NOT "${source_file}" STREQUAL "${target_directory}/${target_filename}")
cmake_path(COMPARE "${source_file}" EQUAL "${target_directory}/${target_filename}" same_location)
if(NOT ${same_location})
if(NOT EXISTS "${target_directory}")
file(MAKE_DIRECTORY "${target_directory}")
endif()
@@ -65,7 +65,8 @@ function(ly_copy source_file target_directory)
endif()
if(NOT "${source_file}" STREQUAL "${target_directory}/${target_filename}")
cmake_path(COMPARE "${source_file}" EQUAL "${target_directory}/${target_filename}" same_location)
if(NOT ${same_location})
if(NOT EXISTS "${target_directory}")
file(MAKE_DIRECTORY "${target_directory}")
endif()