cpm icon indicating copy to clipboard operation
cpm copied to clipboard

provide a simple example how to add an external

Open maddanio opened this issue 9 years ago • 5 comments

Hi, I would really like to use cpm in my project, but I can't figure out how to most simply add an external project. For example in my app I need an (iOS tuned version of) freetype:

https://github.com/cdave1/freetype2-ios.git

I was hoping I can just get this directly, but I feel I have to clone it and make it cpm ready? what about these json files you demonstrate for google test, can I just write one of those instead and place it in my own project?

maddanio avatar Apr 18 '16 20:04 maddanio

Ya it will be a little bit more complicated than using the repository as-is. It generally depends on the build system being used for the repository in-question.

For the linked repo, it looks like it is an xcode project. I assume you could do something like execute xcodebuild from an ExternalProject_Add CMake command. I have https://github.com/iauns/cpm-libuv which builds a project that doesn't require CMake but instead uses autconf. That's probably better to look at than the google-test repo since google-test uses CMake. Also, freetype2-ios may have a CMake repo laying around somewhere which could potentially make things easier.

iauns avatar Apr 23 '16 17:04 iauns

ok, but I always have to make a repo for an external, right?

maddanio avatar Apr 25 '16 19:04 maddanio

I cannot specify it "inline"? With ExternalProject I sadly loose the caching :(

maddanio avatar Apr 25 '16 19:04 maddanio

how about adding an external that already uses cmake? do I still have to set up a repo with the cpm makefile, or can I specify directly?

maddanio avatar May 04 '16 08:05 maddanio

ah, or I can just put it inside the repo itself, right? a tutorial for these things wold e cool :)

maddanio avatar May 04 '16 08:05 maddanio