diff --git a/CMakeLists.txt b/CMakeLists.txt index a01453a48..28b88def5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,18 +52,16 @@ function(GetHostName var) execute_process( COMMAND hostname OUTPUT_VARIABLE thisHostname + OUTPUT_STRIP_TRAILING_WHITESPACE ) else() execute_process( COMMAND hostname -f OUTPUT_VARIABLE thisHostname + OUTPUT_STRIP_TRAILING_WHITESPACE ) endif() - # Cleanup possible presence of \n or \r characters - string(REPLACE "\n" "" thisHostname ${thisHostname}) - string(REPLACE "\r" "" thisHostname ${thisHostname}) - set(${var} ${thisHostname} PARENT_SCOPE) endfunction() diff --git a/testHarness/foam-extend/4.1/CMakeFiles/CMakeLists.txt b/testHarness/foam-extend/4.1/CMakeFiles/CMakeLists.txt index a01453a48..28b88def5 100644 --- a/testHarness/foam-extend/4.1/CMakeFiles/CMakeLists.txt +++ b/testHarness/foam-extend/4.1/CMakeFiles/CMakeLists.txt @@ -52,18 +52,16 @@ function(GetHostName var) execute_process( COMMAND hostname OUTPUT_VARIABLE thisHostname + OUTPUT_STRIP_TRAILING_WHITESPACE ) else() execute_process( COMMAND hostname -f OUTPUT_VARIABLE thisHostname + OUTPUT_STRIP_TRAILING_WHITESPACE ) endif() - # Cleanup possible presence of \n or \r characters - string(REPLACE "\n" "" thisHostname ${thisHostname}) - string(REPLACE "\r" "" thisHostname ${thisHostname}) - set(${var} ${thisHostname} PARENT_SCOPE) endfunction()