cget icon indicating copy to clipboard operation
cget copied to clipboard

Add install/build options to requirements.txt

Open marcovc opened this issue 6 years ago • 5 comments

Is there a way to add install options to the requirements.txt file, such as:

package1 -DOption1=1 package2 -DOption2=2

?

Thanks

marcovc avatar Oct 13 '19 08:10 marcovc

Yes, this is already supported, see here.

pfultz2 avatar Oct 14 '19 15:10 pfultz2

Thanks. It seems it is not getting the defines in this requirements.txt file :

MiniZinc/libminizinc/archive/develop -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC"

(but it works if I call it like cget install MiniZinc/libminizinc/archive/develop -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC")

Any clues why?

marcovc avatar Oct 17 '19 08:10 marcovc

You cant set those flags because they are usually set by the toolchain. Although there should be a way to add additional flags for some projects.

However, for your example, you can add -DCMAKE_POSITION_INDEPENDENT_CODE=On to add the -fPIC flag.

pfultz2 avatar Oct 17 '19 14:10 pfultz2

I see. But then why does it work if set those flags when I call cget?

I.e., this:

cget install -Detc

works in this case.

On Thu, Oct 17, 2019 at 3:23 PM Paul Fultz II [email protected] wrote:

You cant set those flags because they are usually set by the toolchain. Although there should be a way to add additional flags for some projects.

However, for your example, you can add -DCMAKE_POSITION_INDEPENDENT_CODE=On to add the -fPIC flag.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pfultz2/cget/issues/74?email_source=notifications&email_token=AAEYNNFRTYQPBJSCOGPHGWDQPBYNBA5CNFSM4JAF74F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBQI35I#issuecomment-543198709, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEYNNHRAHIDEH5QY67TOSDQPBYNBANCNFSM4JAF74FQ .

marcovc avatar Oct 17 '19 14:10 marcovc

I see. But then why does it work if set those flags when I call cget?

Variables like CMAKE_CXX_FLAGS are set by cget's internal cmake toolchain file, so it will override the flags set by -Detc.

pfultz2 avatar Apr 22 '20 02:04 pfultz2