ubisoft / Sharpmake

Sharpmake is an open-source C#-based solution for generating project definition files, such as Visual Studio projects and solutions, GNU makefiles, Xcode projects, etc.
Apache License 2.0
945 stars 171 forks source link

How to compile 3rd party library as a project #227

Closed BrokenMarkus closed 2 years ago

BrokenMarkus commented 2 years ago

Hi,

I'm currently trying to setup a project, where I have each 3rd party library as git submodules and compile them myself. A lot of those third party solutions use cmake, so I have managed to implement this by generating a bat-file in the [Configure()] that contains the commands to generate and build the cmake project and then executing that bat-file through a CustomFileBuildSteps like the CustomBuildStep example.

This works, but feels a bit hackish, especially since I started wanting have more complex logic and error checking in the .bat-file and clean doesn't do a proper clean on the project

Do you have any suggestion on other ways of doing this that I might have missed?

jspelletier commented 2 years ago

Hi, Sharpmake is not intended to execute compilations jobs. You could setup that project as an export project. You compile it outside before building your executable and the export project will let you reference the .lib files.

BrokenMarkus commented 2 years ago

Hi,

Thanks for the answer! Then I know that I'm out trying to do stuff in a unintended way. Time for the refactor sledge!