CMake pass environment variable to ExternalProject_Add

1.2k Views Asked by At

I'm trying to pass an environment variable to an external project in my CMakeLists.txt without any success.

In this case, I have a dependency to mbedtls library which is downloaded and built in my cmake. In Linux this works as intended, however in a Windows environment, I need to pass a variable WINDOWS_BUILD=1 to the make environment.

I have tried to add a CONFIGURE_COMMAND to a batch file which sets this environment variable in the ExternalProject_Add(), however this does not work. If I manually go into the automatically downloaded mbedtls folder and write

$ make WINDOWS_BUILD=1

it works as intended, however I want to build everything from CMake environment. Any takes?

0

There are 0 best solutions below