none
Building CMake Project from Command line RRS feed

  • Question

  • Hey,

    I have a CMake project with a few configurations in a CMakeSettings.json file. 

    Is there a simple way to build one (or all) of the configurations defined in that file from the command line? 

    Right now I don't see a way to do it without repeating the configuration in a batch file or parsing it out of the json. 

    Thank you,

    Alex

    Wednesday, November 13, 2019 11:15 AM

All replies

  • Hi Alex,

    Welcome to MSDN forum.

    The CmakeSettings.json file is used to transfer environment parameter to Cmake.exe. It just works with VS, and could quickly manage environment configuration for your cmake project in VS. So I'm sorry that we could not load this file using cmake command.

    BTW, we recommend you could try to write a script which contains related configurations, then run it with cmake.exe. Please refer here.

    Hope it could help you.

    Best Regards,

    Dylan


    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


    Thursday, November 14, 2019 5:12 AM
  • Hi Dylan,

    Your link seems to redirect to this page, but I think you were pointing me at the CMakeSettings.json Schema Reference? (I can't post links else I would).

    Is your advice to just replicate the same information from the CmakeSettings.json in a batch / powershell script and call into cmake? 

    Friday, November 15, 2019 11:35 AM
  • Hi fsperry,

    Sorry for delay in reply, and thanks for the reminder.

    I have updated the link. The link contains that use cmake.exe to run script. It is like calling from CmakeSettings.json to cmake.

    And I'm sorry that currently there is no appropriate method to use one tool with command line to read parameter from CmakeSettings.json, sorry for this inconvenience.

    Best Regards,

    Dylan


    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, November 19, 2019 8:56 AM