The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=15233 ====================================================================== Reported By: Bill Torpey Assigned To: ====================================================================== Project: CMake Issue ID: 15233 Category: CMake Reproducibility: always Severity: feature Priority: normal Status: new ====================================================================== Date Submitted: 2014-11-04 10:11 EST Last Modified: 2014-11-04 10:11 EST ====================================================================== Summary: is there a way to force the use of bash for command execution? Description: Under Linux, cmake runs external commands (e.g., specified in add_custom_command) using sh. While sh resolves to bash, when invoked as sh bash does not support many features.
In particular, we need to: - Specify LD_LIBRARY_PATH for a custom command (since it is being built as part of the build process, with a non-standard compiler) - Specify ASAN_OPTIONS (since the custom commmand is being built w/clang+asan) to force it to return a zero return code. The natural way to do this is to prefix the custom command: LD_LIBRARY_PATH=... ASAN_OPTIONS=... command While this is perfectly legal bash, sh fails with "No such file or directory" It's possible to wrap the command in a shell script and execute that, but it would be much cleaner to specify the command directly in the CMakeLists.txt file. FWIW, we don't care about portability -- our application is strictly Linux x86_64 -- we just use CMake as a superior alternative to autotools. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2014-11-04 10:11 Bill Torpey New Issue ====================================================================== -- 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
