Skip to content

Commit

Permalink
Remove mayaUsd_promoteHeaderListWithSubdir that I missed to remove in…
Browse files Browse the repository at this point in the history
… my previous commit.
  • Loading branch information
sabrih committed Mar 4, 2020
1 parent e3d4771 commit 056e830
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 46 deletions.
43 changes: 0 additions & 43 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -216,49 +216,6 @@ function(mayaUsd_get_unittest_target unittest_target unittest_basename)
set(${unittest_target} "${unittest_name}" PARENT_SCOPE)
endfunction()

function(mayaUsd_promoteHeaderListWithSubdir)
cmake_parse_arguments(PREFIX
""
"SUBDIR" # one_value keywords
"HEADERS;BASE_PATH" # multi_value keywords
${ARGN}
)

if (PREFIX_HEADERS)
set(headerFiles ${PREFIX_HEADERS})
else()
message(FATAL_ERROR "HEADERS keyword is not specified.")
endif()

set(basePath ${CMAKE_BINARY_DIR}/include)
if (PREFIX_BASE_PATH)
set(basePath ${basePath}/${PREFIX_BASE_PATH})
else()
set(basePath ${basePath}/mayaUsd)
endif()

if (PREFIX_SUBDIR)
set(basePath ${basePath}/${PREFIX_SUBDIR})
endif()

foreach(header ${headerFiles})
set(srcFile ${CMAKE_CURRENT_SOURCE_DIR}/${header})
set(dstFile ${basePath}/${header})

set(content "#pragma once\n#include \"${srcFile}\"\n")

if (NOT EXISTS ${dstFile})
message(STATUS "promoting: " ${srcFile})
file(WRITE ${dstFile} "${content}")
else()
file(READ ${dstFile} oldContent)
if (NOT "${content}" STREQUAL "${oldContent}")
message(STATUS "Promoting ${srcfile}")
file(WRITE ${dstFile} "${content}")
endif()
endif()
endforeach()
endfunction()
#
# mayaUsd_copyFiles( <target>
# [DESTINATION <destination>]
Expand Down
7 changes: 4 additions & 3 deletions lib/usd/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ set(headers
SIMD.h
)

mayaUsd_promoteHeaderListWithSubdir(
HEADERS
mayaUsd_promoteHeaderList(
HEADERS
${headers}
BASE_PATH ${TARGET_NAME}
BASEDIR
${TARGET_NAME}
)

# -----------------------------------------------------------------------------
Expand Down

0 comments on commit 056e830

Please sign in to comment.