@@ -46,18 +46,16 @@ function(_copy_headers LIBRARY_NAME)
4646 foreach (f ${_args_FILES} )
4747 set (infile "${CMAKE_CURRENT_SOURCE_DIR} /${f} " )
4848 set (outfile "${header_dest_dir} /${f} " )
49- list ( APPEND files_copied ${outfile} )
49+ get_filename_component (dir_to_create " ${outfile} " PATH )
5050 add_custom_command (
5151 OUTPUT ${outfile}
52- COMMAND
53- "${PYTHON_EXECUTABLE} "
54- "${PROJECT_SOURCE_DIR} /cmake/macros/copyHeaderForBuild.py"
55- "${infile} "
56- "${outfile} "
52+ COMMAND ${CMAKE_COMMAND} -E make_directory "${dir_to_create} "
53+ COMMAND ${CMAKE_COMMAND} -Dinfile="${infile} " -Doutfile="${outfile} " -P "${PROJECT_SOURCE_DIR} /cmake/macros/copyHeaderForBuild.cmake"
5754 MAIN_DEPENDENCY "${infile} "
5855 COMMENT "Copying ${f} ..."
5956 VERBATIM
60- )
57+ )
58+ list (APPEND files_copied ${outfile} )
6159 endforeach ()
6260 endif ()
6361
@@ -106,7 +104,7 @@ endfunction() # _plugInfo_subst
106104function (_pxrDoxyConfig_subst)
107105 configure_file (${CMAKE_SOURCE_DIR} /pxr/usd/lib/usd/Doxyfile.in
108106 ${CMAKE_BINARY_DIR} /Doxyfile
109- )
107+ )
110108endfunction ()
111109
112110# Install compiled python files alongside the python object,
@@ -128,7 +126,7 @@ function(_install_python LIBRARY_NAME)
128126 set (files_copied "" )
129127 foreach (file ${ip_FILES} )
130128 set (filesToInstall "" )
131- set (installDest
129+ set (installDest
132130 "${libPythonPrefix} /pxr/${LIBRARY_INSTALLNAME} " )
133131
134132 # Only attempt to compile .py files. Files like plugInfo.json may also
@@ -165,7 +163,7 @@ function(_install_python LIBRARY_NAME)
165163 message (FATAL_ERROR "Cannot have non-Python file ${file} in PYTHON_FILES." )
166164 endif ()
167165
168- # Note that we always install under lib/python/pxr, even if we are in
166+ # Note that we always install under lib/python/pxr, even if we are in
169167 # the third_party project. This means the import will always look like
170168 # 'from pxr import X'. We need to do this per-loop iteration because
171169 # the installDest may be different due to the presence of subdirs.
@@ -205,7 +203,7 @@ function(_install_resource_files NAME pluginInstallPrefix pluginToLibraryPath)
205203 _get_resources_dir(${pluginInstallPrefix} ${NAME} resourcesPath)
206204
207205 foreach (resourceFile ${ARGN} )
208- # A resource file may be specified like <src file>:<dst file> to
206+ # A resource file may be specified like <src file>:<dst file> to
209207 # indicate that it should be installed to a different location in
210208 # the resources area. Check if this is the case.
211209 string (REPLACE ":" ";" resourceFile "${resourceFile} " )
@@ -222,7 +220,7 @@ function(_install_resource_files NAME pluginInstallPrefix pluginToLibraryPath)
222220
223221 get_filename_component (dirPath ${resourceDestFile} PATH )
224222 get_filename_component (destFileName ${resourceDestFile} NAME )
225-
223+
226224 # plugInfo.json go through an initial template substitution step files
227225 # install it from the binary (gen) directory specified by the full
228226 # path. Otherwise, use the original relative path which is relative to
@@ -320,15 +318,15 @@ function(_get_install_dir path out)
320318endfunction () # get_install_dir
321319
322320function (_get_resources_dir_name output )
323- set (${output}
324- resources
321+ set (${output}
322+ resources
325323 PARENT_SCOPE)
326324endfunction () # _get_resources_dir_name
327325
328326function (_get_resources_dir pluginsPrefix pluginName output )
329327 _get_resources_dir_name(resourcesDir)
330- set (${output}
331- ${pluginsPrefix} /${pluginName} /${resourcesDir}
328+ set (${output}
329+ ${pluginsPrefix} /${pluginName} /${resourcesDir}
332330 PARENT_SCOPE)
333331endfunction () # _get_resources_dir
334332
@@ -643,7 +641,7 @@ function(_pxr_install_rpath rpathRef NAME)
643641 endforeach ()
644642
645643 set_target_properties (${NAME}
646- PROPERTIES
644+ PROPERTIES
647645 INSTALL_RPATH_USE_LINK_PATH TRUE
648646 INSTALL_RPATH "${final} "
649647 )
@@ -913,7 +911,7 @@ function(_pxr_python_module NAME)
913911 # Install .ui files.
914912 if (args_PYSIDE_UI_FILES)
915913 _install_pyside_ui_files(${LIBRARY_NAME} ${args_PYSIDE_UI_FILES} )
916- endif ()
914+ endif ()
917915
918916 # If no C++ files then we're done.
919917 if (NOT args_CPPFILES)
@@ -935,7 +933,7 @@ function(_pxr_python_module NAME)
935933
936934 # Convert the name of the library into the python module name
937935 # , e.g. _tf.so -> Tf. This is later used to determine the eventual
938- # install location as well as for inclusion into the __init__.py's
936+ # install location as well as for inclusion into the __init__.py's
939937 # __all__ list.
940938 _get_python_module_name(${LIBRARY_NAME} pyModuleName)
941939
@@ -945,7 +943,7 @@ function(_pxr_python_module NAME)
945943 )
946944
947945 # Always install under the 'pxr' module, rather than base on the
948- # project name. This makes importing consistent, e.g.
946+ # project name. This makes importing consistent, e.g.
949947 # 'from pxr import X'. Additionally, python libraries always install
950948 # into the default lib install, not into the third_party subdirectory
951949 # or similar.
@@ -1027,7 +1025,7 @@ function(_pxr_python_module NAME)
10271025 LIBRARY DESTINATION ${libInstallPrefix}
10281026 RUNTIME DESTINATION ${libInstallPrefix}
10291027 )
1030-
1028+
10311029 if (NOT "${PXR_PREFIX} " STREQUAL "" )
10321030 if (args_PRECOMPILED_HEADERS)
10331031 _pxr_enable_precompiled_header(${LIBRARY_NAME}
@@ -1190,7 +1188,7 @@ function(_pxr_library NAME)
11901188 #
11911189 # If we're building a monolithic library or individual static libraries,
11921190 # these libraries are not separately loadable at runtime. In these cases,
1193- # we don't need to specify the library's location, so we leave
1191+ # we don't need to specify the library's location, so we leave
11941192 # pluginToLibraryPath empty.
11951193 if (";${PXR_CORE_LIBS} ;" MATCHES ";${NAME} ;" )
11961194 if (NOT _building_monolithic AND NOT args_TYPE STREQUAL "STATIC" )
0 commit comments