none
Did MSBuild make $(TargetName_OutDir) property? RRS feed

  • Question

  • Hi all, 

    I'm a new developer on Windows 10 with visual studio 2019 community. I have developed for my self a program run with my own libraries, all outputs will be put in the same directory. Few days ago, I went around GitHub open source projects try to have a look to build the way, and I saw the CPython project, the developers used $(py_OutDir) property in a python.props file to set the final outputs of the CPython project.

    And I asked that Did MSBuild make $(TargetName_OutDir) property? If the answer is Yes, can someone tell me where I will get more information in the docs.microsoft.com/en-us/visualstudio/msbuild. As I had tried to get more information on the page, but I only got about the OutDir property.

    Monday, August 12, 2019 3:27 PM

Answers

All replies

  • Hi Lucky,

    Welcome to the MSDN forum.

    ##And I asked that Did MSBuild make $(TargetName_OutDir) property? 

    >>The MSBuild does make $(OutDir)$(TargetName) rather than $(TargetName_OutDir).

    ##If the answer is Yes, can someone tell me where I will get more information in the docs.microsoft.com/en-us/visualstudio/msbuild. As I had tried to get more information on the page, but I only got about the OutDir property.

    >> l have found the document for you:

    https://docs.microsoft.com/en-us/cpp/build/reference/common-macros-for-build-commands-and-properties?view=vs-2019

    This is a lot of common macros for MSBuild Properties. You can also find the information and test the instructions based on the current project in real time.

    First, open VS and create a project based on c++---->Right-click the project-->Properties-->Linker-->General-->Output File--> select the text box --> choose edit-->click the Macros. Then you can see the effect as below:

    It includes the whole macros and you can test the macros based on your project.

    l hope it could help you.

    Best Regards,

    Perry




    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Tuesday, August 13, 2019 6:47 AM
  • @Perry Qian-MSFT Thank you so much for that information :)
    Tuesday, August 13, 2019 8:06 AM
  • I believe $(py_OutDir) is something specific to the CPython project, and the py_OutDir name is not constructed at build time by concatenating strings. The powershell step in their .azure-pipelines/windows-release/build-steps.yml file sets py_OutDir as an environment variable, MSBuild translates the environment variable to an MSBuild property, and their PCbuild/python.props file then reads the property.

    • Marked as answer by Lucky BC Wednesday, August 14, 2019 10:20 AM
    Tuesday, August 13, 2019 3:58 PM
  • @ranta Wow, I did not read all the project CPython. You helped me with the right information, $(py_OutDir) is just the environment variable :). Thank you so much !!!

    Wednesday, August 14, 2019 10:44 AM