MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0014306 | CMake | CMake | public | 2013-07-24 03:45 | 2016-06-10 14:31 |
| Reporter | ycollet | ||||
| Assigned To | Kitware Robot | ||||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | moved | ||
| Platform | x86 | OS | Linux | OS Version | |
| Product Version | CMake 2.8.9 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0014306: environment variable set in a add_custom_target is forgotten | ||||
| Description | Under windows, I set an environment variable and then launch a batch file which displays the value of the environment variable. add_custom_target(test_env_var COMMAND set MYENVVAR=this_is_a_test COMMAND ${CMAKE_SOURCE_DIR}/echo.bat) The variable is correctly displayed. Under linux, I tried to do the same add_custom_target(test_env_var COMMAND export MYENVVAR=this_is_a_test COMMAND ${CMAKE_SOURCE_DIR}/echo.sh) The shell script displays an empty variable. To be able to display the environment variable, I must do like this: add_custom_target(test_env_var COMMAND export MYENVVAR=this_is_a_test && ${CMAKE_SOURCE_DIR}/echo.sh) And then it works. Under linux, it's like a new shell is started each time a COMMAND is met. Under windows, it's like a shell is started at the first COMMAND and the same shell is reused for each COMMAND. | ||||
| Steps To Reproduce | I added an archive with the test case. | ||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://public.kitware.com/Bug/file/4823/tmp.zip | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2013-07-24 03:45 | ycollet | New Issue | |||
| 2013-07-24 03:45 | ycollet | File Added: tmp.zip | |||
| 2013-07-24 13:53 | Brad King | Note Added: 0033595 | |||
| 2013-07-24 13:53 | Brad King | Status | new => backlog | ||
| 2016-06-10 14:29 | Kitware Robot | Note Added: 0042323 | |||
| 2016-06-10 14:29 | Kitware Robot | Status | backlog => resolved | ||
| 2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
| 2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
| 2016-06-10 14:31 | Kitware Robot | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||