CMake/Windows bugfix: Make CMAKE_INSTALL_PREFIX a posix path (#36842)
CMake gives off a warning when passed Windows style paths as install prefixes as the resultant path often causes invalid escape sequences.
This commit is contained in:
		@@ -5,6 +5,7 @@
 | 
				
			|||||||
import collections.abc
 | 
					import collections.abc
 | 
				
			||||||
import inspect
 | 
					import inspect
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
 | 
					import pathlib
 | 
				
			||||||
import platform
 | 
					import platform
 | 
				
			||||||
import re
 | 
					import re
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
@@ -15,7 +16,6 @@
 | 
				
			|||||||
import spack.build_environment
 | 
					import spack.build_environment
 | 
				
			||||||
import spack.builder
 | 
					import spack.builder
 | 
				
			||||||
import spack.package_base
 | 
					import spack.package_base
 | 
				
			||||||
import spack.util.path
 | 
					 | 
				
			||||||
from spack.directives import build_system, conflicts, depends_on, variant
 | 
					from spack.directives import build_system, conflicts, depends_on, variant
 | 
				
			||||||
from spack.multimethod import when
 | 
					from spack.multimethod import when
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -271,7 +271,7 @@ def std_args(pkg, generator=None):
 | 
				
			|||||||
        args = [
 | 
					        args = [
 | 
				
			||||||
            "-G",
 | 
					            "-G",
 | 
				
			||||||
            generator,
 | 
					            generator,
 | 
				
			||||||
            define("CMAKE_INSTALL_PREFIX", pkg.prefix),
 | 
					            define("CMAKE_INSTALL_PREFIX", pathlib.Path(pkg.prefix).as_posix()),
 | 
				
			||||||
            define("CMAKE_BUILD_TYPE", build_type),
 | 
					            define("CMAKE_BUILD_TYPE", build_type),
 | 
				
			||||||
            define("BUILD_TESTING", pkg.run_tests),
 | 
					            define("BUILD_TESTING", pkg.run_tests),
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user