I have a CMakeLists.txt file in which there are multiple external projects I need to build. I am using the ExternalProject_Add feature of CMake.
I need to set an environment variable in one of the ExternalProject_Add project modules. The project needs it to perform a build.
I have tried using the ${CMAKE_COMMAND} -E env option and that has not worked:
CONFIGURE_COMMAND
${CMAKE_COMMAND} -E env ANDROID_SDK_ROOT="/home/subbu/Android/Sdk"
${CMAKE_COMMAND} -E env ANDROID_API_VERSION="android-22"
<SOURCE_DIR>/configure
-prefix <INSTALL_DIR>
-debug
I am not able to find examples on the web.
Please advise.
Thanks for your help in advance.
Subbu
i was doing a similar thing for msgpack, and i was able to get it to work by doing the following:
MsgpackCflags
,MsgpackLdflags
are pre-computed, depending on the target system.MsgpackHost
is used by the cross-compile toolchain (x86_64-linux-gnu for a host build), ${DependenciesInstallDir} is also a pre-computed path that varies for different os/architecture/build-configuration (debug, release) tuple. theMsgpackbundleMd5
is the result ofmd5sum msgpack-1.4.1.tar.gz
.