On Thu, May 21, 2015 at 9:44 AM, Ben Boeckel <[email protected]>
wrote:
> The problem with MAKEFLAGS is that `-i` also gets inherited and that is
> not acceptable to use when running things like try_compile since it
> causes false positives (e.g., detecting NEON extensions on x86). CMake
> clears it so that it has a better expectation of how things will run. Is
> there a reason you can't use a CMake cache variable to set
> `environment_build_flags` rather than the environment (since it would
> get remembered between cmake runs while the environment needs to be
> specified every time)?
>
Ya, I could definitely use a cache variable and that probably makes sense
to do here. But I'm not sure how it solves my problem. For example, with
this CMakeLists.txt:
cmake_minimum_required(VERSION 3.0)
set(environment_build_flags $ENV{MAKEFLAGS} CACHE STRING "MAKEFLAGS")
add_custom_target(echo_makeflags COMMAND echo "environment_build_flags:
${environment_build_flags}" VERBATIM)
I still just get:
$ make echo_makeflags
environment_build_flags:
Built target echo_makeflags
Taylor
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers