Hello,

We are migrating our project from standard Unix Makefiles to CMake. The
old Makefile contained a line that cleared an environment variable like
this:

export CPLUS_INCLUDE_PATH=

This step is necessary due to some library/path confusion in combination
with 3rd party libraries on some systems.

However, I was unable to find a way to generate such a command (or any
other way to define environment variables) inside the generated Makefile.

The closest I got was something like
add_custom_target(
  workaround
  sed -i '3i\\\\n\#Workaround\ for\ Thrust\ bug\\nexport\
CPLUS_INCLUDE_PATH=' Makefile
)
This kind of works, but you have to run
make workaround
each time after generating the Makefile (and if you forget to do it, the
build will fail later)


Other projects [1] that use CMake just tell their users to run
unset CPLUS_INCLUDE_PATH
in their shell to work around the issue, which I try to avoid.

Is there any automated way to do this when generating the Makefile?



[1]
http://www.libama.org/documentation.html?tx_restdoc_pi1[doc]=installation|configuration|cuda
-- 

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

Reply via email to