Salome HOME
e1d5e13ccb468da2a550e9ed0244eebd98133d93
[tools/solverlab.git] / CDMATH / cmake_files / CorrectWindowsPaths.cmake
1 ##Copyright (C) johnfettig.
2 ##All rights reserved.
3 ##
4 ##Redistribution and use in source and binary forms, with or without modification,
5 ##are permitted provided that the following conditions are met:
6 ##
7 ##* Redistributions of source code must retain the above copyright notice, this
8 ##  list of conditions and the following disclaimer.
9 ##
10 ##* Redistributions in binary form must reproduce the above copyright notice, this
11 ##  list of conditions and the following disclaimer in the documentation and/or
12 ##  other materials provided with the distribution.
13 ##
14 ##THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ##ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 ##WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 ##DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
18 ##ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 ##(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 ##LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 ##ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 ##(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 ##SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25 # CorrectWindowsPaths - this module defines one macro
26 #
27 # CONVERT_CYGWIN_PATH( PATH )
28 #  This uses the command cygpath (provided by cygwin) to convert
29 #  unix-style paths into paths useable by cmake on windows
30
31 macro (CONVERT_CYGWIN_PATH _path)
32   if (WIN32)
33     EXECUTE_PROCESS(COMMAND cygpath.exe -m ${${_path}}
34       OUTPUT_VARIABLE ${_path})
35     string (STRIP ${${_path}} ${_path})
36   endif (WIN32)
37 endmacro (CONVERT_CYGWIN_PATH)
38