From 66cb3356f508da309d599f6148763f7afe3802e1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 16 Aug 2012 16:23:16 -0400 Subject: VS: Detect the compiler id and tool location Configure a hand-generated Visual Studio project to build the compiler id source file since we cannot run the compiler command-line tool directly. Add a post-build command to print out the full path to the compiler tool. Parse the full path to the compiler tool from the build output. --- Modules/CompilerId/VS-10.vcxproj.in | 53 ++++++++++++++++++++++++++++++++ Modules/CompilerId/VS-6.dsp.in | 48 +++++++++++++++++++++++++++++ Modules/CompilerId/VS-7.vcproj.in | 60 +++++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 Modules/CompilerId/VS-10.vcxproj.in create mode 100644 Modules/CompilerId/VS-6.dsp.in create mode 100644 Modules/CompilerId/VS-7.vcproj.in (limited to 'Modules/CompilerId') diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in new file mode 100644 index 0000000000..ab4705fa38 --- /dev/null +++ b/Modules/CompilerId/VS-10.vcxproj.in @@ -0,0 +1,53 @@ + + + + + Debug + @id_arch@ + + + + {CAE07175-D007-4FC3-BFE8-47B392814159} + CompilerId@id_lang@ + Win32Proj + + + + Application + @id_toolset@ + MultiByte + + + + <_ProjectFileVersion>10.0.30319.1 + .\ + $(Configuration)\ + false + + + + Disabled + %(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebugDLL + + + TurnOffAllWarnings + + + + + false + Console + @id_machine_10@ + + + for %%i in (@id_cl@) do %40echo CMAKE_@id_lang@_COMPILER=%%~$PATH:i + + + + + + + diff --git a/Modules/CompilerId/VS-6.dsp.in b/Modules/CompilerId/VS-6.dsp.in new file mode 100644 index 0000000000..4f7e676135 --- /dev/null +++ b/Modules/CompilerId/VS-6.dsp.in @@ -0,0 +1,48 @@ +# Microsoft Developer Studio Project File - Name="CompilerId@id_lang@" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +# TARGTYPE "Win32 (@id_machine_6@) Application" 0x0101 + +CFG=CompilerId@id_lang@ - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "CompilerId@id_lang@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "CompilerId@id_lang@.mak" CFG="CompilerId@id_lang@ - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "CompilerId@id_lang@ - Win32 Debug" (based on "Win32 (@id_machine_6@) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +CPP=cl.exe +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD CPP /nologo /MDd /c +LINK32=link.exe +# ADD LINK32 /nologo /version:0.0 /subsystem:console /machine:@id_machine_6@ /out:"CompilerId@id_lang@.exe" /IGNORE:4089 +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Cmds=for %%i in (@id_cl@) do @echo CMAKE_@id_lang@_COMPILER=%%~$PATH:i +# End Special Build Tool +# Begin Target + +# Name "CompilerId@id_lang@ - Win32 Debug" +# Begin Group "Source Files" + +# Begin Source File + +SOURCE="@id_src@" +# End Source File +# End Group +# End Target +# End Project diff --git a/Modules/CompilerId/VS-7.vcproj.in b/Modules/CompilerId/VS-7.vcproj.in new file mode 100644 index 0000000000..71bf64de28 --- /dev/null +++ b/Modules/CompilerId/VS-7.vcproj.in @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1