Makeprojects
Loading...
Searching...
No Matches
makeprojects.visual_studio_utils Namespace Reference

Project file generator subroutines for Microsoft Visual Studio 2003-2008. More...

Functions

 get_path_property (ide, pathname)
 If a path is relative, return the proper object.
 get_toolset_version (ide)
 Get the toolset version for the Visual Studio version.
 convert_file_name_vs2010 (item)
 Convert macros from to Visual Studio 2003-2008.
 wiiu_props (project)
 If the project is for WiiU, check if there are assembly files.
 add_masm_support (project)
 If the project is has assembly files, add the props files.
 get_cpu_folder (platform)
 If the platform is a Windows type, return the CPU name.
 generate_solution_file (solution_lines, solution)
 Serialize the solution file into a string array.
 create_copy_file_script (source_file, dest_file, perforce)
 Create a batch file to copy a single file.
 create_deploy_script (configuration)
 Create a deployment batch file if needed.

Variables

dict _PLATFORM_CPUS
 Dict of platforms to maps to names.
dict _SLN_HEADERS
 Internal list of Visual Studio headers for SLN files.
dict _SLN_POSTSOLUTION
 UUIDs for postSolution SLN records.

Detailed Description

Project file generator subroutines for Microsoft Visual Studio 2003-2008.

This module contains classes needed to generate project files intended for use by Microsoft's Visual Studio 2003, 2005 and 2008.

Function Documentation

◆ add_masm_support()

makeprojects.visual_studio_utils.add_masm_support ( project)

If the project is has assembly files, add the props files.

This function works for Visual Studio 2003-2022.

Note
  • Visual Studio 2003 only supports x86 files
  • Visual Studio 2005-2015 only support x86 and x64 files
  • Visual Studio 2017+ support arm, arm64, x86, and x64 files
Parameters
projectProject to check

◆ convert_file_name_vs2010()

makeprojects.visual_studio_utils.convert_file_name_vs2010 ( item)

Convert macros from to Visual Studio 2003-2008.

This table shows the conversions

Visual Studio 2010+ 2003-2008
%(RootDir)%(Directory) $(InputDir)
%(FileName) $(InputName)
%(Extension) $(InputExt)
%(FullPath) $(InputPath)
%(Identity) $(InputPath)
Parameters
itemFilename string
Returns
String with converted macros

◆ create_copy_file_script()

makeprojects.visual_studio_utils.create_copy_file_script ( source_file,
dest_file,
perforce )

Create a batch file to copy a single file.

Create a list of command lines to copy a file from source_file to dest_file with perforce support.

This is an example of the Windows batch file. The lines for the tool p4 are added if perforce=True.

p4 edit dest_file
copy /Y source_file dest_file
p4 revert -a dest_file
Parameters
source_filePathname to the source file
dest_filePathname to where to copy source file
perforceTrue if perforce commands should be generated.
Returns
List of command strings for Windows Command shell.
See also
create_deploy_script

◆ create_deploy_script()

makeprojects.visual_studio_utils.create_deploy_script ( configuration)

Create a deployment batch file if needed.

If an attribute of deploy_folder exists, a batch file will be returned that has the commands to copy the output file to the folder named in deploy_folder.

Two values are returned, the first is the command description suitable for Visual Studio Post Build and the second is the batch file string to perform the file copy. Both values are set to None if deploy_folder is empty.

Note
If the output is project_type of Tool, the folder will have cpu name appended to it and any suffix stripped.
mkdir final_folder
p4 edit dest_file
copy /Y source_file dest_file
p4 revert -a dest_file
Parameters
configurationConfiguration record.
Returns
None, None or description and batch file string.
See also
create_copy_file_script

◆ generate_solution_file()

makeprojects.visual_studio_utils.generate_solution_file ( solution_lines,
solution )

Serialize the solution file into a string array.

This function generates SLN files for all versions of Visual Studio. It assumes the text file will be encoded using UTF-8 character encoding so the resulting file will be pre-pended with a UTF-8 Byte Order Mark (BOM) for Visual Studio 2005 or higher.

Note
Byte Order Marks are not supplied by this function.
Parameters
solution_linesList to insert string lines.
solutionReference to the raw solution record
Returns
Zero on success, non-zero on error.

◆ get_cpu_folder()

makeprojects.visual_studio_utils.get_cpu_folder ( platform)

If the platform is a Windows type, return the CPU name.

Returns None, "x86", "x64", "arm", "arm64", or "ia64"

Parameters
platformenums.PlatformTypes to check
Returns
None or platform CPU name.

◆ get_path_property()

makeprojects.visual_studio_utils.get_path_property ( ide,
pathname )

If a path is relative, return the proper object.

Check if a pathname starts with a ".", which means it's relative to the project. If so, return a RelativePath string, otherwise return a FileName string. Special case for Visual Studio 2003, it only accepts RelativePath as a parameter

Parameters
ideenums.IDETypes of the IDE being generated for.
pathnamePathname to test.
Returns
validators.VSStringProperty of type RelativePath or FileName

◆ get_toolset_version()

makeprojects.visual_studio_utils.get_toolset_version ( ide)

Get the toolset version for the Visual Studio version.

Each version of Visual Studio uses a toolset version specific to that version. Return the version number for the vcxproj file.

Strings returned are "4.0", "12.0", "14.0" and "15.0".

Parameters
ideenums.IDETypes of the IDE being generated
Returns
String of the toolset version for the ide

◆ wiiu_props()

makeprojects.visual_studio_utils.wiiu_props ( project)

If the project is for WiiU, check if there are assembly files.

If there are assembly files, add the Nintendo supplied props file for assembly language support.

Note
This assumes that the official WiiU SDK from Nintendo is installed on the machine that will build this project file.
Parameters
projectProject to check

Variable Documentation

◆ _PLATFORM_CPUS

dict makeprojects.visual_studio_utils._PLATFORM_CPUS
protected

Dict of platforms to maps to names.

See also
makeprojects.visual_studio_utils.get_cpu_folder