diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 48 | ||||
-rw-r--r-- | Modules/CompilerId/VS-10.vcxproj.in | 15 | ||||
-rw-r--r-- | Modules/CompilerId/VS-6.dsp.in | 6 | ||||
-rw-r--r-- | Modules/CompilerId/VS-7.vcproj.in | 4 | ||||
-rw-r--r-- | Modules/FindGTK2.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 7 |
6 files changed, 50 insertions, 36 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index ae91a29..ebd9ce0 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -109,12 +109,9 @@ Id flags: ${testflags} # Compile the compiler identification source. if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)") set(vs_version ${CMAKE_MATCH_1}) - set(id_arch ${CMAKE_VS_PLATFORM_NAME}) + set(id_platform ${CMAKE_VS_PLATFORM_NAME}) set(id_lang "${lang}") set(id_cl cl.exe) - if(NOT id_arch) - set(id_arch Win32) - endif() if(NOT "${vs_version}" VERSION_LESS 10) set(v 10) set(ext vcxproj) @@ -126,16 +123,8 @@ Id flags: ${testflags} set(v 6) set(ext dsp) endif() - if("${id_arch}" STREQUAL "x64") - set(id_machine_10 MachineX64) - elseif("${id_arch}" STREQUAL "Itanium") - set(id_machine_10 MachineIA64) - set(id_arch ia64) - elseif("${id_arch}" STREQUAL "ARM") - set(id_machine_10 MachineARM) - else() - set(id_machine_6 x86) - set(id_machine_10 MachineX86) + if("${id_platform}" STREQUAL "Itanium") + set(id_platform ia64) endif() if(CMAKE_VS_PLATFORM_TOOLSET) set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>") @@ -149,7 +138,7 @@ Id flags: ${testflags} set(id_subsystem 1) endif() if("${CMAKE_MAKE_PROGRAM}" MATCHES "[Mm][Ss][Bb][Uu][Ii][Ll][Dd]") - set(build /p:Configuration=Debug /p:Platform=@id_arch@ /p:VisualStudioVersion=${vs_version}.0) + set(build /p:Configuration=Debug /p:Platform=@id_platform@ /p:VisualStudioVersion=${vs_version}.0) elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "[Mm][Ss][Dd][Ee][Vv]") set(build /make) else() @@ -341,6 +330,35 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) endif() endforeach() + # Detect the exact architecture from the PE header. + if(WIN32) + # The offset to the PE signature is stored at 0x3c. + file(READ ${file} peoffsethex LIMIT 1 OFFSET 60 HEX) + string(SUBSTRING "${peoffsethex}" 0 1 peoffsethex1) + string(SUBSTRING "${peoffsethex}" 1 1 peoffsethex2) + set(peoffsetexpression "${peoffsethex1} * 16 + ${peoffsethex2}") + string(REPLACE "a" "10" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "b" "11" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "c" "12" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "d" "13" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "e" "14" peoffsetexpression "${peoffsetexpression}") + string(REPLACE "f" "15" peoffsetexpression "${peoffsetexpression}") + math(EXPR peoffset "${peoffsetexpression}") + + file(READ ${file} peheader LIMIT 6 OFFSET ${peoffset} HEX) + if(peheader STREQUAL "50450000a201") + set(ARCHITECTURE_ID "SH3") + elseif(peheader STREQUAL "50450000a301") + set(ARCHITECTURE_ID "SH3DSP") + elseif(peheader STREQUAL "50450000a601") + set(ARCHITECTURE_ID "SH4") + elseif(peheader STREQUAL "50450000a801") + set(ARCHITECTURE_ID "SH5") + elseif(peheader STREQUAL "50450000c201") + set(ARCHITECTURE_ID "THUMB") + endif() + endif() + # Check if a valid compiler and platform were found. if(COMPILER_ID AND NOT COMPILER_ID_TWICE) set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}") diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in index ab4705f..1a7a539 100644 --- a/Modules/CompilerId/VS-10.vcxproj.in +++ b/Modules/CompilerId/VS-10.vcxproj.in @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|@id_arch@"> + <ProjectConfiguration Include="Debug|@id_platform@"> <Configuration>Debug</Configuration> - <Platform>@id_arch@</Platform> + <Platform>@id_platform@</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> @@ -12,7 +12,7 @@ <Keyword>Win32Proj</Keyword> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'" Label="Configuration"> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> @id_toolset@ <CharacterSet>MultiByte</CharacterSet> @@ -20,11 +20,11 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <PropertyGroup> <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'">.\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'">$(Configuration)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'">false</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">.\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'">false</LinkIncremental> </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'"> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'"> <ClCompile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -40,7 +40,6 @@ <Link> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Console</SubSystem> - <TargetMachine>@id_machine_10@</TargetMachine> </Link> <PostBuildEvent> <Command>for %%i in (@id_cl@) do %40echo CMAKE_@id_lang@_COMPILER=%%~$PATH:i</Command> diff --git a/Modules/CompilerId/VS-6.dsp.in b/Modules/CompilerId/VS-6.dsp.in index 4f7e676..48c9a23 100644 --- a/Modules/CompilerId/VS-6.dsp.in +++ b/Modules/CompilerId/VS-6.dsp.in @@ -1,7 +1,7 @@ # 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 +# TARGTYPE "Win32 (x86) Application" 0x0101 CFG=CompilerId@id_lang@ - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, @@ -16,7 +16,7 @@ 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 "CompilerId@id_lang@ - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project @@ -29,7 +29,7 @@ CPP=cl.exe # 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 +# ADD LINK32 /nologo /version:0.0 /subsystem:console /machine:x86 /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 diff --git a/Modules/CompilerId/VS-7.vcproj.in b/Modules/CompilerId/VS-7.vcproj.in index fa48cad..9e3c3c3 100644 --- a/Modules/CompilerId/VS-7.vcproj.in +++ b/Modules/CompilerId/VS-7.vcproj.in @@ -10,12 +10,12 @@ > <Platforms> <Platform - Name="@id_arch@" + Name="@id_platform@" /> </Platforms> <Configurations> <Configuration - Name="Debug|@id_arch@" + Name="Debug|@id_platform@" OutputDirectory="." IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index f7d3bf8..77aac6d 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -77,7 +77,7 @@ # appropriate. A new set of _RELEASE variables was also added. # * Remove GTK2_SKIP_MARK_AS_ADVANCED option, as now the variables are # marked as advanced by SelectLibraryConfigurations -# * Detect gmodule library +# * Detect gmodule, pangoft2 and pangoxft libraries # Version 1.4 (10/4/2012) (CMake 2.8.10) # * 12596: Missing paths for FindGTK2 on NetBSD # * 12049: Fixed detection of GTK include files in the lib folder on @@ -478,6 +478,10 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) _GTK2_FIND_LIBRARY (GTK2_PANGOCAIRO pangocairo false true) + _GTK2_FIND_LIBRARY (GTK2_PANGOFT2 pangoft2 false true) + + _GTK2_FIND_LIBRARY (GTK2_PANGOXFT pangoxft false true) + _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_PIXBUF gdk-pixbuf/gdk-pixbuf.h) _GTK2_FIND_LIBRARY (GTK2_GDK_PIXBUF gdk_pixbuf false true) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 9f97570..1a2d3e9 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -171,13 +171,6 @@ set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID}) if(NOT _MACHINE_ARCH_FLAG) set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID}) endif() -if(WINCE) - if(_MACHINE_ARCH_FLAG MATCHES "ARM") - set(_MACHINE_ARCH_FLAG "THUMB") - elseif(_MACHINE_ARCH_FLAG MATCHES "SH") - set(_MACHINE_ARCH_FLAG "SH4") - endif() -endif() set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${_MACHINE_ARCH_FLAG}") |