View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0007919 | CMake | Modules | public | 2008-11-03 05:57 | 2013-10-07 10:09 | ||||
Reporter | Andreas Pokorny | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | feature | Reproducibility | N/A | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | CMake-2-6 | ||||||||
Target Version | CMake 2.8.11 | Fixed in Version | CMake 2.8.11 | ||||||
Summary | 0007919: Patch for Windows Platform files to add WinCE support with NMake | ||||||||
Description | These patch files add: * Platform/WinCE.cmake which only includes Windows * Platform/WinCE-cl.cmake which only includes Windows-cl * CMakeTestCLMachineType.c - test case for cl and dumpbin Modified: * Windows-cl.cmake - now uses dumpbin to detect the binary format cl creates - adds several IF - ELSE - ENDIF blocks to make WINCE specific - removed the former 64bit check The patch is against cmake-2.6.2.tar.gz since I do not have CVS access through our company proxy :(. | ||||||||
Additional Information | To make proper use of these files the environment must be configured properly! That means %INCLUDE% %LIB% must be configured in a way that the cl picked by the toolchain file finds the includes and libs of the SDK. I.e. you will need something like: INCLUDE=c:\Programme\Windows CE Tools\wce500\WINCE5.0_EN\Include\ARMV4I\;%INCLUDE% LIB=c:\Programme\Windows CE Tools\wce500\WINCE5.0_EN\Lib\ARMV4I\;%LIB% Furthermore the toolchain file should pick a valid System Version. Like: SET(CMAKE_SYSTEM_VERSION 5.02) This version number will be used in the linker commands and set as macros: UNDER_CE=0x502 _WIN32_WCE=0x0502 | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | modules.patch [^] (12,898 bytes) 2008-11-03 05:57 [Show Content] [Hide Content]diff -Nur cmake-2.6.2/Modules/CMakeTestCLMachineType.c cmake-2.6.2-patched/Modules/CMakeTestCLMachineType.c --- cmake-2.6.2/Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/CMakeTestCLMachineType.c 2008-09-17 15:01:36.000000000 +0200 @@ -0,0 +1 @@ +int dummy() { return 0;} diff -Nur cmake-2.6.2/Modules/Platform/WinCE-cl.cmake cmake-2.6.2-patched/Modules/Platform/WinCE-cl.cmake --- cmake-2.6.2/Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/Platform/WinCE-cl.cmake 2008-11-03 11:23:17.000000000 +0100 @@ -0,0 +1,17 @@ + +SET(WIN32 1) +SET(WINCE 1) + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce,${CMAKE_SYSTEM_VERSION}) +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce) + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + +INCLUDE(Platform/Windows-cl) + diff -Nur cmake-2.6.2/Modules/Platform/WinCE.cmake cmake-2.6.2-patched/Modules/Platform/WinCE.cmake --- cmake-2.6.2/Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/Platform/WinCE.cmake 2008-11-03 11:21:26.000000000 +0100 @@ -0,0 +1,18 @@ + +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) +ELSE(CMAKE_SYSTEM_VERSION) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + + diff -Nur cmake-2.6.2/Modules/Platform/Windows-cl.cmake cmake-2.6.2-patched/Modules/Platform/Windows-cl.cmake --- cmake-2.6.2/Modules/Platform/Windows-cl.cmake 2008-09-24 20:34:34.000000000 +0200 +++ cmake-2.6.2-patched/Modules/Platform/Windows-cl.cmake 2008-11-03 11:39:41.000000000 +0100 @@ -7,8 +7,10 @@ INCLUDE(Platform/cl) -SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) -SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) +IF(NOT WINCE) + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) + SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) +ENDIF(WINCE) IF(CMAKE_GENERATOR MATCHES "Visual Studio 6") SET (CMAKE_NO_BUILD_TYPE 1) @@ -137,35 +139,84 @@ MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) - MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN - ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) + + # Testing the machine type of the generated binaries: + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/VC/bin" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "/Program Files/Microsoft Visual Studio 9/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + + ## TODO add further dumpbin machine to visual studio machine type conversion here: + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "CL platform seems to be:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) ENDIF(CMAKE_FORCE_WIN64) @@ -183,16 +234,26 @@ SET(CMAKE_BUILD_TYPE_INIT Debug) SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR") - SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG") SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") SET (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000") - SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG") SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") - SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ") + + IF(WINCE) + ## RTC1 flag is not supported by the cl cross compiler + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + ## some libs do not exist or have different names + SET (CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ws2.lib mmtimer.lib") + ELSE(WINCE) + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") + SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ") + ENDIF(WINCE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST") ELSE(MSVC_VERSION GREATER 1310) IF(CMAKE_USING_VC_FREE_TOOLS) @@ -221,21 +282,48 @@ SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") ENDIF(CMAKE_USING_VC_FREE_TOOLS) - SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") + IF(WINCE) + SET (CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ws2.lib mmtimer.lib") + ELSE(WINCE) + SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") + ENDIF(WINCE) ENDIF(MSVC_VERSION GREATER 1310) SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) ## 10MB is a reasonable default? + MESSAGE(STATUS "CMAKE_WINDOWS_STACKSIZE not defined, setting 10MB stack size") +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + +SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + +# machine type +IF(CMAKE_GENERATOR MATCHES "Makefiles") +## Setting machine makes only sense when linking cross compiled binaries with makefiles? + IF(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") + ELSE(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") + ENDIF(CMAKE_CL_MACHINE_TYPE) + + # append /ARMPADCODE + IF(CMAKE_CL_MACHINE_TYPE STREQUAL thumb) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE ") + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL thumb) + +ELSE(CMAKE_GENERATOR MATCHES "Makefiles") + + IF(CMAKE_FORCE_WIN64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:x64") + ENDIF(CMAKE_FORCE_WIN64) + +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it modules_2.patch [^] (10,563 bytes) 2008-11-10 10:09 [Show Content] [Hide Content] diff -Nur cmake-2.6.2/Modules/CMakeTestCLMachineType.c cmake-2.6.2-patched/Modules/CMakeTestCLMachineType.c --- cmake-2.6.2/Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/CMakeTestCLMachineType.c 2008-11-10 13:09:38.812500000 +0100 @@ -0,0 +1 @@ +int dummy() { return 0;} diff -Nur cmake-2.6.2/Modules/Platform/WinCE-cl.cmake cmake-2.6.2-patched/Modules/Platform/WinCE-cl.cmake --- cmake-2.6.2/Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/Platform/WinCE-cl.cmake 2008-11-10 14:49:22.000000000 +0100 @@ -0,0 +1,32 @@ + +SET(WIN32 1) +SET(WINCE 1) + + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") +ENDIF(MSVC_VERSION GREATER 1310) + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ws2.lib mmtimer.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce,${CMAKE_SYSTEM_VERSION}) +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce) + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff -Nur cmake-2.6.2/Modules/Platform/WinCE.cmake cmake-2.6.2-patched/Modules/Platform/WinCE.cmake --- cmake-2.6.2/Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/Platform/WinCE.cmake 2008-11-10 16:06:24.000000000 +0100 @@ -0,0 +1,24 @@ + +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + + diff -Nur cmake-2.6.2/Modules/Platform/Windows-cl.cmake cmake-2.6.2-patched/Modules/Platform/Windows-cl.cmake --- cmake-2.6.2/Modules/Platform/Windows-cl.cmake 2008-09-24 20:34:34.000000000 +0200 +++ cmake-2.6.2-patched/Modules/Platform/Windows-cl.cmake 2008-11-10 13:19:10.000000000 +0100 @@ -137,35 +137,86 @@ MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) - MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN - ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) + + # Testing the machine type of the generated binaries: + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/VC/bin" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "/Program Files/Microsoft Visual Studio 9/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + + ## TODO add further dumpbin machine to visual studio machine type conversion here, + ## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "CL platform seems to be:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) ENDIF(CMAKE_FORCE_WIN64) @@ -228,14 +279,35 @@ # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + +SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + +# machine type +IF(CMAKE_GENERATOR MATCHES "Makefiles") +## Setting machine makes only sense when linking cross compiled binaries with makefiles? + IF(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") + ELSE(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") + ENDIF(CMAKE_CL_MACHINE_TYPE) + + # append /ARMPADCODE + IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE ") + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + +ELSE(CMAKE_GENERATOR MATCHES "Makefiles") + + IF(CMAKE_FORCE_WIN64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:x64") + ENDIF(CMAKE_FORCE_WIN64) + +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it modules_3.patch [^] (11,389 bytes) 2008-12-15 10:03 [Show Content] [Hide Content] diff -Nur cmake-2.6.2/Modules/CMakeTestCLMachineType.c cmake-2.6.2-patched/Modules/CMakeTestCLMachineType.c --- cmake-2.6.2/Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/CMakeTestCLMachineType.c 2008-11-10 13:09:38.812500000 +0100 @@ -0,0 +1 @@ +int dummy() { return 0;} Files cmake-2.6.2/Modules/Platform/.WinCE-cl.cmake.swp and cmake-2.6.2-patched/Modules/Platform/.WinCE-cl.cmake.swp differ Files cmake-2.6.2/Modules/Platform/.Windows-cl.cmake.swp and cmake-2.6.2-patched/Modules/Platform/.Windows-cl.cmake.swp differ diff -Nur cmake-2.6.2/Modules/Platform/WinCE-cl.cmake cmake-2.6.2-patched/Modules/Platform/WinCE-cl.cmake --- cmake-2.6.2/Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/Platform/WinCE-cl.cmake 2008-11-10 14:49:22.000000000 +0100 @@ -0,0 +1,32 @@ + +SET(WIN32 1) +SET(WINCE 1) + + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") +ENDIF(MSVC_VERSION GREATER 1310) + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ws2.lib mmtimer.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce,${CMAKE_SYSTEM_VERSION}) +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce) + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff -Nur cmake-2.6.2/Modules/Platform/WinCE.cmake cmake-2.6.2-patched/Modules/Platform/WinCE.cmake --- cmake-2.6.2/Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.2-patched/Modules/Platform/WinCE.cmake 2008-11-10 16:06:24.000000000 +0100 @@ -0,0 +1,24 @@ + +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + + diff -Nur cmake-2.6.2/Modules/Platform/Windows-cl.cmake cmake-2.6.2-patched/Modules/Platform/Windows-cl.cmake --- cmake-2.6.2/Modules/Platform/Windows-cl.cmake 2008-09-24 20:34:34.000000000 +0200 +++ cmake-2.6.2-patched/Modules/Platform/Windows-cl.cmake 2008-12-15 16:02:32.375000000 +0100 @@ -137,35 +137,86 @@ MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) - MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN - ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) + + # Testing the machine type of the generated binaries: + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/VC/bin" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "/Program Files/Microsoft Visual Studio 9/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + + ## TODO add further dumpbin machine to visual studio machine type conversion here, + ## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "CL platform seems to be:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) ENDIF(CMAKE_FORCE_WIN64) @@ -228,14 +279,35 @@ # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + +SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + +# machine type +IF(CMAKE_GENERATOR MATCHES "Makefiles") +## Setting machine makes only sense when linking cross compiled binaries with makefiles? + IF(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") + ELSE(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") + ENDIF(CMAKE_CL_MACHINE_TYPE) + + # append /ARMPADCODE + IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE ") + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + +ELSE(CMAKE_GENERATOR MATCHES "Makefiles") + + IF(CMAKE_FORCE_WIN64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:x64") + ENDIF(CMAKE_FORCE_WIN64) + +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it diff -Nur cmake-2.6.2/Modules/Platform/Windows-cl.cmake.in cmake-2.6.2-patched/Modules/Platform/Windows-cl.cmake.in --- cmake-2.6.2/Modules/Platform/Windows-cl.cmake.in 2008-09-24 20:34:34.000000000 +0200 +++ cmake-2.6.2-patched/Modules/Platform/Windows-cl.cmake.in 2008-12-15 15:58:37.203125000 +0100 @@ -3,6 +3,7 @@ SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) SET(CMAKE_CL_64 @CMAKE_CL_64@) +SET(CMAKE_CL_MACHINE_TYPE @CMAKE_CL_MACHINE_TYPE@) SET(MSVC60 @MSVC60@) SET(MSVC70 @MSVC70@) SET(MSVC71 @MSVC71@) WinCESupport.patch [^] (101,049 bytes) 2009-04-15 12:37 [Show Content] [Hide Content] diff -Nur cmake-2.6.3/Modules/CMakeTestCCompiler.cmake cmake-2.6.3-p1/Modules/CMakeTestCCompiler.cmake --- cmake-2.6.3/Modules/CMakeTestCCompiler.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeTestCCompiler.cmake 2009-04-15 18:02:56.109375000 +0200 @@ -18,6 +18,7 @@ "int main(int argc, char* argv[])\n" "#endif\n" "{ return argc-1;}\n") + TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c OUTPUT_VARIABLE OUTPUT) diff -Nur cmake-2.6.3/Modules/CMakeTestCLMachineType.c cmake-2.6.3-p1/Modules/CMakeTestCLMachineType.c --- cmake-2.6.3/Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeTestCLMachineType.c 2009-04-14 10:46:17.125000000 +0200 @@ -0,0 +1 @@ +int dummy() { return 0;} diff -Nur cmake-2.6.3/Modules/CMakeVS8FindMake.cmake cmake-2.6.3-p1/Modules/CMakeVS8FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS8FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeVS8FindMake.cmake 2009-04-14 17:26:13.046875000 +0200 @@ -1,5 +1,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path] diff -Nur cmake-2.6.3/Modules/CMakeVS9FindMake.cmake cmake-2.6.3-p1/Modules/CMakeVS9FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS9FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeVS9FindMake.cmake 2009-04-14 17:26:01.328125000 +0200 @@ -1,5 +1,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path] diff -Nur cmake-2.6.3/Modules/Platform/WinCE-cl.cmake cmake-2.6.3-p1/Modules/Platform/WinCE-cl.cmake --- cmake-2.6.3/Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/WinCE-cl.cmake 2009-04-15 18:24:35.750000000 +0200 @@ -0,0 +1,39 @@ + +SET(WIN32 1) +SET(WINCE 1) + + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") +ENDIF(MSVC_VERSION GREATER 1310) + + +## Here we append important +IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET (CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} /D$(ARCHFAM) /D$(_ARCHFAM_) /D$(INSTRUCTIONSET)") + SET (CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} /D$(ARCHFAM) /D$(_ARCHFAM_) /D$(INSTRUCTIONSET)") +ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ws2.lib mmtimer.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce,${CMAKE_SYSTEM_VERSION}) +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce) + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff -Nur cmake-2.6.3/Modules/Platform/WinCE.cmake cmake-2.6.3-p1/Modules/Platform/WinCE.cmake --- cmake-2.6.3/Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/WinCE.cmake 2009-04-15 18:22:40.390625000 +0200 @@ -0,0 +1,28 @@ + +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "$(CEVER)") + ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + + diff -Nur cmake-2.6.3/Modules/Platform/Windows-cl.cmake cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake 2009-04-15 18:04:33.718750000 +0200 @@ -41,7 +41,8 @@ # that is automatically copied into try_compile directories # by the global generator. SET(MSVC_IDE 1) -IF(CMAKE_GENERATOR MATCHES "Makefiles") + +## IF(CMAKE_GENERATOR MATCHES "Makefiles") SET(MSVC_IDE 0) IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) SET(CMAKE_VC_COMPILER_TESTS 1) @@ -137,35 +138,86 @@ MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) - MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN - ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) + + # Testing the machine type of the generated binaries: + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/VC/bin" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "/Program Files/Microsoft Visual Studio 9/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + + ## TODO add further dumpbin machine to visual studio machine type conversion here, + ## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "CL platform seems to be:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") +## ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) ENDIF(CMAKE_FORCE_WIN64) @@ -228,14 +280,35 @@ # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + +SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + +# machine type +## IF(CMAKE_GENERATOR MATCHES "Makefiles") +## Setting machine makes only sense when linking cross compiled binaries with makefiles? + IF(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") + ELSE(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") + ENDIF(CMAKE_CL_MACHINE_TYPE) + + # append /ARMPADCODE + IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE ") + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + +## ELSE(CMAKE_GENERATOR MATCHES "Makefiles") + + IF(CMAKE_FORCE_WIN64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:x64") + ENDIF(CMAKE_FORCE_WIN64) + +## ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it diff -Nur cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake.in --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake.in 2009-04-14 10:46:17.140625000 +0200 @@ -3,6 +3,7 @@ SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) SET(CMAKE_CL_64 @CMAKE_CL_64@) +SET(CMAKE_CL_MACHINE_TYPE @CMAKE_CL_MACHINE_TYPE@) SET(MSVC60 @MSVC60@) SET(MSVC70 @MSVC70@) SET(MSVC71 @MSVC71@) diff -Nur cmake-2.6.3/Source/CMakeLists.txt cmake-2.6.3-p1/Source/CMakeLists.txt --- cmake-2.6.3/Source/CMakeLists.txt 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/CMakeLists.txt 2009-04-14 10:46:41.843750000 +0200 @@ -264,8 +264,12 @@ cmGlobalVisualStudio7Generator.h cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio8Generator.h + cmGlobalVisualStudio8_SDKGenerator.cxx + cmGlobalVisualStudio8_SDKGenerator.h cmGlobalVisualStudio9Generator.cxx cmGlobalVisualStudio9Generator.h + cmGlobalVisualStudio9_SDKGenerator.cxx + cmGlobalVisualStudio9_SDKGenerator.h cmGlobalVisualStudio8Win64Generator.cxx cmGlobalVisualStudio8Win64Generator.h cmGlobalVisualStudio9Win64Generator.cxx diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio71Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio71Generator.cxx 2009-04-14 10:46:41.828125000 +0200 @@ -34,6 +34,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion71(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.cxx 2009-04-14 10:46:41.781250000 +0200 @@ -139,6 +139,7 @@ { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -663,7 +664,12 @@ std::vector<std::string> *cmGlobalVisualStudio7Generator::GetConfigurations() { return &this->Configurations; -}; +} + +std::vector<PlatformDefs> *cmGlobalVisualStudio7Generator::GetPlatforms() +{ + return &this->platforms; +} //---------------------------------------------------------------------------- void cmGlobalVisualStudio7Generator diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.h 2009-04-14 10:46:41.546875000 +0200 @@ -22,6 +22,18 @@ class cmTarget; struct cmVS7FlagTable; +typedef struct { + int MajorVer; + int MinorVer; + std::string PlatformDefines; + std::string CEver; + std::string Archfam; + std::string Archfam_; + std::string InstructionSet; + std::string PlatformName; + bool added; +} PlatformDefs; + /** \class cmGlobalVisualStudio7Generator * \brief Write a Unix makefiles. * @@ -81,6 +93,12 @@ */ std::vector<std::string> *GetConfigurations(); + /** + * Get the list of platforms + */ + virtual std::vector<PlatformDefs> *GetPlatforms(); + + ///! Create a GUID or get an existing one. void CreateGUID(const char* name); std::string GetGUID(const char* name); @@ -160,6 +178,8 @@ // Set during OutputSLNFile with the name of the current project. // There is one SLN file per project. std::string CurrentProject; + + std::vector<PlatformDefs> platforms; // List of platforms }; #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK" diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.cxx 2009-04-14 10:46:41.625000000 +0200 @@ -36,6 +36,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -341,6 +342,10 @@ cmVS7FlagTable::UserValueRequired}, // There is no YX option in the VS8 IDE. + // WHY WAS THIS REMOVED FROM VS7 to VS8? + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + // Exception handling mode. If no entries match, it will be FALSE. {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.h 2009-04-14 10:46:41.843750000 +0200 @@ -67,7 +67,7 @@ virtual bool VSLinksDependencies() const { return false; } - static cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); virtual void AddPlatformDefinitions(cmMakefile* mf); virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-04-14 10:46:41.843750000 +0200 @@ -34,6 +34,7 @@ lg->SetVersion8(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 2009-04-14 14:54:06.031250000 +0200 @@ -0,0 +1,413 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" +#include "cmGeneratedFileStream.h" + +cmSDKConfigParser::cmSDKConfigParser() +: cmXMLParser() +{ + current_platform_valid = false; +} + +void cmSDKConfigParser::StartElement(const char* name, const char** atts) +{ + if ( strcmp(name, "Macro") == 0 ) + { + const char* rev = this->FindAttribute(atts, "Name"); + if (rev) + { + if ( strcmp(rev, "PLATFORMDEFINES") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + PlatformDefs * defs = &(this->platformVec.back()); + defs->PlatformDefines = std::string(rev); + + } + else if ( strcmp(rev, "CEVER") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + PlatformDefs * defs = &(this->platformVec.back()); + defs->CEver = std::string(rev); + } + else if ( strcmp(rev, "ARCHFAM") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + PlatformDefs * defs = &(this->platformVec.back()); + defs->Archfam = std::string(rev); + } + else if ( strcmp(rev, "_ARCHFAM_") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + PlatformDefs * defs = &(this->platformVec.back()); + defs->Archfam_ = std::string(rev); + } + else if ( strcmp(rev, "INSTRUCTIONSET") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + PlatformDefs * defs = &(this->platformVec.back()); + defs->InstructionSet= std::string(rev); + } + } + } + this->CharacterData.erase( + this->CharacterData.begin(), this->CharacterData.end()); +} + +void cmSDKConfigParser::EndElement(const char* name) +{ + if ( strcmp(name, "PlatformName") == 0 ) + { + PlatformDefs defs; defs.added = false; + defs.PlatformName = std::string(this->CharacterData.begin(),this->CharacterData.end()); + this->platformVec.push_back(defs); + current_platform_valid = true; + } + else if ( strcmp(name, "OSMinorVersion") == 0 && current_platform_valid) + { + PlatformDefs * defs = &(this->platformVec.back()); + defs->MinorVer = atoi(std::string(this->CharacterData.begin(),this->CharacterData.end()).c_str()); + } + else if ( strcmp(name, "OSMajorVersion") == 0 && current_platform_valid) + { + PlatformDefs * defs = &(this->platformVec.back()); + defs->MajorVer = atoi(std::string(this->CharacterData.begin(),this->CharacterData.end()).c_str()); + } + this->CharacterData.erase(this->CharacterData.begin(), + this->CharacterData.end()); +} + +void cmSDKConfigParser::CharacterDataHandler(const char* data, int length) +{ + this->CharacterData.insert(this->CharacterData.end(), data, data+length); +} + +const char* cmSDKConfigParser::FindAttribute( const char** atts, const char* attribute ) +{ + if ( !atts || !attribute ) + { + return 0; + } + const char **atr = atts; + while ( *atr && **atr && **(atr+1) ) + { + if ( strcmp(*atr, attribute) == 0 ) + { + return *(atr+1); + } + atr+=2; + } + return 0; +} + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio8_SDKGenerator::cmGlobalVisualStudio8_SDKGenerator() +{ + this->FindMakeProgramFile = "CMakeVS8FindMake.cmake"; + this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + GetSDKsInstalled(); + this->PlatformName = "Mobile Platform"; + +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio8_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetVersion8(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio .NET 2005 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::filterSDKs(std::vector<PlatformDefs>* platformvecptr) +{ + // here we inherit the platform vector from the parent + if(platformvecptr != 0) + { + platforms = *platformvecptr; + return; + } + + // HERE WE FILTER THE PLATFORMS GIVEN AN ALREADY EXISTING CACHE ENTRY! + std::vector<PlatformDefs> sdksfound; + std::swap(platforms, sdksfound); + + + cmake * c = this->GetCMakeInstance(); + char const* pEntry = c->GetCacheDefinition("PLATFORM_SDKS"); + if(pEntry) + { + std::vector<std::string> platforms2Use; + cmSystemTools::ExpandListArgument(pEntry, platforms2Use); + + for(std::vector<std::string>::const_iterator it = platforms2Use.begin(), + e = platforms2Use.end(); it != e; ++ it ) + { + for(std::vector<PlatformDefs>::iterator p_it = sdksfound.begin(), + p_end = sdksfound.end(); p_it != p_end; p_it++) + { + if(!p_it->added && *it == p_it->PlatformName) + { + platforms.push_back(*p_it); + p_it->added = true; + } + } + } + } + + // simply add all sdks found if no useful SDKs were found + if(platforms.size() == 0) + { + std::swap(platforms, sdksfound); + } +} + +void cmGlobalVisualStudio8_SDKGenerator::GetSDKsInstalled() +{ + // THIS MUST BE ADDED ACCORDING TO THE VS VERSION!!! + std::string regkey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\VisualStudio\\"); + regkey += "8.0"; + regkey += std::string("\\Setup\\VS;"); + + std::string base; + + if (!cmSystemTools::ReadRegistryValue((regkey+ + std::string("ProductDir")).c_str(), + base)) + { + return; + } + + cmSystemTools::ConvertToUnixSlashes(base); + + // NOW READ THE CONFIG FILE FOR THE SDKs + std::string configFilename = base + std::string("/VC/vcpackages/WCE.VCPlatform.config"); + cmSDKConfigParser *parser = new cmSDKConfigParser(); + if(parser->ParseFile(configFilename.c_str()) == 0) { + return; + } + platforms = parser->getPlatforms(); + delete parser; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::Configure() +{ + filterSDKs(); + + this->cmGlobalVisualStudio7Generator::Configure(); + this->CreateGUID(CMAKE_CHECK_BUILD_SYSTEM_TARGET); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteSLNFile( + std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators) +{ + // Make all targets depend on their respective project's build + // system check target. + unsigned int i; + for(i = 0; i < generators.size(); ++i) + { + if(this->IsExcluded(root, generators[i])) + { + continue; + } + cmMakefile* mf = generators[i]->GetMakefile(); + cmTargets& tgts = mf->GetTargets(); + for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + { + if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + for(unsigned int j = 0; j < generators.size(); ++j) + { + // Every target in all generators should depend on this target. + cmMakefile* lmf = generators[j]->GetMakefile(); + cmTargets &atgts = lmf->GetTargets(); + for(cmTargets::iterator al = atgts.begin(); al != atgts.end(); ++al) + { + al->second.AddUtility(l->first.c_str()); + } + } + } + } + } + + // Now write the solution file. + this->cmGlobalVisualStudio71Generator::WriteSLNFile(fout, root, generators); +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8_SDKGenerator +::WriteSolutionConfigurations(std::ostream& fout) +{ + fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"; + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + for(std::vector<PlatformDefs>::iterator j = this->platforms.begin(); + j != this->platforms.end(); ++j) + fout << "\t\t" << *i << "|" << j->PlatformName << " = " << *i << "|" + << j->PlatformName << "\n"; + + //fout << "\t\t" << *i << "|" << this->PlatformName << " = " << *i << "|" + // << this->PlatformName << "\n"; + + } + fout << "\tEndGlobalSection\n"; +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8_SDKGenerator +::WriteProjectConfigurations(std::ostream& fout, const char* name, + bool partOfDefaultBuild) +{ + std::string guid = this->GetGUID(name); + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + for(std::vector<PlatformDefs>::iterator j = this->platforms.begin(); + j != this->platforms.end(); ++j) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << j->PlatformName << ".ActiveCfg = " + << *i << "|" << j->PlatformName << "\n"; + if(partOfDefaultBuild) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << j->PlatformName << ".Build.0 = " + << *i << "|" << j->PlatformName << "\n"; + } + } + } +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraFlagTable[] = +{ + {"CallingConvention", "Gd", "cdecl", "0", 0 }, + {"CallingConvention", "Gr", "fastcall", "1", 0 }, + {"CallingConvention", "Gz", "stdcall", "2", 0 }, + + {"StringPooling", "GF", "Enable Stringpooling", "true", 0 }, + + {"Detect64BitPortabilityProblems", "Wp64", + "Detect 64Bit Portability Problems", "true", 0 }, + {"ErrorReporting", "errorReport:prompt", "Report immediately", "1", 0 }, + {"ErrorReporting", "errorReport:queue", "Queue for next login", "2", 0 }, + // Precompiled header and related options. Note that the + // UsePrecompiledHeader entries are marked as "Continue" so that the + // corresponding PrecompiledHeaderThrough entry can be found. + {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "2", + cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, + {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "", + cmVS7FlagTable::UserValueRequired}, + // There is no YX option in the VS8 IDE. + + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + + // Exception handling mode. If no entries match, it will be FALSE. + {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, + + // Compile for special architecture + {"CompileForArchitecture", "QRarch4", "ARM4 without Thumb instructions", "0", 0}, + {"CompileForArchitecture", "QRarch5", "ARM5 without Thumb instructions", "1", 0}, + {"CompileForArchitecture", "QRarch4t", "ARM4 with Thumb instructions", "2", 0}, + {"CompileForArchitecture", "QRarch5t", "ARM5 with Thumb instructions", "3", 0}, + + {0,0,0,0,0} +}; +cmVS7FlagTable const* cmGlobalVisualStudio8_SDKGenerator::GetExtraFlagTableVS8() +{ + return cmVS8SDKExtraFlagTable; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraLinkFlagTable[] = +{ + + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:POSIX", "Posix application output", "8", 0}, // THIS IS ONLY AVAILABLE ON VC 8 + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "9", 0}, + + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio8_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS8SDKExtraLinkFlagTable; +} \ No newline at end of file diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.h 2009-04-14 14:50:34.265625000 +0200 @@ -0,0 +1,92 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio8_SDKGenerator_h +#define cmGlobalVisualStudio8_SDKGenerator_h + +#include "cmGlobalVisualStudio8Generator.h" + +#include "cmXMLParser.h" + +class cmSDKConfigParser : public cmXMLParser +{ +public: + cmSDKConfigParser(); + + std::vector<PlatformDefs> & getPlatforms() {return platformVec;}; + std::vector<PlatformDefs> const& getPlatforms() const {return platformVec;}; + +protected: + void StartElement(const char* name, const char** atts); + void EndElement(const char* name); + void CharacterDataHandler(const char* data, int length); + const char* FindAttribute( const char** atts, const char* attribute ); +private: + std::vector<char> CharacterData; + std::vector<PlatformDefs> platformVec; + bool current_platform_valid; +}; + + +/** \class cmGlobalVisualStudio8Generator + * \brief Write a Unix makefiles. + * + * cmGlobalVisualStudio8Generator manages UNIX build process for a tree + */ +class cmGlobalVisualStudio8_SDKGenerator : public cmGlobalVisualStudio8Generator +{ +public: + cmGlobalVisualStudio8_SDKGenerator(); + static cmGlobalGenerator* New() { + return new cmGlobalVisualStudio8_SDKGenerator; } + + ///! Get the name for the generator. + virtual const char* GetName() const { + return cmGlobalVisualStudio8_SDKGenerator::GetActualName();} + static const char* GetActualName() {return "Visual Studio 8 2005 (with SDK support)";} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! Create a local generator appropriate to this Global Generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Override Configure and Generate to add the build-system check + * target. + */ + virtual void Configure(); + + void filterSDKs(std::vector<PlatformDefs>* platforms = 0); + +protected: + + virtual bool VSLinksDependencies() const { return false; } + + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); + virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators); + virtual void WriteSolutionConfigurations(std::ostream& fout); + virtual void WriteProjectConfigurations(std::ostream& fout, + const char* name, + bool partOfDefaultBuild); + + virtual void GetSDKsInstalled(); + + std::string PlatformName; // Win32 or x64 +}; +#endif diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Generator.cxx 2009-04-14 10:46:41.578125000 +0200 @@ -46,6 +46,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-04-14 10:46:41.546875000 +0200 @@ -31,6 +31,7 @@ lg->SetVersion9(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 2009-04-14 10:46:41.781250000 +0200 @@ -0,0 +1,190 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.6 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio9_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio9_SDKGenerator::cmGlobalVisualStudio9_SDKGenerator() +{ + this->FindMakeProgramFile = "CMakeVS9FindMake.cmake"; + this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + GetSDKsInstalled(); + this->PlatformName = "Mobile Platform"; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC90", "1"); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n"; + fout << "# Visual Studio 2008\n"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio9_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetVersion9(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::GetSDKsInstalled() +{ + // THIS MUST BE ADDED ACCORDING TO THE VS VERSION!!! + std::string regkey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\VisualStudio\\"); + regkey += "9.0"; + regkey += std::string("\\Setup\\VS;"); + + std::string base; + + if (!cmSystemTools::ReadRegistryValue((regkey+ + std::string("ProductDir")).c_str(), + base)) + { + return; + } + + cmSystemTools::ConvertToUnixSlashes(base); + + // NOW READ THE CONFIG FILE FOR THE SDKs + std::string configFilename = base + std::string("/VC/vcpackages/WCE.VCPlatform.config"); + cmSDKConfigParser *parser = new cmSDKConfigParser(); + if(parser->ParseFile(configFilename.c_str()) == 0) { + return; + } + platforms = parser->getPlatforms(); + delete parser; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio 9 2008 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::EnableLanguage(std::vector<std::string>const & lang, + cmMakefile *mf, bool optional) +{ + cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosDirectory() +{ + std::string base; + std::string path; + + // base begins with the VisualStudioProjectsLocation reg value... + if (cmSystemTools::ReadRegistryValue( + "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;" + "VisualStudioProjectsLocation", + base)) + { + cmSystemTools::ConvertToUnixSlashes(base); + + // 9.0 macros folder: + path = base + "/VSMacros80"; + // *NOT* a typo; right now in Visual Studio 2008 beta the macros + // folder is VSMacros80... They may change it to 90 before final + // release of 2008 or they may not... we'll have to keep our eyes + // on it + } + + // path is (correctly) still empty if we did not read the base value from + // the Registry value + return path; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosRegKeyBase() +{ + return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros"; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS9SDKExtraLinkFlagTable[] = +{ + + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "8", 0}, + + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio9_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS9SDKExtraLinkFlagTable; +} \ No newline at end of file diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.h 2009-04-14 10:46:41.828125000 +0200 @@ -0,0 +1,75 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.4 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio9_SDKGenerator_h +#define cmGlobalVisualStudio9_SDKGenerator_h + +#include "cmGlobalVisualStudio8_SDKGenerator.h" + + +/** \class cmGlobalVisualStudio9_WindowsMobile_Generator + * \brief Write a Unix makefiles. + * + * cmGlobalVisualStudio9_WindowsMobile_Generator manages UNIX build process for a tree + */ +class cmGlobalVisualStudio9_SDKGenerator : + public cmGlobalVisualStudio8_SDKGenerator +{ +public: + cmGlobalVisualStudio9_SDKGenerator(); + static cmGlobalGenerator* New() { + return new cmGlobalVisualStudio9_SDKGenerator; } + + ///! Get the name for the generator. + virtual const char* GetName() const { + return cmGlobalVisualStudio9_SDKGenerator::GetActualName();} + static const char* GetActualName() {return "Visual Studio 9 2008 (with SDK support)";} + virtual void AddPlatformDefinitions(cmMakefile* mf); + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! create the correct local generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Try to determine system infomation such as shared library + * extension, pthreads, byte order etc. + */ + virtual void EnableLanguage(std::vector<std::string>const& languages, + cmMakefile *, bool optional); + + virtual void WriteSLNHeader(std::ostream& fout); + + /** + * Where does this version of Visual Studio look for macros for the + * current user? Returns the empty string if this version of Visual + * Studio does not implement support for VB macros. + */ + virtual std::string GetUserMacrosDirectory(); + + /** + * What is the reg key path to "vsmacros" for this version of Visual + * Studio? + */ + virtual std::string GetUserMacrosRegKeyBase(); + +protected: + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); + + virtual void GetSDKsInstalled(); +}; +#endif diff -Nur cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.cxx 2009-04-15 17:46:48.281250000 +0200 @@ -536,9 +536,10 @@ bool& flag_handled); }; -void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, +void cmLocalVisualStudio7Generator::WritePlatformConfiguration(std::ostream& fout, const char* configName, const char *libName, + const char *platformName, cmTarget &target) { const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); @@ -546,9 +547,23 @@ { mfcFlag = "0"; } + + const char* wholeprogoptFlag; + if(strcmp(configName,"Release")==0) + wholeprogoptFlag = this->Makefile->GetDefinition("CMAKE_WHOLEPROGOPT_FLAG_RELEASE"); + else + wholeprogoptFlag = this->Makefile->GetDefinition("CMAKE_WHOLEPROGOPT_FLAG_DEBUG"); + if(!wholeprogoptFlag) + { + wholeprogoptFlag = "0"; + } + fout << "\t\t<Configuration\n" - << "\t\t\tName=\"" << configName << "|" << this->PlatformName << "\"\n" - << "\t\t\tOutputDirectory=\"" << configName << "\"\n"; + << "\t\t\tName=\"" << configName << "|" << platformName << "\"\n"; + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + fout << "\t\t\tOutputDirectory=\"" << configName << "\"\n"; + else + fout << "\t\t\tOutputDirectory=\"" << platformName << "\\" << configName << "\"\n"; // This is an internal type to Visual Studio, it seems that: // 4 == static library // 2 == dll @@ -661,12 +676,15 @@ // target and a subdirectory for the configuration name. std::string intermediateDir = this->GetTargetDirectory(target); intermediateDir += "/"; + if(strcmp(platformName,"Win32") != 0 && strcmp(platformName,"x64") != 0) + intermediateDir += std::string(platformName) + "/"; intermediateDir += configName; fout << "\t\t\tIntermediateDirectory=\"" << this->ConvertToXMLOutputPath(intermediateDir.c_str()) << "\"\n" << "\t\t\tConfigurationType=\"" << configType << "\"\n" << "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n" + << "\t\t\tWholeProgramOptimization=\"" << wholeprogoptFlag << "\"\n" << "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n"; // If unicode is enabled change the character set to unicode, if not @@ -737,9 +755,18 @@ { // We need to specify a program database file name even for // non-debug configurations because VS still creates .idb files. +if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) +{ fout << "\t\t\t\tProgramDataBaseFileName=\"" - << target.GetDirectory(configName) << "/" - << target.GetPDBName(configName) << "\"\n"; + << target.GetDirectory(configName) << "/"; +} +else +{ + fout << "\t\t\t\tProgramDataBaseFileName=\"" + << target.GetDirectory() << "/" << + std::string(platformName) << "/" << std::string(configName) << "/"; +} + fout << target.GetPDBName(configName) << "\"\n"; } fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool tool = "VCCustomBuildTool"; @@ -815,10 +842,28 @@ } this->OutputTargetRules(fout, configName, target, libName); - this->OutputBuildTool(fout, configName, target, targetOptions.IsDebug()); + this->OutputBuildTool(fout, configName, platformName, target, targetOptions.IsDebug()); fout << "\t\t</Configuration>\n"; } +void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + cmTarget &target) +{ + if((this->PlatformName).compare("Mobile Platform") == 0) + { + cmGlobalVisualStudio7Generator *gg = static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); + for(std::vector<PlatformDefs>::iterator j = (gg->GetPlatforms())->begin(); + j != (gg->GetPlatforms())->end(); ++j) + WritePlatformConfiguration(fout,configName,libName,(j->PlatformName).c_str(),target); + } + else + { + WritePlatformConfiguration(fout,configName,libName,(this->PlatformName).c_str(),target); + } +} + //---------------------------------------------------------------------------- std::string cmLocalVisualStudio7Generator @@ -837,6 +882,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, const char* configName, + const char* platformName, cmTarget &target, bool isDebug) { @@ -879,15 +925,25 @@ extraLinkOptions += " "; extraLinkOptions += targetLinkFlags; } - Options linkOptions(this, this->Version, Options::Linker); + Options linkOptions(this, this->Version, Options::Linker, this->ExtraLinkFlagTable); // MODIFIED BY CLEMENS linkOptions.Parse(extraLinkOptions.c_str()); switch(target.GetType()) { case cmTarget::STATIC_LIBRARY: { std::string targetNameFull = target.GetFullName(configName); - std::string libpath = target.GetDirectory(configName); + std::string libpath; + + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { + libpath = target.GetDirectory(configName); libpath += "/"; + } + else + { + libpath = target.GetDirectory(); + libpath += "/" + std::string(platformName) + "/" + std::string(configName) + "/"; + } libpath += targetNameFull; const char* tool = "VCLibrarianTool"; if(this->FortranProject) @@ -937,15 +993,29 @@ fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " - << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) - << " "; + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; temp = target.GetDirectory(configName); temp += "/"; + } + else + { + temp = target.GetDirectory(); + temp += "/" + std::string(platformName) + "/" + std::string(configName) + "/"; + + fout << "\t\t\t\tAdditionalDependencies=\" "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)" << "\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1" << "\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0" << "\"\n"; + } temp += targetNameFull; fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; @@ -955,8 +1025,17 @@ this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; this->OutputModuleDefinitionFile(fout, target); + + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { temp = target.GetDirectory(configName); temp += "/"; + } + else + { + temp = target.GetDirectory(); + temp += "/" + std::string(platformName) + "/" + std::string(configName) + "/"; + } temp += targetNamePDB; fout << "\t\t\t\tProgramDataBaseFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; @@ -972,8 +1051,17 @@ { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n"; } + + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { temp = target.GetDirectory(configName, true); temp += "/"; + } + else + { + temp = target.GetDirectory("",true); + temp += "/" + std::string(platformName) + "/" + std::string(configName) + "/"; + } temp += targetNameImport; fout << "\t\t\t\tImportLibrary=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n"; @@ -1009,6 +1097,8 @@ } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. @@ -1017,8 +1107,32 @@ << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; + } else + { + linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + // Use the NOINHERIT macro to avoid getting VS project default + // libraries which may be set by the user to something bad. + fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) + << " "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)" << "\"\n"; + //fout << "\t\t\t\tSubSystem=\"0" << "\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1" << "\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0" << "\"\n"; + } + if( strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0 || + strcmp(target.GetName(),"cmTryCompileExec") == 0 ) + // this is stupid hack to keep the try_compile stuff working for other platforms + { temp = target.GetDirectory(configName); temp += "/"; + } else { + temp = target.GetDirectory(); + temp += "/" + std::string(platformName) + "/" + std::string(configName) + "/"; + } temp += targetNameFull; fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; @@ -1027,20 +1141,41 @@ fout << "\t\t\t\tAdditionalLibraryDirectories=\""; this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; - fout << "\t\t\t\tProgramDataBaseFile=\"" - << target.GetDirectory(configName) << "/" << targetNamePDB + fout << "\t\t\t\tProgramDataBaseFile=\""; + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { + fout << target.GetDirectory(configName) << "/" << targetNamePDB + << "\"\n"; + } + else + { + fout << target.GetDirectory() << "/" << + std::string(platformName) << "/" << std::string(configName) << "/" << targetNamePDB << "\"\n"; + } if(isDebug) { fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; } - if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) { - fout << "\t\t\t\tSubSystem=\"2\"\n"; - } + if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + fout << "\t\t\t\tSubSystem=\"2\"\n"; + } + else + { + fout << "\t\t\t\tSubSystem=\"1\"\n"; + } + } else { - fout << "\t\t\t\tSubSystem=\"1\"\n"; + // assumge WinCE/Windows Mobile + fout << "\t\t\t\tSubSystem=\"9\"\n"; + if ( ! target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + fout << "\t\t\t\EntryPointSymbol=\"mainACRTStartup\"\n"; + } } std::string stackVar = "CMAKE_"; stackVar += linkLanguage; @@ -1050,8 +1185,18 @@ { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\""; } + + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { temp = target.GetDirectory(configName, true); temp += "/"; + } + else + { + temp = target.GetDirectory("",true); + temp += "/" + std::string(platformName) + "/" + std::string(configName) + "/"; + } + temp += targetNameImport; fout << "\t\t\t\tImportLibrary=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n"; @@ -1379,6 +1524,9 @@ dir_max += config_max; dir_max += "/"; + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + // Loop through each source in the source group. std::string objectName; for(std::vector<const cmSourceFile *>::const_iterator sf = @@ -1432,6 +1580,50 @@ fci = fcinfo.FileConfigMap.begin(); fci != fcinfo.FileConfigMap.end(); ++fci) { + if((this->PlatformName).compare("Mobile Platform") == 0) + for(std::vector<PlatformDefs>::iterator j = (gg->GetPlatforms())->begin(); + j != (gg->GetPlatforms())->end(); ++j) + { + cmLVS7GFileConfig const& fc = fci->second; + fout << "\t\t\t\t<FileConfiguration\n" + << "\t\t\t\t\tName=\"" << fci->first + << "|" << j->PlatformName << "\""; + if(fc.ExcludedFromBuild) + { + fout << " ExcludedFromBuild=\"true\""; + } + fout << ">\n"; + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n"; + if(!fc.CompileFlags.empty() || + !fc.CompileDefs.empty() || + !fc.CompileDefsConfig.empty()) + { + Options fileOptions(this, this->Version, Options::Compiler, + this->ExtraFlagTable); + fileOptions.Parse(fc.CompileFlags.c_str()); + fileOptions.AddDefines(fc.CompileDefs.c_str()); + fileOptions.AddDefines(fc.CompileDefsConfig.c_str()); + fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n"); + fileOptions.OutputFlagMap(fout, "\t\t\t\t\t"); + fileOptions.OutputPreprocessorDefinitions(fout, + "\t\t\t\t\t", "\n"); + } + if(!fc.AdditionalDeps.empty()) + { + fout << "\t\t\t\t\tAdditionalDependencies=\"" + << fc.AdditionalDeps.c_str() << "\"\n"; + } + if(!fc.ObjectName.empty()) + { + fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" + << fc.ObjectName.c_str() << "\"\n"; + } + fout << "\t\t\t\t\t/>\n" + << "\t\t\t\t</FileConfiguration>\n"; + } + else + { cmLVS7GFileConfig const& fc = fci->second; fout << "\t\t\t\t<FileConfiguration\n" << "\t\t\t\t\tName=\"" << fci->first @@ -1471,6 +1663,7 @@ << "\t\t\t\t</FileConfiguration>\n"; } } + } fout << "\t\t\t</File>\n"; } } @@ -1499,9 +1692,9 @@ // Write the rule for each configuration. std::vector<std::string>::iterator i; - std::vector<std::string> *configs = - static_cast<cmGlobalVisualStudio7Generator *> - (this->GlobalGenerator)->GetConfigurations(); + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + std::vector<std::string> *configs = gg->GetConfigurations(); const char* compileTool = "VCCLCompilerTool"; if(this->FortranProject) { @@ -1514,6 +1707,83 @@ } for(i = configs->begin(); i != configs->end(); ++i) { + if((this->PlatformName).compare("Mobile Platform") == 0) + for(std::vector<PlatformDefs>::iterator j = (gg->GetPlatforms())->begin(); + j != (gg->GetPlatforms())->end(); ++j) + { + cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; + fout << "\t\t\t\t<FileConfiguration\n"; + fout << "\t\t\t\t\tName=\"" << *i << "|" << j->PlatformName << "\">\n"; + if(!fc.CompileFlags.empty()) + { + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << compileTool << "\"\n" + << "\t\t\t\t\tAdditionalOptions=\"" + << this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n"; + } + + std::string script = + this->ConstructScript(command.GetCommandLines(), + command.GetWorkingDirectory(), + i->c_str(), + command.GetEscapeOldStyle(), + command.GetEscapeAllowMakeVars()); + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << customTool << "\"\n" + << "\t\t\t\t\tDescription=\"" + << this->EscapeForXML(comment.c_str()) << "\"\n" + << "\t\t\t\t\tCommandLine=\"" + << this->EscapeForXML(script.c_str()) << "\"\n" + << "\t\t\t\t\tAdditionalDependencies=\""; + if(command.GetDepends().empty()) + { + // There are no real dependencies. Produce an artificial one to + // make sure the rule runs reliably. + if(!cmSystemTools::FileExists(source)) + { + std::ofstream depout(source); + depout << "Artificial dependency for a custom command.\n"; + } + fout << this->ConvertToXMLOutputPath(source); + } + else + { + // Write out the dependencies for the rule. + for(std::vector<std::string>::const_iterator d = + command.GetDepends().begin(); + d != command.GetDepends().end(); + ++d) + { + // Get the real name of the dependency in case it is a CMake target. + std::string dep = this->GetRealDependency(d->c_str(), i->c_str()); + fout << this->ConvertToXMLOutputPath(dep.c_str()) + << ";"; + } + } + fout << "\"\n"; + fout << "\t\t\t\t\tOutputs=\""; + if(command.GetOutputs().empty()) + { + fout << source << "_force"; + } + else + { + // Write a rule for the output generated by this command. + const char* sep = ""; + for(std::vector<std::string>::const_iterator o = + command.GetOutputs().begin(); + o != command.GetOutputs().end(); + ++o) + { + fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str()); + sep = ";"; + } + } + fout << "\"/>\n"; + fout << "\t\t\t\t</FileConfiguration>\n"; + } + else + { cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; fout << "\t\t\t\t<FileConfiguration\n"; fout << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n"; @@ -1586,6 +1856,7 @@ fout << "\t\t\t\t</FileConfiguration>\n"; } } +} void cmLocalVisualStudio7Generator::WriteVCProjBeginGroup(std::ostream& fout, @@ -1789,13 +2060,19 @@ } if(projectType) { - fout << "\tProjectType=\"" << projectType << "\"\n"; + fout << "\tProjectType=\"" << projectType << "\">\n"; } fout<< "\tKeyword=\"" << keyword << "\">\n" << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if((this->PlatformName).compare("Mobile Platform") == 0) + for(std::vector<PlatformDefs>::iterator j = (gg->GetPlatforms())->begin(); + j != (gg->GetPlatforms())->end(); ++j) + fout << "\t\t<Platform\n\t\t\tName=\"" << j->PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } @@ -1850,9 +2127,15 @@ << "\tSccProvider=\"" << vsProvider << "\"\n"; } fout << "\tKeyword=\"" << keyword << "\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if((this->PlatformName).compare("Mobile Platform") == 0) + for(std::vector<PlatformDefs>::iterator j = (gg->GetPlatforms())->begin(); + j != (gg->GetPlatforms())->end(); ++j) + fout << "\t\t<Platform\n\t\t\tName=\"" << j->PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } diff -Nur cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.h 2009-04-14 10:46:41.859375000 +0200 @@ -68,6 +68,8 @@ void SetExtraFlagTable(cmVS7FlagTable const* table) { this->ExtraFlagTable = table; } + void SetExtraLinkFlagTable(cmVS7FlagTable const* table) + { this->ExtraLinkFlagTable = table; } private: typedef cmLocalVisualStudio7GeneratorOptions Options; typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; @@ -85,6 +87,11 @@ void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); cmSourceFile* CreateVCProjBuildRule(); + void WritePlatformConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + const char *platformName, + cmTarget &target); void WriteConfigurations(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfiguration(std::ostream& fout, @@ -96,7 +103,7 @@ void OutputTargetRules(std::ostream& fout, const char* configName, cmTarget &target, const char *libName); void OutputBuildTool(std::ostream& fout, const char* configName, - cmTarget& t, bool debug); + const char* platformName, cmTarget& t, bool debug); void OutputLibraryDirectories(std::ostream& fout, std::vector<std::string> const& dirs); void OutputModuleDefinitionFile(std::ostream& fout, cmTarget &target); @@ -124,6 +131,7 @@ friend class cmLocalVisualStudio7GeneratorInternals; cmVS7FlagTable const* ExtraFlagTable; + cmVS7FlagTable const* ExtraLinkFlagTable; std::string ModuleDefinitionFile; int Version; bool FortranProject; diff -Nur cmake-2.6.3/Source/cmMakefile.cxx cmake-2.6.3-p1/Source/cmMakefile.cxx --- cmake-2.6.3/Source/cmMakefile.cxx 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmMakefile.cxx 2009-04-14 10:46:41.765625000 +0200 @@ -21,6 +21,10 @@ #include "cmSourceFileLocation.h" #include "cmSystemTools.h" #include "cmGlobalGenerator.h" +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW) +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" +#endif #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" @@ -2740,8 +2744,9 @@ std::string cmakeCommand = this->GetDefinition("CMAKE_COMMAND"); cmake cm; cm.SetIsInTryCompile(true); - cmGlobalGenerator *gg = cm.CreateGlobalGenerator - (this->LocalGenerator->GetGlobalGenerator()->GetName()); + cmGlobalGenerator *parentgg = this->LocalGenerator->GetGlobalGenerator(); + std::string parentggname(parentgg->GetName()); + cmGlobalGenerator *gg = cm.CreateGlobalGenerator(parentggname.c_str()); if (!gg) { cmSystemTools::Error( @@ -2750,6 +2755,22 @@ cmSystemTools::ChangeDirectory(cwd.c_str()); return 1; } + // check to update platforms list if it is an SDK based builder +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW) + if(parentggname.compare(cmGlobalVisualStudio8_SDKGenerator::GetActualName()) == 0) + { // gg should inherit platform vector from parent + cmGlobalVisualStudio8_SDKGenerator* srcgg = static_cast<cmGlobalVisualStudio8_SDKGenerator*>(parentgg); + cmGlobalVisualStudio8_SDKGenerator* targg = static_cast<cmGlobalVisualStudio8_SDKGenerator*>(gg); + targg->filterSDKs(srcgg->GetPlatforms()); + } + else if(parentggname.compare(cmGlobalVisualStudio9_SDKGenerator::GetActualName()) == 0) + { // gg should inherit platform vector from parent + cmGlobalVisualStudio9_SDKGenerator* srcgg = static_cast<cmGlobalVisualStudio9_SDKGenerator*>(parentgg); + cmGlobalVisualStudio9_SDKGenerator* targg = static_cast<cmGlobalVisualStudio9_SDKGenerator*>(gg); + targg->filterSDKs(srcgg->GetPlatforms()); + } +#endif + cm.SetGlobalGenerator(gg); // do a configure diff -Nur cmake-2.6.3/Source/cmake.cxx cmake-2.6.3-p1/Source/cmake.cxx --- cmake-2.6.3/Source/cmake.cxx 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmake.cxx 2009-04-14 10:46:41.625000000 +0200 @@ -65,6 +65,8 @@ # include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio8Generator.h" # include "cmGlobalVisualStudio9Generator.h" +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" # include "cmGlobalVisualStudio9Win64Generator.h" # include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" @@ -2414,6 +2416,10 @@ &cmGlobalVisualStudio8Generator::New; this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = &cmGlobalVisualStudio9Generator::New; + this->Generators[cmGlobalVisualStudio8_SDKGenerator::GetActualName()] = + &cmGlobalVisualStudio8_SDKGenerator::New; + this->Generators[cmGlobalVisualStudio9_SDKGenerator::GetActualName()] = + &cmGlobalVisualStudio9_SDKGenerator::New; this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = &cmGlobalVisualStudio9Win64Generator::New; this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = diff -Nur cmake-2.6.3/Tests/CMakeLists.txt cmake-2.6.3-p1/Tests/CMakeLists.txt --- cmake-2.6.3/Tests/CMakeLists.txt 2009-02-21 21:36:55.000000000 +0100 +++ cmake-2.6.3-p1/Tests/CMakeLists.txt 2009-04-14 10:46:41.921875000 +0200 @@ -65,6 +65,19 @@ SET(CMAKE_LONG_TEST_TIMEOUT 1500) ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003/CMakeCache.txt.in" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003/CMakeCache.txt" COPYONLY + ) + ADD_TEST(SimplePPC2003 ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003" + --build-two-config + --build-generator "Visual Studio 9 2008 (with SDK support)" + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project SimplePPC2003) + # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) ADD_TEST_MACRO(FindPackageTest FindPackageTest) @@ -429,6 +442,7 @@ --test-command Tutorial 25.0) ENDFOREACH(STP) + ADD_TEST(testing ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Testing" diff -Nur cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeCache.txt.in --- cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeCache.txt.in 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,5 @@ +//SDK to use +CMAKE_GENERATOR:INTERNAL=Visual Studio 9 2008 (with SDK support) +CMAKE_SYSTEM_NAME:STRING=WINCE +CMAKE_SYSTEM_VERSION:STRING=4.20 +PLATFORM_SDKS:STRING=Pocket PC 2003 (ARMV4) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeLists.txt --- cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeLists.txt 2009-04-14 10:46:41.921875000 +0200 @@ -0,0 +1,14 @@ +# a simple test case for compiling a PPC 2003 project +PROJECT(SimplePPC2003) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(RESOURCEFILES resourceppc.h SimplePPC2003ppc.rc SimplePPC2003ppc.rc2) +SET(SOURCEFILES SimplePPC2003.cpp stdafx.cpp) +SET(HEADERFILES stdafx.h SimplePPC2003.h) + +ADD_DEFINITIONS(-DWINCE -D$(ARCHFAM) -D$(_ARCHFAM_) -D_UNICODE -DUNICODE -D_USRDLL ) + +ADD_EXECUTABLE(SimplePPC2003 ${RESOURCEFILES} ${SOURCEFILES} ${HEADERFILES}) + +SET_TARGET_PROPERTIES(SimplePPC2003 PROPERTIES LINK_FLAGS /machine:ARM) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake cmake-2.6.3-p1/Tests/SimplePPC2003/GetCompilerVersion.cmake --- cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/GetCompilerVersion.cmake 2009-04-14 10:46:41.859375000 +0200 @@ -0,0 +1,95 @@ + +FIND_PROGRAM(CMAKE_VCVARS + NAMES vcvarsall.bat + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC" + ) + +# Testing the machine type of the generated binaries: +FIND_PROGRAM(CMAKE_TEST_COMPILER + NAMES cl.exe + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + ) + +SET(testNmakeCLVersionFile + "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c") +STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}") + +EXEC_PROGRAM("\"${CMAKE_VCVARS}\" && \"${CMAKE_TEST_COMPILER}\" /nologo -EP \"${testNmakeCLVersionFile}\"" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT + RETURN_VALUE CMAKE_COMPILER_RETURN + ) + +IF(NOT CMAKE_COMPILER_RETURN) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining the version of compiler passed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}") + STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1" + compilerVersion "${compilerVersion}") + MESSAGE(STATUS "Check for CL compiler version - ${compilerVersion}") + SET(MSVC60) + SET(MSVC70) + SET(MSVC71) + SET(MSVC80) + SET(CMAKE_COMPILER_2005) + IF("${compilerVersion}" LESS 1300) + SET(MSVC60 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1) + ENDIF("${compilerVersion}" LESS 1300) + IF("${compilerVersion}" EQUAL 1300) + SET(MSVC70 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1300) + IF("${compilerVersion}" EQUAL 1310) + SET(MSVC71 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1310) + IF("${compilerVersion}" EQUAL 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" EQUAL 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" EQUAL 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" EQUAL 1500) + IF("${compilerVersion}" GREATER 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" GREATER 1500) + SET(MSVC_VERSION "${compilerVersion}") +ELSE(NOT CMAKE_COMPILER_RETURN) + MESSAGE(STATUS "Check for CL compiler version - failed") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining the version of compiler failed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") +ENDIF(NOT CMAKE_COMPILER_RETURN) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.cpp --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.cpp 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,259 @@ +// SimplePPC2003.cpp : Defines the entry point for the application. +// + +#include "stdafx.h" +#include "SimplePPC2003.h" + + +#define MAX_LOADSTRING 100 + +// Global Variables: +HINSTANCE g_hInst; // current instance +HWND g_hWndMenuBar; // menu bar handle + +// Forward declarations of functions included in this code module: +ATOM MyRegisterClass(HINSTANCE, LPTSTR); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); + +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + MSG msg; + + // Perform application initialization: + if (!InitInstance(hInstance, nCmdShow)) + { + return FALSE; + } + + HACCEL hAccelTable; + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SIMPLEPPC2003)); + + // Main message loop: + while (GetMessage(&msg, NULL, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + +// +// FUNCTION: MyRegisterClass() +// +// PURPOSE: Registers the window class. +// +// COMMENTS: +// +ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) +{ + WNDCLASS wc; + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SIMPLEPPC2003)); + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = 0; + wc.lpszClassName = szWindowClass; + + return RegisterClass(&wc); +} + +// +// FUNCTION: InitInstance(HINSTANCE, int) +// +// PURPOSE: Saves instance handle and creates main window +// +// COMMENTS: +// +// In this function, we save the instance handle in a global variable and +// create and display the main program window. +// +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + HWND hWnd; + TCHAR szTitle[MAX_LOADSTRING]; // title bar text + TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name + + g_hInst = hInstance; // Store instance handle in our global variable + + // SHInitExtraControls should be called once during your application's initialization to initialize any + // of the device specific controls such as CAPEDIT and SIPPREF. + SHInitExtraControls(); + + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDC_SIMPLEPPC2003, szWindowClass, MAX_LOADSTRING); + + //If it is already running, then focus on the window, and exit + hWnd = FindWindow(szWindowClass, szTitle); + if (hWnd) + { + // set focus to foremost child window + // The "| 0x00000001" is used to bring any owned windows to the foreground and + // activate them. + SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); + return 0; + } + + if (!MyRegisterClass(hInstance, szWindowClass)) + { + return FALSE; + } + + hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); + + if (!hWnd) + { + return FALSE; + } + + // When the main window is created using CW_USEDEFAULT the height of the menubar (if one + // is created is not taken into account). So we resize the window after creating it + // if a menubar is present + if (g_hWndMenuBar) + { + RECT rc; + RECT rcMenuBar; + + GetWindowRect(hWnd, &rc); + GetWindowRect(g_hWndMenuBar, &rcMenuBar); + rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top); + + MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE); + } + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + + return TRUE; +} + +// +// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) +// +// PURPOSE: Processes messages for the main window. +// +// WM_COMMAND - process the application menu +// WM_PAINT - Paint the main window +// WM_DESTROY - post a quit message and return +// +// +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + PAINTSTRUCT ps; + HDC hdc; + + static SHACTIVATEINFO s_sai; + + switch (message) + { + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + // Parse the menu selections: + switch (wmId) + { + case IDM_HELP_ABOUT: + DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, About); + break; + case IDM_OK: + SendMessage (hWnd, WM_CLOSE, 0, 0); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + case WM_CREATE: + SHMENUBARINFO mbi; + + memset(&mbi, 0, sizeof(SHMENUBARINFO)); + mbi.cbSize = sizeof(SHMENUBARINFO); + mbi.hwndParent = hWnd; + mbi.nToolBarId = IDR_MENU; + mbi.hInstRes = g_hInst; + + if (!SHCreateMenuBar(&mbi)) + { + g_hWndMenuBar = NULL; + } + else + { + g_hWndMenuBar = mbi.hwndMB; + } + + // Initialize the shell activate info structure + memset(&s_sai, 0, sizeof (s_sai)); + s_sai.cbSize = sizeof (s_sai); + break; + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + + // TODO: Add any drawing code here... + + EndPaint(hWnd, &ps); + break; + case WM_DESTROY: + CommandBar_Destroy(g_hWndMenuBar); + PostQuitMessage(0); + break; + + case WM_ACTIVATE: + // Notify shell of our activate message + SHHandleWMActivate(hWnd, wParam, lParam, &s_sai, FALSE); + break; + case WM_SETTINGCHANGE: + SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai); + break; + + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +// Message handler for about box. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + { + // Create a Done button and size it. + SHINITDLGINFO shidi; + shidi.dwMask = SHIDIM_FLAGS; + shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_EMPTYMENU; + shidi.hDlg = hDlg; + SHInitDialog(&shidi); + } + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + break; + + case WM_CLOSE: + EndDialog(hDlg, message); + return TRUE; + + } + return (INT_PTR)FALSE; +} diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.h --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.h 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,2 @@ +#pragma once +#include "resourceppc.h" diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,170 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resourceppc.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#include "resdefce.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +//IDI_SIMPLEPPC2003 ICON "SimplePPC2003.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU MENU DISCARDABLE +BEGIN + POPUP "Help" + BEGIN + MENUITEM "About", IDM_HELP_ABOUT + END +END + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_SIMPLEPPC2003 ACCELERATORS +BEGIN + "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT + "Q", IDM_OK, VIRTKEY, CONTROL, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG 0, 0, 156, 129 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,12,36,70,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,12,48,66,8 +END + +IDD_ABOUTBOX_WIDE DIALOG 0, 0, 210, 129 +STYLE WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,48,12,66,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,48,24,66,8 +END + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 149 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END + + IDD_ABOUTBOX_WIDE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END +END +#endif // APSTUDIO_INVOKED + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resourceppc.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#include ""resdefce.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""SimplePPC2003ppc.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// +STRINGTABLE +BEGIN + IDC_SIMPLEPPC2003 "SIMPLEPPC2003" + IDS_APP_TITLE "SimplePPC2003" + IDS_OK "OK" + IDS_HELP "HELP" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "SimplePPC2003ppc.rc2" // non-Microsoft Visual C++ edited resources +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,35 @@ +// +// SimplePPC2003PPC.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// +HI_RES_AWARE CEUX {1} // turn off the emulation layer + // Remove this resource to enable pixel- + // doubling on platforms that support it +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// +// SHMENUBAR +// + +IDR_MENU SHMENUBAR DISCARDABLE +BEGIN + IDR_MENU, + 2, + + I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, + IDS_OK, 0, NOMENU, + + I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, + IDS_HELP, 0, 0, +END + diff -Nur cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h cmake-2.6.3-p1/Tests/SimplePPC2003/resourceppc.h --- cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/resourceppc.h 2009-04-14 10:46:41.875000000 +0200 @@ -0,0 +1,34 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SimplePPC2003ppc.rc +// + +#define IDS_APP_TITLE 1 +#define IDC_SIMPLEPPC2003 2 +#define IDI_SIMPLEPPC2003 101 +#define IDR_MENU 102 +#define IDS_OK 103 +#define IDS_HELP 104 +#define IDD_ABOUTBOX 105 +#define IDD_ABOUTBOX_WIDE 106 +#define IDC_STATIC_1 201 +#define IDC_STATIC_2 202 +#define IDC_STATIC_3 203 +#define IDM_OK 40000 +#define IDM_HELP 40001 +#define IDM_HELP_ABOUT 40002 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff -Nur cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.cpp --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.cpp 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// SimplePPC2003.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/stdafx.h cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.h --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.h 2009-04-14 10:46:41.875000000 +0200 @@ -0,0 +1,62 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#pragma comment(linker, "/nodefaultlib:libc.lib") +#pragma comment(linker, "/nodefaultlib:libcd.lib") + +// NOTE - this value is not strongly correlated to the Windows CE OS version being targeted +#define WINVER _WIN32_WCE + +#include <ceconfig.h> +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#define SHELL_AYGSHELL +#endif + +#ifdef _CE_DCOM +#define _ATL_APARTMENT_THREADED +#endif + +#include <windows.h> +#include <commctrl.h> + +#include <aygshell.h> +#pragma comment(lib, "aygshell.lib") + + +// Windows Header Files: +#include <windows.h> + +// C RunTime Header Files +#include <stdlib.h> +#include <malloc.h> +#include <memory.h> +#include <tchar.h> + +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#ifndef _DEVICE_RESOLUTION_AWARE +#define _DEVICE_RESOLUTION_AWARE +#endif +#endif + +#ifdef _DEVICE_RESOLUTION_AWARE +#include "DeviceResolutionAware.h" +#endif + +#if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) ) + #pragma comment(lib, "ccrtrtti.lib") + #ifdef _X86_ + #if defined(_DEBUG) + #pragma comment(lib, "libcmtx86d.lib") + #else + #pragma comment(lib, "libcmtx86.lib") + #endif + #endif +#endif + +#include <altcecrt.h> + +// TODO: reference additional headers your program requires here WinCESupportGeneratorSelection.patch [^] (103,457 bytes) 2009-04-16 11:52 [Show Content] [Hide Content] diff -Nur cmake-2.6.3/Modules/CMakeTestCLMachineType.c cmake-2.6.3-p1/Modules/CMakeTestCLMachineType.c --- cmake-2.6.3/Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeTestCLMachineType.c 2009-04-14 10:46:17.125000000 +0200 @@ -0,0 +1 @@ +int dummy() { return 0;} diff -Nur cmake-2.6.3/Modules/CMakeVS8FindMake.cmake cmake-2.6.3-p1/Modules/CMakeVS8FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS8FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeVS8FindMake.cmake 2009-04-14 17:26:13.046875000 +0200 @@ -1,5 +1,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path] diff -Nur cmake-2.6.3/Modules/CMakeVS9FindMake.cmake cmake-2.6.3-p1/Modules/CMakeVS9FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS9FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeVS9FindMake.cmake 2009-04-14 17:26:01.328125000 +0200 @@ -1,5 +1,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path] diff -Nur cmake-2.6.3/Modules/Platform/WinCE-cl.cmake cmake-2.6.3-p1/Modules/Platform/WinCE-cl.cmake --- cmake-2.6.3/Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/WinCE-cl.cmake 2009-04-15 18:24:35.750000000 +0200 @@ -0,0 +1,39 @@ + +SET(WIN32 1) +SET(WINCE 1) + + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") +ENDIF(MSVC_VERSION GREATER 1310) + + +## Here we append important +IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET (CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} /D$(ARCHFAM) /D$(_ARCHFAM_) /D$(INSTRUCTIONSET)") + SET (CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} /D$(ARCHFAM) /D$(_ARCHFAM_) /D$(INSTRUCTIONSET)") +ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ws2.lib mmtimer.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce,${CMAKE_SYSTEM_VERSION}) +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce) + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff -Nur cmake-2.6.3/Modules/Platform/WinCE.cmake cmake-2.6.3-p1/Modules/Platform/WinCE.cmake --- cmake-2.6.3/Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/WinCE.cmake 2009-04-15 18:22:40.390625000 +0200 @@ -0,0 +1,28 @@ + +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "$(CEVER)") + ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + + diff -Nur cmake-2.6.3/Modules/Platform/Windows-cl.cmake cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake 2009-04-15 18:04:33.718750000 +0200 @@ -41,7 +41,8 @@ # that is automatically copied into try_compile directories # by the global generator. SET(MSVC_IDE 1) -IF(CMAKE_GENERATOR MATCHES "Makefiles") + +## IF(CMAKE_GENERATOR MATCHES "Makefiles") SET(MSVC_IDE 0) IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) SET(CMAKE_VC_COMPILER_TESTS 1) @@ -137,35 +138,86 @@ MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) - MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN - ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) + + # Testing the machine type of the generated binaries: + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/VC/bin" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "/Program Files/Microsoft Visual Studio 9/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + + ## TODO add further dumpbin machine to visual studio machine type conversion here, + ## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "CL platform seems to be:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") +## ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) ENDIF(CMAKE_FORCE_WIN64) @@ -228,14 +280,35 @@ # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + +SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + +# machine type +## IF(CMAKE_GENERATOR MATCHES "Makefiles") +## Setting machine makes only sense when linking cross compiled binaries with makefiles? + IF(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") + ELSE(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") + ENDIF(CMAKE_CL_MACHINE_TYPE) + + # append /ARMPADCODE + IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE ") + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + +## ELSE(CMAKE_GENERATOR MATCHES "Makefiles") + + IF(CMAKE_FORCE_WIN64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:x64") + ENDIF(CMAKE_FORCE_WIN64) + +## ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it diff -Nur cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake.in --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake.in 2009-04-14 10:46:17.140625000 +0200 @@ -3,6 +3,7 @@ SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) SET(CMAKE_CL_64 @CMAKE_CL_64@) +SET(CMAKE_CL_MACHINE_TYPE @CMAKE_CL_MACHINE_TYPE@) SET(MSVC60 @MSVC60@) SET(MSVC70 @MSVC70@) SET(MSVC71 @MSVC71@) diff -Nur cmake-2.6.3/Source/CMakeLists.txt cmake-2.6.3-p1/Source/CMakeLists.txt --- cmake-2.6.3/Source/CMakeLists.txt 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/CMakeLists.txt 2009-04-16 11:29:45.531250000 +0200 @@ -250,6 +250,8 @@ IF(NOT UNIX) SET(SRCS ${SRCS} + cmSDKConfigParser.cxx + cmSDKConfigParser.h cmGlobalBorlandMakefileGenerator.cxx cmGlobalBorlandMakefileGenerator.h cmGlobalMSYSMakefileGenerator.cxx @@ -264,8 +266,12 @@ cmGlobalVisualStudio7Generator.h cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio8Generator.h + cmGlobalVisualStudio8_SDKGenerator.cxx + cmGlobalVisualStudio8_SDKGenerator.h cmGlobalVisualStudio9Generator.cxx cmGlobalVisualStudio9Generator.h + cmGlobalVisualStudio9_SDKGenerator.cxx + cmGlobalVisualStudio9_SDKGenerator.h cmGlobalVisualStudio8Win64Generator.cxx cmGlobalVisualStudio8Win64Generator.h cmGlobalVisualStudio9Win64Generator.cxx diff -Nur cmake-2.6.3/Source/cmGeneratorFactory.h cmake-2.6.3-p1/Source/cmGeneratorFactory.h --- cmake-2.6.3/Source/cmGeneratorFactory.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGeneratorFactory.h 2009-04-16 13:00:30.281250000 +0200 @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGeneratorFactory_h +#define cmGeneratorFactory_h + + +class cmGlobalGenerator; + +/*! + * \brief Factory interface for global generators + * + * \note if we had a functor type like boost.function + binders we could + * avoid that. + */ +class cmGeneratorFactory +{ +public: + virtual cmGlobalGenerator* Create() = 0; + virtual ~cmGeneratorFactory() {}; + +}; + +/*! + * \brief Default Factory for Global Generators, requires only + * a simple factory function. + */ +class cmFunctionGeneratorFactory : public cmGeneratorFactory +{ +public: + typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); + + cmFunctionGeneratorFactory( CreateGeneratorFunctionType Fun ) + : fun(Fun) + { + } + + virtual cmGlobalGenerator* Create() + { + return fun(); + } +private: + CreateGeneratorFunctionType fun; +}; + + +#endif + diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio71Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio71Generator.cxx 2009-04-14 10:46:41.828125000 +0200 @@ -34,6 +34,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion71(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.cxx 2009-04-16 15:41:59.500000000 +0200 @@ -139,6 +139,7 @@ { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -663,7 +664,12 @@ std::vector<std::string> *cmGlobalVisualStudio7Generator::GetConfigurations() { return &this->Configurations; -}; +} + +PlatformDefs const& cmGlobalVisualStudio7Generator::GetPlatformDef() const +{ + return m_platform; +} //---------------------------------------------------------------------------- void cmGlobalVisualStudio7Generator diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.h 2009-04-16 15:41:56.406250000 +0200 @@ -18,6 +18,7 @@ #define cmGlobalVisualStudio7Generator_h #include "cmGlobalVisualStudioGenerator.h" +#include "cmSDKConfigParser.h" class cmTarget; struct cmVS7FlagTable; @@ -81,6 +82,12 @@ */ std::vector<std::string> *GetConfigurations(); + /** + * Get the platform definition + */ + virtual PlatformDefs const& GetPlatformDef() const; + + ///! Create a GUID or get an existing one. void CreateGUID(const char* name); std::string GetGUID(const char* name); @@ -160,6 +167,8 @@ // Set during OutputSLNFile with the name of the current project. // There is one SLN file per project. std::string CurrentProject; + + PlatformDefs m_platform; // Platform definition, empty when not used with an SDK }; #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK" diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.cxx 2009-04-14 10:46:41.625000000 +0200 @@ -36,6 +36,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -341,6 +342,10 @@ cmVS7FlagTable::UserValueRequired}, // There is no YX option in the VS8 IDE. + // WHY WAS THIS REMOVED FROM VS7 to VS8? + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + // Exception handling mode. If no entries match, it will be FALSE. {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.h 2009-04-14 10:46:41.843750000 +0200 @@ -67,7 +67,7 @@ virtual bool VSLinksDependencies() const { return false; } - static cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); virtual void AddPlatformDefinitions(cmMakefile* mf); virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-04-14 10:46:41.843750000 +0200 @@ -34,6 +34,7 @@ lg->SetVersion8(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 2009-04-16 15:43:36.296875000 +0200 @@ -0,0 +1,239 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" +#include "cmGeneratedFileStream.h" + + +cmGlobalVisualStudio8_SDKGenerator::cmGlobalVisualStudio8_SDKGenerator(PlatformDefs const& platform) +: m_platformName("Mobile Platform"), m_actualGeneratorName("Visual Studio 8.0 " + platform.PlatformName) +{ + m_platform = platform; + FindMakeProgramFile = "CMakeVS8FindMake.cmake"; + ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio8_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(m_platformName.c_str()); + lg->SetVersion8(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio .NET 2005 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC80", "1"); + +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::Configure() +{ + this->cmGlobalVisualStudio7Generator::Configure(); + this->CreateGUID(CMAKE_CHECK_BUILD_SYSTEM_TARGET); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteSLNFile( + std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators) +{ + // Make all targets depend on their respective project's build + // system check target. + unsigned int i; + for(i = 0; i < generators.size(); ++i) + { + if(this->IsExcluded(root, generators[i])) + { + continue; + } + cmMakefile* mf = generators[i]->GetMakefile(); + cmTargets& tgts = mf->GetTargets(); + for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + { + if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + for(unsigned int j = 0; j < generators.size(); ++j) + { + // Every target in all generators should depend on this target. + cmMakefile* lmf = generators[j]->GetMakefile(); + cmTargets &atgts = lmf->GetTargets(); + for(cmTargets::iterator al = atgts.begin(); al != atgts.end(); ++al) + { + al->second.AddUtility(l->first.c_str()); + } + } + } + } + } + + // Now write the solution file. + this->cmGlobalVisualStudio71Generator::WriteSLNFile(fout, root, generators); +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8_SDKGenerator +::WriteSolutionConfigurations(std::ostream& fout) +{ + fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"; + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t" << *i << "|" << m_platform.PlatformName << " = " << *i << "|" + << m_platform.PlatformName << "\n"; + } + fout << "\tEndGlobalSection\n"; +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8_SDKGenerator +::WriteProjectConfigurations(std::ostream& fout, const char* name, + bool partOfDefaultBuild) +{ + std::string guid = this->GetGUID(name); + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".ActiveCfg = " + << *i << "|" << m_platform.PlatformName << "\n"; + if(partOfDefaultBuild) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".Build.0 = " + << *i << "|" << m_platform.PlatformName << "\n"; + } + } +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraFlagTable[] = +{ + {"CallingConvention", "Gd", "cdecl", "0", 0 }, + {"CallingConvention", "Gr", "fastcall", "1", 0 }, + {"CallingConvention", "Gz", "stdcall", "2", 0 }, + + {"StringPooling", "GF", "Enable Stringpooling", "true", 0 }, + + {"Detect64BitPortabilityProblems", "Wp64", + "Detect 64Bit Portability Problems", "true", 0 }, + {"ErrorReporting", "errorReport:prompt", "Report immediately", "1", 0 }, + {"ErrorReporting", "errorReport:queue", "Queue for next login", "2", 0 }, + // Precompiled header and related options. Note that the + // UsePrecompiledHeader entries are marked as "Continue" so that the + // corresponding PrecompiledHeaderThrough entry can be found. + {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "2", + cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, + {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "", + cmVS7FlagTable::UserValueRequired}, + // There is no YX option in the VS8 IDE. + + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + + // Exception handling mode. If no entries match, it will be FALSE. + {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, + + // Compile for special architecture + {"CompileForArchitecture", "QRarch4", "ARM4 without Thumb instructions", "0", 0}, + {"CompileForArchitecture", "QRarch5", "ARM5 without Thumb instructions", "1", 0}, + {"CompileForArchitecture", "QRarch4t", "ARM4 with Thumb instructions", "2", 0}, + {"CompileForArchitecture", "QRarch5t", "ARM5 with Thumb instructions", "3", 0}, + + {0,0,0,0,0} +}; +cmVS7FlagTable const* cmGlobalVisualStudio8_SDKGenerator::GetExtraFlagTableVS8() +{ + return cmVS8SDKExtraFlagTable; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraLinkFlagTable[] = +{ + + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:POSIX", "Posix application output", "8", 0}, // THIS IS ONLY AVAILABLE ON VC 8 + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "9", 0}, + + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio8_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS8SDKExtraLinkFlagTable; +} \ No newline at end of file diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.h 2009-04-16 15:42:09.046875000 +0200 @@ -0,0 +1,82 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio8_SDKGenerator_h +#define cmGlobalVisualStudio8_SDKGenerator_h + +#include "cmGlobalVisualStudio8Generator.h" +#include "cmGeneratorFactory.h" + +template<typename Generator> +class cmSDKGeneratorFactory : public cmGeneratorFactory +{ +public: + cmSDKGeneratorFactory(PlatformDefs const& platform) + : m_platform(platform) + {} + + cmGlobalGenerator * Create() + { + return new Generator(m_platform); + } +private: + PlatformDefs m_platform; +}; + +/** \class cmGlobalVisualStudio8_SDKGenerator + * \brief Creates Visual Studio 8 project files based on a platform + * SDK description + * + */ +class cmGlobalVisualStudio8_SDKGenerator : public cmGlobalVisualStudio8Generator +{ +public: + cmGlobalVisualStudio8_SDKGenerator(PlatformDefs const& platform); + + ///! Get the name for the generator. + virtual const char* GetName() const { + return m_actualGeneratorName.c_str();} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! Create a local generator appropriate to this Global Generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Override Configure and Generate to add the build-system check + * target. + */ + virtual void Configure(); + +protected: + + virtual bool VSLinksDependencies() const { return false; } + + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); + virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators); + virtual void WriteSolutionConfigurations(std::ostream& fout); + virtual void WriteProjectConfigurations(std::ostream& fout, + const char* name, + bool partOfDefaultBuild); + virtual void AddPlatformDefinitions(cmMakefile* mf); + + std::string m_platformName; + std::string m_actualGeneratorName; +}; +#endif diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Generator.cxx 2009-04-14 10:46:41.578125000 +0200 @@ -46,6 +46,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-04-14 10:46:41.546875000 +0200 @@ -31,6 +31,7 @@ lg->SetVersion9(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 2009-04-16 14:44:37.265625000 +0200 @@ -0,0 +1,162 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.6 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio9_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio9_SDKGenerator::cmGlobalVisualStudio9_SDKGenerator(PlatformDefs const& platform) +: cmGlobalVisualStudio8_SDKGenerator(platform) +{ + this->FindMakeProgramFile = "CMakeVS9FindMake.cmake"; + this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->PlatformName = "Mobile Platform"; + m_actualGeneratorName = "Visual Studio 9.0 " + m_platform.PlatformName; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC90", "1"); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n"; + fout << "# Visual Studio 2008\n"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio9_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetVersion9(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio 9 2008 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::EnableLanguage(std::vector<std::string>const & lang, + cmMakefile *mf, bool optional) +{ + cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosDirectory() +{ + std::string base; + std::string path; + + // base begins with the VisualStudioProjectsLocation reg value... + if (cmSystemTools::ReadRegistryValue( + "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;" + "VisualStudioProjectsLocation", + base)) + { + cmSystemTools::ConvertToUnixSlashes(base); + + // 9.0 macros folder: + path = base + "/VSMacros80"; + // *NOT* a typo; right now in Visual Studio 2008 beta the macros + // folder is VSMacros80... They may change it to 90 before final + // release of 2008 or they may not... we'll have to keep our eyes + // on it + } + + // path is (correctly) still empty if we did not read the base value from + // the Registry value + return path; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosRegKeyBase() +{ + return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros"; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS9SDKExtraLinkFlagTable[] = +{ + + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "8", 0}, + + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio9_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS9SDKExtraLinkFlagTable; +} \ No newline at end of file diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.h 2009-04-16 14:42:54.656250000 +0200 @@ -0,0 +1,67 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.4 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio9_SDKGenerator_h +#define cmGlobalVisualStudio9_SDKGenerator_h + +#include "cmGlobalVisualStudio8_SDKGenerator.h" + + +/** \class cmGlobalVisualStudio9_WindowsMobile_Generator + * \brief Write a Unix makefiles. + * + * cmGlobalVisualStudio9_WindowsMobile_Generator manages UNIX build process for a tree + */ +class cmGlobalVisualStudio9_SDKGenerator : + public cmGlobalVisualStudio8_SDKGenerator +{ +public: + cmGlobalVisualStudio9_SDKGenerator(PlatformDefs const& platformDefs ); + + virtual void AddPlatformDefinitions(cmMakefile* mf); + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! create the correct local generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Try to determine system infomation such as shared library + * extension, pthreads, byte order etc. + */ + virtual void EnableLanguage(std::vector<std::string>const& languages, + cmMakefile *, bool optional); + + virtual void WriteSLNHeader(std::ostream& fout); + + /** + * Where does this version of Visual Studio look for macros for the + * current user? Returns the empty string if this version of Visual + * Studio does not implement support for VB macros. + */ + virtual std::string GetUserMacrosDirectory(); + + /** + * What is the reg key path to "vsmacros" for this version of Visual + * Studio? + */ + virtual std::string GetUserMacrosRegKeyBase(); + +protected: + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); +}; +#endif diff -Nur cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.cxx 2009-04-16 17:27:49.843750000 +0200 @@ -536,9 +536,10 @@ bool& flag_handled); }; -void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, +void cmLocalVisualStudio7Generator::WritePlatformConfiguration(std::ostream& fout, const char* configName, const char *libName, + const char *platformName, cmTarget &target) { const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); @@ -546,9 +547,21 @@ { mfcFlag = "0"; } + + const char* wholeprogoptFlag; + if(strcmp(configName,"Release")==0) + wholeprogoptFlag = this->Makefile->GetDefinition("CMAKE_WHOLEPROGOPT_FLAG_RELEASE"); + else + wholeprogoptFlag = this->Makefile->GetDefinition("CMAKE_WHOLEPROGOPT_FLAG_DEBUG"); + if(!wholeprogoptFlag) + { + wholeprogoptFlag = "0"; + } + fout << "\t\t<Configuration\n" - << "\t\t\tName=\"" << configName << "|" << this->PlatformName << "\"\n" + << "\t\t\tName=\"" << configName << "|" << platformName << "\"\n" << "\t\t\tOutputDirectory=\"" << configName << "\"\n"; + // This is an internal type to Visual Studio, it seems that: // 4 == static library // 2 == dll @@ -667,6 +680,7 @@ << "\"\n" << "\t\t\tConfigurationType=\"" << configType << "\"\n" << "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n" + << "\t\t\tWholeProgramOptimization=\"" << wholeprogoptFlag << "\"\n" << "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n"; // If unicode is enabled change the character set to unicode, if not @@ -815,10 +829,26 @@ } this->OutputTargetRules(fout, configName, target, libName); - this->OutputBuildTool(fout, configName, target, targetOptions.IsDebug()); + this->OutputBuildTool(fout, configName, platformName, target, targetOptions.IsDebug()); fout << "\t\t</Configuration>\n"; } +void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + cmTarget &target) +{ + if((this->PlatformName).compare("Mobile Platform") == 0) + { + cmGlobalVisualStudio7Generator *gg = static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); + WritePlatformConfiguration(fout,configName,libName,gg->GetPlatformDef().PlatformName.c_str(),target); + } + else + { + WritePlatformConfiguration(fout,configName,libName,(this->PlatformName).c_str(),target); + } +} + //---------------------------------------------------------------------------- std::string cmLocalVisualStudio7Generator @@ -837,6 +867,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, const char* configName, + const char* platformName, cmTarget &target, bool isDebug) { @@ -879,7 +910,7 @@ extraLinkOptions += " "; extraLinkOptions += targetLinkFlags; } - Options linkOptions(this, this->Version, Options::Linker); + Options linkOptions(this, this->Version, Options::Linker, this->ExtraLinkFlagTable); // MODIFIED BY CLEMENS linkOptions.Parse(extraLinkOptions.c_str()); switch(target.GetType()) { @@ -937,15 +968,33 @@ fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " - << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; temp = target.GetDirectory(configName); temp += "/"; + } + else + { + temp = target.GetDirectory(); + temp += "/" + std::string(platformName) + "/" + std::string(configName) + "/"; + + fout << "\t\t\t\tAdditionalDependencies=\" "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + + // dlls in Windows CE also need /SUBSYSTEM:WINDOWSCE set + fout << "\t\t\t\tSubSystem=\"9\"\n"; + } temp += targetNameFull; fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; @@ -955,6 +1004,7 @@ this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; this->OutputModuleDefinitionFile(fout, target); + temp = target.GetDirectory(configName); temp += "/"; temp += targetNamePDB; @@ -972,6 +1022,7 @@ { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n"; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1009,6 +1060,8 @@ } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. @@ -1017,6 +1070,22 @@ << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; + } else + { + linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + // Use the NOINHERIT macro to avoid getting VS project default + // libraries which may be set by the user to something bad. + fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) + << " "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + //fout << "\t\t\t\tSubSystem=\"0" << "\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + } temp = target.GetDirectory(configName); temp += "/"; temp += targetNameFull; @@ -1027,20 +1096,33 @@ fout << "\t\t\t\tAdditionalLibraryDirectories=\""; this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; - fout << "\t\t\t\tProgramDataBaseFile=\"" - << target.GetDirectory(configName) << "/" << targetNamePDB + fout << "\t\t\t\tProgramDataBaseFile=\"" + << target.GetDirectory(configName) << "/" << targetNamePDB << "\"\n"; + if(isDebug) { fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; } - if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) { - fout << "\t\t\t\tSubSystem=\"2\"\n"; - } + if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + fout << "\t\t\t\tSubSystem=\"2\"\n"; + } + else + { + fout << "\t\t\t\tSubSystem=\"1\"\n"; + } + } else { - fout << "\t\t\t\tSubSystem=\"1\"\n"; + // assumge WinCE/Windows Mobile + fout << "\t\t\t\tSubSystem=\"9\"\n"; + if ( ! target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + fout << "\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n"; + } } std::string stackVar = "CMAKE_"; stackVar += linkLanguage; @@ -1050,6 +1132,7 @@ { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\""; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1379,6 +1462,9 @@ dir_max += config_max; dir_max += "/"; + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + // Loop through each source in the source group. std::string objectName; for(std::vector<const cmSourceFile *>::const_iterator sf = @@ -1432,6 +1518,50 @@ fci = fcinfo.FileConfigMap.begin(); fci != fcinfo.FileConfigMap.end(); ++fci) { + if((this->PlatformName).compare("Mobile Platform") == 0) + { + PlatformDefs const& pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fci->second; + fout << "\t\t\t\t<FileConfiguration\n" + << "\t\t\t\t\tName=\"" << fci->first + << "|" << pldef.PlatformName << "\""; + if(fc.ExcludedFromBuild) + { + fout << " ExcludedFromBuild=\"true\""; + } + fout << ">\n"; + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n"; + if(!fc.CompileFlags.empty() || + !fc.CompileDefs.empty() || + !fc.CompileDefsConfig.empty()) + { + Options fileOptions(this, this->Version, Options::Compiler, + this->ExtraFlagTable); + fileOptions.Parse(fc.CompileFlags.c_str()); + fileOptions.AddDefines(fc.CompileDefs.c_str()); + fileOptions.AddDefines(fc.CompileDefsConfig.c_str()); + fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n"); + fileOptions.OutputFlagMap(fout, "\t\t\t\t\t"); + fileOptions.OutputPreprocessorDefinitions(fout, + "\t\t\t\t\t", "\n"); + } + if(!fc.AdditionalDeps.empty()) + { + fout << "\t\t\t\t\tAdditionalDependencies=\"" + << fc.AdditionalDeps.c_str() << "\"\n"; + } + if(!fc.ObjectName.empty()) + { + fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" + << fc.ObjectName.c_str() << "\"\n"; + } + fout << "\t\t\t\t\t/>\n" + << "\t\t\t\t</FileConfiguration>\n"; + + } + else + { cmLVS7GFileConfig const& fc = fci->second; fout << "\t\t\t\t<FileConfiguration\n" << "\t\t\t\t\tName=\"" << fci->first @@ -1471,6 +1601,7 @@ << "\t\t\t\t</FileConfiguration>\n"; } } + } fout << "\t\t\t</File>\n"; } } @@ -1499,9 +1630,9 @@ // Write the rule for each configuration. std::vector<std::string>::iterator i; - std::vector<std::string> *configs = - static_cast<cmGlobalVisualStudio7Generator *> - (this->GlobalGenerator)->GetConfigurations(); + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + std::vector<std::string> *configs = gg->GetConfigurations(); const char* compileTool = "VCCLCompilerTool"; if(this->FortranProject) { @@ -1514,6 +1645,82 @@ } for(i = configs->begin(); i != configs->end(); ++i) { + if((this->PlatformName).compare("Mobile Platform") == 0) + { + PlatformDefs const &pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; + fout << "\t\t\t\t<FileConfiguration\n"; + fout << "\t\t\t\t\tName=\"" << *i << "|" << pldef.PlatformName << "\">\n"; + if(!fc.CompileFlags.empty()) + { + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << compileTool << "\"\n" + << "\t\t\t\t\tAdditionalOptions=\"" + << this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n"; + } + + std::string script = + this->ConstructScript(command.GetCommandLines(), + command.GetWorkingDirectory(), + i->c_str(), + command.GetEscapeOldStyle(), + command.GetEscapeAllowMakeVars()); + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << customTool << "\"\n" + << "\t\t\t\t\tDescription=\"" + << this->EscapeForXML(comment.c_str()) << "\"\n" + << "\t\t\t\t\tCommandLine=\"" + << this->EscapeForXML(script.c_str()) << "\"\n" + << "\t\t\t\t\tAdditionalDependencies=\""; + if(command.GetDepends().empty()) + { + // There are no real dependencies. Produce an artificial one to + // make sure the rule runs reliably. + if(!cmSystemTools::FileExists(source)) + { + std::ofstream depout(source); + depout << "Artificial dependency for a custom command.\n"; + } + fout << this->ConvertToXMLOutputPath(source); + } + else + { + // Write out the dependencies for the rule. + for(std::vector<std::string>::const_iterator d = + command.GetDepends().begin(); + d != command.GetDepends().end(); + ++d) + { + // Get the real name of the dependency in case it is a CMake target. + std::string dep = this->GetRealDependency(d->c_str(), i->c_str()); + fout << this->ConvertToXMLOutputPath(dep.c_str()) + << ";"; + } + } + fout << "\"\n"; + fout << "\t\t\t\t\tOutputs=\""; + if(command.GetOutputs().empty()) + { + fout << source << "_force"; + } + else + { + // Write a rule for the output generated by this command. + const char* sep = ""; + for(std::vector<std::string>::const_iterator o = + command.GetOutputs().begin(); + o != command.GetOutputs().end(); + ++o) + { + fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str()); + sep = ";"; + } + } + fout << "\"/>\n"; + fout << "\t\t\t\t</FileConfiguration>\n"; + } + else + { cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; fout << "\t\t\t\t<FileConfiguration\n"; fout << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n"; @@ -1586,6 +1793,7 @@ fout << "\t\t\t\t</FileConfiguration>\n"; } } +} void cmLocalVisualStudio7Generator::WriteVCProjBeginGroup(std::ostream& fout, @@ -1789,13 +1997,17 @@ } if(projectType) { - fout << "\tProjectType=\"" << projectType << "\"\n"; + fout << "\tProjectType=\"" << projectType << "\">\n"; } fout<< "\tKeyword=\"" << keyword << "\">\n" << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if((this->PlatformName).compare("Mobile Platform") == 0) + fout << "\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } @@ -1850,9 +2062,13 @@ << "\tSccProvider=\"" << vsProvider << "\"\n"; } fout << "\tKeyword=\"" << keyword << "\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if((this->PlatformName).compare("Mobile Platform") == 0) + fout << "\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } diff -Nur cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.h 2009-04-14 10:46:41.859375000 +0200 @@ -68,6 +68,8 @@ void SetExtraFlagTable(cmVS7FlagTable const* table) { this->ExtraFlagTable = table; } + void SetExtraLinkFlagTable(cmVS7FlagTable const* table) + { this->ExtraLinkFlagTable = table; } private: typedef cmLocalVisualStudio7GeneratorOptions Options; typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; @@ -85,6 +87,11 @@ void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); cmSourceFile* CreateVCProjBuildRule(); + void WritePlatformConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + const char *platformName, + cmTarget &target); void WriteConfigurations(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfiguration(std::ostream& fout, @@ -96,7 +103,7 @@ void OutputTargetRules(std::ostream& fout, const char* configName, cmTarget &target, const char *libName); void OutputBuildTool(std::ostream& fout, const char* configName, - cmTarget& t, bool debug); + const char* platformName, cmTarget& t, bool debug); void OutputLibraryDirectories(std::ostream& fout, std::vector<std::string> const& dirs); void OutputModuleDefinitionFile(std::ostream& fout, cmTarget &target); @@ -124,6 +131,7 @@ friend class cmLocalVisualStudio7GeneratorInternals; cmVS7FlagTable const* ExtraFlagTable; + cmVS7FlagTable const* ExtraLinkFlagTable; std::string ModuleDefinitionFile; int Version; bool FortranProject; diff -Nur cmake-2.6.3/Source/cmMakefile.cxx cmake-2.6.3-p1/Source/cmMakefile.cxx --- cmake-2.6.3/Source/cmMakefile.cxx 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmMakefile.cxx 2009-04-16 13:09:00.218750000 +0200 @@ -21,6 +21,10 @@ #include "cmSourceFileLocation.h" #include "cmSystemTools.h" #include "cmGlobalGenerator.h" +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW) +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" +#endif #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" @@ -2740,8 +2744,9 @@ std::string cmakeCommand = this->GetDefinition("CMAKE_COMMAND"); cmake cm; cm.SetIsInTryCompile(true); - cmGlobalGenerator *gg = cm.CreateGlobalGenerator - (this->LocalGenerator->GetGlobalGenerator()->GetName()); + cmGlobalGenerator *parentgg = this->LocalGenerator->GetGlobalGenerator(); + std::string parentggname(parentgg->GetName()); + cmGlobalGenerator *gg = cm.CreateGlobalGenerator(parentggname.c_str()); if (!gg) { cmSystemTools::Error( @@ -2750,6 +2755,22 @@ cmSystemTools::ChangeDirectory(cwd.c_str()); return 1; } + // check to update platforms list if it is an SDK based builder +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW) + if(parentggname.compare(cmGlobalVisualStudio8_SDKGenerator::GetActualName()) == 0) + { // gg should inherit platform vector from parent + cmGlobalVisualStudio8_SDKGenerator* srcgg = static_cast<cmGlobalVisualStudio8_SDKGenerator*>(parentgg); + cmGlobalVisualStudio8_SDKGenerator* targg = static_cast<cmGlobalVisualStudio8_SDKGenerator*>(gg); +// targg->filterSDKs(srcgg->GetPlatforms()); + } + else if(parentggname.compare(cmGlobalVisualStudio9_SDKGenerator::GetActualName()) == 0) + { // gg should inherit platform vector from parent + cmGlobalVisualStudio9_SDKGenerator* srcgg = static_cast<cmGlobalVisualStudio9_SDKGenerator*>(parentgg); + cmGlobalVisualStudio9_SDKGenerator* targg = static_cast<cmGlobalVisualStudio9_SDKGenerator*>(gg); +// targg->filterSDKs(srcgg->GetPlatforms()); + } +#endif + cm.SetGlobalGenerator(gg); // do a configure diff -Nur cmake-2.6.3/Source/cmSDKConfigParser.cxx cmake-2.6.3-p1/Source/cmSDKConfigParser.cxx --- cmake-2.6.3/Source/cmSDKConfigParser.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmSDKConfigParser.cxx 2009-04-16 14:33:54.000000000 +0200 @@ -0,0 +1,157 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" +#include "cmGeneratedFileStream.h" + +cmSDKConfigParser::cmSDKConfigParser() +: cmXMLParser() +{ + current_platform_valid = false; +} + +void cmSDKConfigParser::StartElement(const char* name, const char** atts) +{ + if ( strcmp(name, "Platform") == 0 ) + { + PlatformDefs nPlatform; + nPlatform.added = false; // Where is this needed? + platformVec.push_back(nPlatform); + } + if ( strcmp(name, "Directories") == 0 ) + { + const char* includes = this->FindAttribute(atts, "Include"); + if (includes) + { + platformVec.back().IncludePaths = std::string(includes); + } + const char* libs = this->FindAttribute(atts, "Library"); + if (libs) + { + platformVec.back().LibraryPaths = std::string(libs); + } + } + if ( strcmp(name, "Macro") == 0 ) + { + const char* rev = this->FindAttribute(atts, "Name"); + if (rev) + { + if ( strcmp(rev, "PLATFORMDEFINES") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().PlatformDefines = std::string(rev); + } + else if ( strcmp(rev, "CEVER") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().CEver = std::string(rev); + } + else if ( strcmp(rev, "ARCHFAM") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().Archfam = std::string(rev); + } + else if ( strcmp(rev, "_ARCHFAM_") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().Archfam_ = std::string(rev); + } + else if ( strcmp(rev, "INSTRUCTIONSET") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().InstructionSet= std::string(rev); + } + } + } + this->CharacterData.erase( + this->CharacterData.begin(), this->CharacterData.end()); +} + +void cmSDKConfigParser::EndElement(const char* name) +{ + if ( strcmp(name, "PlatformName") == 0 ) + { + platformVec.back().PlatformName = std::string(this->CharacterData.begin(),this->CharacterData.end()); + } + else if ( strcmp(name, "OSMinorVersion") == 0 && current_platform_valid) + { + platformVec.back().MinorVer = atoi(std::string(this->CharacterData.begin(),this->CharacterData.end()).c_str()); + } + else if ( strcmp(name, "OSMajorVersion") == 0 && current_platform_valid) + { + platformVec.back().MajorVer = atoi(std::string(this->CharacterData.begin(),this->CharacterData.end()).c_str()); + } + this->CharacterData.erase(this->CharacterData.begin(), + this->CharacterData.end()); +} + +void cmSDKConfigParser::CharacterDataHandler(const char* data, int length) +{ + this->CharacterData.insert(this->CharacterData.end(), data, data+length); +} + +const char* cmSDKConfigParser::FindAttribute( const char** atts, const char* attribute ) +{ + if ( !atts || !attribute ) + { + return 0; + } + const char **atr = atts; + while ( *atr && **atr && **(atr+1) ) + { + if ( strcmp(*atr, attribute) == 0 ) + { + return *(atr+1); + } + atr+=2; + } + return 0; +} + + +void cmSDKConfigParser::GetSDKsInstalled(std::string vsVersionString, std::vector<PlatformDefs> & platformSDKs ) +{ + platformSDKs.clear(); + + std::string regkey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\VisualStudio\\"); + regkey += vsVersionString; + regkey += std::string("\\Setup\\VS;"); + + std::string base; + + + if (!cmSystemTools::ReadRegistryValue((regkey+ + std::string("ProductDir")).c_str(), + base)) + { + return; + } + + cmSystemTools::ConvertToUnixSlashes(base); + + // NOW READ THE CONFIG FILE FOR THE SDKs + std::string configFilename = base + std::string("/VC/vcpackages/WCE.VCPlatform.config"); + cmSDKConfigParser parser; + if(parser.ParseFile(configFilename.c_str()) == 0) { + return; + } + swap(platformSDKs, parser.getPlatforms()); +} + diff -Nur cmake-2.6.3/Source/cmSDKConfigParser.h cmake-2.6.3-p1/Source/cmSDKConfigParser.h --- cmake-2.6.3/Source/cmSDKConfigParser.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmSDKConfigParser.h 2009-04-16 12:31:09.921875000 +0200 @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmSDKConfigParser_h +#define cmSDKConfigParser_h + +#include "cmXMLParser.h" + +typedef struct { + int MajorVer; + int MinorVer; + std::string PlatformDefines; + std::string CEver; + std::string Archfam; + std::string Archfam_; + std::string InstructionSet; + std::string PlatformName; + std::string LibraryPaths; + std::string IncludePaths; + bool added; +} PlatformDefs; + + +class cmSDKConfigParser : public cmXMLParser +{ +public: + cmSDKConfigParser(); + + std::vector<PlatformDefs> & getPlatforms() {return platformVec;}; + std::vector<PlatformDefs> const& getPlatforms() const {return platformVec;}; + + /*! + \brief Parses the SDKs installed for the given visual studio version. + \param VSversionString visual studio version, i.e. 8.0 or 9.0 + */ + static void GetSDKsInstalled(std::string VSversionString, std::vector<PlatformDefs> & platformSDKs ); +protected: + void StartElement(const char* name, const char** atts); + void EndElement(const char* name); + void CharacterDataHandler(const char* data, int length); + const char* FindAttribute( const char** atts, const char* attribute ); +private: + std::vector<char> CharacterData; + std::vector<PlatformDefs> platformVec; + bool current_platform_valid; +}; + +#endif diff -Nur cmake-2.6.3/Source/cmake.cxx cmake-2.6.3-p1/Source/cmake.cxx --- cmake-2.6.3/Source/cmake.cxx 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmake.cxx 2009-04-16 13:09:23.437500000 +0200 @@ -65,6 +65,8 @@ # include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio8Generator.h" # include "cmGlobalVisualStudio9Generator.h" +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" # include "cmGlobalVisualStudio9Win64Generator.h" # include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" @@ -1726,7 +1728,7 @@ } } - generator = (genIt->second)(); + generator = (genIt->second)->Create(); generator->SetCMakeInstance(this); generator->SetExternalMakefileProjectGenerator(extraGenerator); return generator; @@ -2405,33 +2407,52 @@ #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(CMAKE_BOOT_MINGW) this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] = - &cmGlobalVisualStudio6Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio6Generator::New); this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] = - &cmGlobalVisualStudio7Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio7Generator::New); this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = - &cmGlobalVisualStudio71Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio71Generator::New); this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = - &cmGlobalVisualStudio8Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Generator::New); this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = - &cmGlobalVisualStudio9Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Generator::New); + + std::vector<PlatformDefs> vs8Platforms; + cmSDKConfigParser::GetSDKsInstalled("8.0", vs8Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs8Platforms.begin(), + e = vs8Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 8.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio8_SDKGenerator>(*it); + } + + std::vector<PlatformDefs> vs9Platforms; + cmSDKConfigParser::GetSDKsInstalled("9.0", vs9Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs9Platforms.begin(), + e = vs9Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 9.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio9_SDKGenerator>(*it); + } + this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = - &cmGlobalVisualStudio9Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Win64Generator::New); this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = - &cmGlobalVisualStudio8Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Win64Generator::New); this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = - &cmGlobalBorlandMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalBorlandMakefileGenerator::New); this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = - &cmGlobalNMakeMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalNMakeMakefileGenerator::New); this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] = - &cmGlobalWatcomWMakeGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalWatcomWMakeGenerator::New); # endif this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = - &cmGlobalMSYSMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMSYSMakefileGenerator::New); this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] = - &cmGlobalMinGWMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMinGWMakefileGenerator::New); #endif this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] = - &cmGlobalUnixMakefileGenerator3::New; + new cmFunctionGeneratorFactory(&cmGlobalUnixMakefileGenerator3::New); #ifdef CMAKE_USE_XCODE this->Generators[cmGlobalXCodeGenerator::GetActualName()] = &cmGlobalXCodeGenerator::New; @@ -2530,7 +2551,7 @@ i != this->Generators.end(); ++i) { cmDocumentationEntry e; - cmGlobalGenerator* generator = (i->second)(); + cmGlobalGenerator* generator = (i->second)->Create(); generator->GetDocumentation(e); delete generator; v.push_back(e); diff -Nur cmake-2.6.3/Source/cmake.h cmake-2.6.3-p1/Source/cmake.h --- cmake-2.6.3/Source/cmake.h 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmake.h 2009-04-16 12:31:28.531250000 +0200 @@ -43,6 +43,7 @@ #include "cmSystemTools.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +#include "cmGeneratorFactory.h" class cmGlobalGenerator; class cmLocalGenerator; @@ -56,6 +57,9 @@ class cmPolicies; class cmListFileBacktrace; + + + class cmake { public: @@ -370,9 +374,8 @@ typedef std::map<cmStdString, CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap; - typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); typedef std::map<cmStdString, - CreateGeneratorFunctionType> RegisteredGeneratorsMap; + cmGeneratorFactory*> RegisteredGeneratorsMap; RegisteredCommandsMap Commands; RegisteredGeneratorsMap Generators; RegisteredExtraGeneratorsMap ExtraGenerators; diff -Nur cmake-2.6.3/Tests/CMakeLists.txt cmake-2.6.3-p1/Tests/CMakeLists.txt --- cmake-2.6.3/Tests/CMakeLists.txt 2009-02-21 21:36:55.000000000 +0100 +++ cmake-2.6.3-p1/Tests/CMakeLists.txt 2009-04-14 10:46:41.921875000 +0200 @@ -65,6 +65,19 @@ SET(CMAKE_LONG_TEST_TIMEOUT 1500) ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003/CMakeCache.txt.in" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003/CMakeCache.txt" COPYONLY + ) + ADD_TEST(SimplePPC2003 ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003" + --build-two-config + --build-generator "Visual Studio 9 2008 (with SDK support)" + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project SimplePPC2003) + # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) ADD_TEST_MACRO(FindPackageTest FindPackageTest) @@ -429,6 +442,7 @@ --test-command Tutorial 25.0) ENDFOREACH(STP) + ADD_TEST(testing ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Testing" diff -Nur cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeCache.txt.in --- cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeCache.txt.in 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,5 @@ +//SDK to use +CMAKE_GENERATOR:INTERNAL=Visual Studio 9 2008 (with SDK support) +CMAKE_SYSTEM_NAME:STRING=WINCE +CMAKE_SYSTEM_VERSION:STRING=4.20 +PLATFORM_SDKS:STRING=Pocket PC 2003 (ARMV4) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeLists.txt --- cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeLists.txt 2009-04-14 10:46:41.921875000 +0200 @@ -0,0 +1,14 @@ +# a simple test case for compiling a PPC 2003 project +PROJECT(SimplePPC2003) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(RESOURCEFILES resourceppc.h SimplePPC2003ppc.rc SimplePPC2003ppc.rc2) +SET(SOURCEFILES SimplePPC2003.cpp stdafx.cpp) +SET(HEADERFILES stdafx.h SimplePPC2003.h) + +ADD_DEFINITIONS(-DWINCE -D$(ARCHFAM) -D$(_ARCHFAM_) -D_UNICODE -DUNICODE -D_USRDLL ) + +ADD_EXECUTABLE(SimplePPC2003 ${RESOURCEFILES} ${SOURCEFILES} ${HEADERFILES}) + +SET_TARGET_PROPERTIES(SimplePPC2003 PROPERTIES LINK_FLAGS /machine:ARM) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake cmake-2.6.3-p1/Tests/SimplePPC2003/GetCompilerVersion.cmake --- cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/GetCompilerVersion.cmake 2009-04-14 10:46:41.859375000 +0200 @@ -0,0 +1,95 @@ + +FIND_PROGRAM(CMAKE_VCVARS + NAMES vcvarsall.bat + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC" + ) + +# Testing the machine type of the generated binaries: +FIND_PROGRAM(CMAKE_TEST_COMPILER + NAMES cl.exe + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + ) + +SET(testNmakeCLVersionFile + "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c") +STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}") + +EXEC_PROGRAM("\"${CMAKE_VCVARS}\" && \"${CMAKE_TEST_COMPILER}\" /nologo -EP \"${testNmakeCLVersionFile}\"" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT + RETURN_VALUE CMAKE_COMPILER_RETURN + ) + +IF(NOT CMAKE_COMPILER_RETURN) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining the version of compiler passed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}") + STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1" + compilerVersion "${compilerVersion}") + MESSAGE(STATUS "Check for CL compiler version - ${compilerVersion}") + SET(MSVC60) + SET(MSVC70) + SET(MSVC71) + SET(MSVC80) + SET(CMAKE_COMPILER_2005) + IF("${compilerVersion}" LESS 1300) + SET(MSVC60 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1) + ENDIF("${compilerVersion}" LESS 1300) + IF("${compilerVersion}" EQUAL 1300) + SET(MSVC70 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1300) + IF("${compilerVersion}" EQUAL 1310) + SET(MSVC71 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1310) + IF("${compilerVersion}" EQUAL 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" EQUAL 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" EQUAL 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" EQUAL 1500) + IF("${compilerVersion}" GREATER 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" GREATER 1500) + SET(MSVC_VERSION "${compilerVersion}") +ELSE(NOT CMAKE_COMPILER_RETURN) + MESSAGE(STATUS "Check for CL compiler version - failed") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining the version of compiler failed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") +ENDIF(NOT CMAKE_COMPILER_RETURN) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.cpp --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.cpp 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,259 @@ +// SimplePPC2003.cpp : Defines the entry point for the application. +// + +#include "stdafx.h" +#include "SimplePPC2003.h" + + +#define MAX_LOADSTRING 100 + +// Global Variables: +HINSTANCE g_hInst; // current instance +HWND g_hWndMenuBar; // menu bar handle + +// Forward declarations of functions included in this code module: +ATOM MyRegisterClass(HINSTANCE, LPTSTR); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); + +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + MSG msg; + + // Perform application initialization: + if (!InitInstance(hInstance, nCmdShow)) + { + return FALSE; + } + + HACCEL hAccelTable; + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SIMPLEPPC2003)); + + // Main message loop: + while (GetMessage(&msg, NULL, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + +// +// FUNCTION: MyRegisterClass() +// +// PURPOSE: Registers the window class. +// +// COMMENTS: +// +ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) +{ + WNDCLASS wc; + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SIMPLEPPC2003)); + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = 0; + wc.lpszClassName = szWindowClass; + + return RegisterClass(&wc); +} + +// +// FUNCTION: InitInstance(HINSTANCE, int) +// +// PURPOSE: Saves instance handle and creates main window +// +// COMMENTS: +// +// In this function, we save the instance handle in a global variable and +// create and display the main program window. +// +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + HWND hWnd; + TCHAR szTitle[MAX_LOADSTRING]; // title bar text + TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name + + g_hInst = hInstance; // Store instance handle in our global variable + + // SHInitExtraControls should be called once during your application's initialization to initialize any + // of the device specific controls such as CAPEDIT and SIPPREF. + SHInitExtraControls(); + + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDC_SIMPLEPPC2003, szWindowClass, MAX_LOADSTRING); + + //If it is already running, then focus on the window, and exit + hWnd = FindWindow(szWindowClass, szTitle); + if (hWnd) + { + // set focus to foremost child window + // The "| 0x00000001" is used to bring any owned windows to the foreground and + // activate them. + SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); + return 0; + } + + if (!MyRegisterClass(hInstance, szWindowClass)) + { + return FALSE; + } + + hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); + + if (!hWnd) + { + return FALSE; + } + + // When the main window is created using CW_USEDEFAULT the height of the menubar (if one + // is created is not taken into account). So we resize the window after creating it + // if a menubar is present + if (g_hWndMenuBar) + { + RECT rc; + RECT rcMenuBar; + + GetWindowRect(hWnd, &rc); + GetWindowRect(g_hWndMenuBar, &rcMenuBar); + rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top); + + MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE); + } + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + + return TRUE; +} + +// +// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) +// +// PURPOSE: Processes messages for the main window. +// +// WM_COMMAND - process the application menu +// WM_PAINT - Paint the main window +// WM_DESTROY - post a quit message and return +// +// +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + PAINTSTRUCT ps; + HDC hdc; + + static SHACTIVATEINFO s_sai; + + switch (message) + { + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + // Parse the menu selections: + switch (wmId) + { + case IDM_HELP_ABOUT: + DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, About); + break; + case IDM_OK: + SendMessage (hWnd, WM_CLOSE, 0, 0); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + case WM_CREATE: + SHMENUBARINFO mbi; + + memset(&mbi, 0, sizeof(SHMENUBARINFO)); + mbi.cbSize = sizeof(SHMENUBARINFO); + mbi.hwndParent = hWnd; + mbi.nToolBarId = IDR_MENU; + mbi.hInstRes = g_hInst; + + if (!SHCreateMenuBar(&mbi)) + { + g_hWndMenuBar = NULL; + } + else + { + g_hWndMenuBar = mbi.hwndMB; + } + + // Initialize the shell activate info structure + memset(&s_sai, 0, sizeof (s_sai)); + s_sai.cbSize = sizeof (s_sai); + break; + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + + // TODO: Add any drawing code here... + + EndPaint(hWnd, &ps); + break; + case WM_DESTROY: + CommandBar_Destroy(g_hWndMenuBar); + PostQuitMessage(0); + break; + + case WM_ACTIVATE: + // Notify shell of our activate message + SHHandleWMActivate(hWnd, wParam, lParam, &s_sai, FALSE); + break; + case WM_SETTINGCHANGE: + SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai); + break; + + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +// Message handler for about box. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + { + // Create a Done button and size it. + SHINITDLGINFO shidi; + shidi.dwMask = SHIDIM_FLAGS; + shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_EMPTYMENU; + shidi.hDlg = hDlg; + SHInitDialog(&shidi); + } + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + break; + + case WM_CLOSE: + EndDialog(hDlg, message); + return TRUE; + + } + return (INT_PTR)FALSE; +} diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.h --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.h 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,2 @@ +#pragma once +#include "resourceppc.h" diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,170 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resourceppc.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#include "resdefce.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +//IDI_SIMPLEPPC2003 ICON "SimplePPC2003.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU MENU DISCARDABLE +BEGIN + POPUP "Help" + BEGIN + MENUITEM "About", IDM_HELP_ABOUT + END +END + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_SIMPLEPPC2003 ACCELERATORS +BEGIN + "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT + "Q", IDM_OK, VIRTKEY, CONTROL, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG 0, 0, 156, 129 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,12,36,70,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,12,48,66,8 +END + +IDD_ABOUTBOX_WIDE DIALOG 0, 0, 210, 129 +STYLE WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,48,12,66,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,48,24,66,8 +END + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 149 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END + + IDD_ABOUTBOX_WIDE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END +END +#endif // APSTUDIO_INVOKED + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resourceppc.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#include ""resdefce.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""SimplePPC2003ppc.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// +STRINGTABLE +BEGIN + IDC_SIMPLEPPC2003 "SIMPLEPPC2003" + IDS_APP_TITLE "SimplePPC2003" + IDS_OK "OK" + IDS_HELP "HELP" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "SimplePPC2003ppc.rc2" // non-Microsoft Visual C++ edited resources +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,35 @@ +// +// SimplePPC2003PPC.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// +HI_RES_AWARE CEUX {1} // turn off the emulation layer + // Remove this resource to enable pixel- + // doubling on platforms that support it +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// +// SHMENUBAR +// + +IDR_MENU SHMENUBAR DISCARDABLE +BEGIN + IDR_MENU, + 2, + + I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, + IDS_OK, 0, NOMENU, + + I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, + IDS_HELP, 0, 0, +END + diff -Nur cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h cmake-2.6.3-p1/Tests/SimplePPC2003/resourceppc.h --- cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/resourceppc.h 2009-04-14 10:46:41.875000000 +0200 @@ -0,0 +1,34 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SimplePPC2003ppc.rc +// + +#define IDS_APP_TITLE 1 +#define IDC_SIMPLEPPC2003 2 +#define IDI_SIMPLEPPC2003 101 +#define IDR_MENU 102 +#define IDS_OK 103 +#define IDS_HELP 104 +#define IDD_ABOUTBOX 105 +#define IDD_ABOUTBOX_WIDE 106 +#define IDC_STATIC_1 201 +#define IDC_STATIC_2 202 +#define IDC_STATIC_3 203 +#define IDM_OK 40000 +#define IDM_HELP 40001 +#define IDM_HELP_ABOUT 40002 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff -Nur cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.cpp --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.cpp 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// SimplePPC2003.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/stdafx.h cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.h --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.h 2009-04-14 10:46:41.875000000 +0200 @@ -0,0 +1,62 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#pragma comment(linker, "/nodefaultlib:libc.lib") +#pragma comment(linker, "/nodefaultlib:libcd.lib") + +// NOTE - this value is not strongly correlated to the Windows CE OS version being targeted +#define WINVER _WIN32_WCE + +#include <ceconfig.h> +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#define SHELL_AYGSHELL +#endif + +#ifdef _CE_DCOM +#define _ATL_APARTMENT_THREADED +#endif + +#include <windows.h> +#include <commctrl.h> + +#include <aygshell.h> +#pragma comment(lib, "aygshell.lib") + + +// Windows Header Files: +#include <windows.h> + +// C RunTime Header Files +#include <stdlib.h> +#include <malloc.h> +#include <memory.h> +#include <tchar.h> + +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#ifndef _DEVICE_RESOLUTION_AWARE +#define _DEVICE_RESOLUTION_AWARE +#endif +#endif + +#ifdef _DEVICE_RESOLUTION_AWARE +#include "DeviceResolutionAware.h" +#endif + +#if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) ) + #pragma comment(lib, "ccrtrtti.lib") + #ifdef _X86_ + #if defined(_DEBUG) + #pragma comment(lib, "libcmtx86d.lib") + #else + #pragma comment(lib, "libcmtx86.lib") + #endif + #endif +#endif + +#include <altcecrt.h> + +// TODO: reference additional headers your program requires here WinCENoToolchainFile.patch [^] (106,733 bytes) 2009-04-17 09:45 [Show Content] [Hide Content] diff -Nur cmake-2.6.3/Modules/CMakeTestCLMachineType.c cmake-2.6.3-p1/Modules/CMakeTestCLMachineType.c --- cmake-2.6.3/Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeTestCLMachineType.c 2009-04-14 10:46:17.125000000 +0200 @@ -0,0 +1 @@ +int dummy() { return 0;} diff -Nur cmake-2.6.3/Modules/CMakeVS8FindMake.cmake cmake-2.6.3-p1/Modules/CMakeVS8FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS8FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeVS8FindMake.cmake 2009-04-14 17:26:13.046875000 +0200 @@ -1,5 +1,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path] diff -Nur cmake-2.6.3/Modules/CMakeVS9FindMake.cmake cmake-2.6.3-p1/Modules/CMakeVS9FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS9FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeVS9FindMake.cmake 2009-04-14 17:26:01.328125000 +0200 @@ -1,5 +1,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path] diff -Nur cmake-2.6.3/Modules/Platform/WinCE-cl.cmake cmake-2.6.3-p1/Modules/Platform/WinCE-cl.cmake --- cmake-2.6.3/Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/WinCE-cl.cmake 2009-04-17 12:32:39.078125000 +0200 @@ -0,0 +1,32 @@ + +SET(WIN32 1) +SET(WINCE 1) + + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") +ENDIF(MSVC_VERSION GREATER 1310) + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ws2.lib mmtimer.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce,${CMAKE_SYSTEM_VERSION}) +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce) + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff -Nur cmake-2.6.3/Modules/Platform/WinCE.cmake cmake-2.6.3-p1/Modules/Platform/WinCE.cmake --- cmake-2.6.3/Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/WinCE.cmake 2009-04-17 12:32:30.921875000 +0200 @@ -0,0 +1,28 @@ + +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "$(CEVER)") + ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + + diff -Nur cmake-2.6.3/Modules/Platform/Windows-cl.cmake cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake 2009-04-15 18:04:33.718750000 +0200 @@ -41,7 +41,8 @@ # that is automatically copied into try_compile directories # by the global generator. SET(MSVC_IDE 1) -IF(CMAKE_GENERATOR MATCHES "Makefiles") + +## IF(CMAKE_GENERATOR MATCHES "Makefiles") SET(MSVC_IDE 0) IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) SET(CMAKE_VC_COMPILER_TESTS 1) @@ -137,35 +138,86 @@ MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) - MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN - ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) + + # Testing the machine type of the generated binaries: + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/VC/bin" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "/Program Files/Microsoft Visual Studio 9/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + + ## TODO add further dumpbin machine to visual studio machine type conversion here, + ## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "CL platform seems to be:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") +## ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) ENDIF(CMAKE_FORCE_WIN64) @@ -228,14 +280,35 @@ # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + +SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + +# machine type +## IF(CMAKE_GENERATOR MATCHES "Makefiles") +## Setting machine makes only sense when linking cross compiled binaries with makefiles? + IF(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") + ELSE(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") + ENDIF(CMAKE_CL_MACHINE_TYPE) + + # append /ARMPADCODE + IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE ") + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + +## ELSE(CMAKE_GENERATOR MATCHES "Makefiles") + + IF(CMAKE_FORCE_WIN64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:x64") + ENDIF(CMAKE_FORCE_WIN64) + +## ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it diff -Nur cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake.in --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake.in 2009-04-14 10:46:17.140625000 +0200 @@ -3,6 +3,7 @@ SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) SET(CMAKE_CL_64 @CMAKE_CL_64@) +SET(CMAKE_CL_MACHINE_TYPE @CMAKE_CL_MACHINE_TYPE@) SET(MSVC60 @MSVC60@) SET(MSVC70 @MSVC70@) SET(MSVC71 @MSVC71@) diff -Nur cmake-2.6.3/Source/CMakeLists.txt cmake-2.6.3-p1/Source/CMakeLists.txt --- cmake-2.6.3/Source/CMakeLists.txt 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/CMakeLists.txt 2009-04-16 11:29:45.531250000 +0200 @@ -250,6 +250,8 @@ IF(NOT UNIX) SET(SRCS ${SRCS} + cmSDKConfigParser.cxx + cmSDKConfigParser.h cmGlobalBorlandMakefileGenerator.cxx cmGlobalBorlandMakefileGenerator.h cmGlobalMSYSMakefileGenerator.cxx @@ -264,8 +266,12 @@ cmGlobalVisualStudio7Generator.h cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio8Generator.h + cmGlobalVisualStudio8_SDKGenerator.cxx + cmGlobalVisualStudio8_SDKGenerator.h cmGlobalVisualStudio9Generator.cxx cmGlobalVisualStudio9Generator.h + cmGlobalVisualStudio9_SDKGenerator.cxx + cmGlobalVisualStudio9_SDKGenerator.h cmGlobalVisualStudio8Win64Generator.cxx cmGlobalVisualStudio8Win64Generator.h cmGlobalVisualStudio9Win64Generator.cxx Files cmake-2.6.3/Source/QtDialog/CMakeSetup.aps and cmake-2.6.3-p1/Source/QtDialog/CMakeSetup.aps differ diff -Nur cmake-2.6.3/Source/cmGeneratorFactory.h cmake-2.6.3-p1/Source/cmGeneratorFactory.h --- cmake-2.6.3/Source/cmGeneratorFactory.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGeneratorFactory.h 2009-04-16 13:00:30.281250000 +0200 @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGeneratorFactory_h +#define cmGeneratorFactory_h + + +class cmGlobalGenerator; + +/*! + * \brief Factory interface for global generators + * + * \note if we had a functor type like boost.function + binders we could + * avoid that. + */ +class cmGeneratorFactory +{ +public: + virtual cmGlobalGenerator* Create() = 0; + virtual ~cmGeneratorFactory() {}; + +}; + +/*! + * \brief Default Factory for Global Generators, requires only + * a simple factory function. + */ +class cmFunctionGeneratorFactory : public cmGeneratorFactory +{ +public: + typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); + + cmFunctionGeneratorFactory( CreateGeneratorFunctionType Fun ) + : fun(Fun) + { + } + + virtual cmGlobalGenerator* Create() + { + return fun(); + } +private: + CreateGeneratorFunctionType fun; +}; + + +#endif + diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio71Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio71Generator.cxx 2009-04-14 10:46:41.828125000 +0200 @@ -34,6 +34,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion71(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.cxx 2009-04-16 15:41:59.500000000 +0200 @@ -139,6 +139,7 @@ { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -663,7 +664,12 @@ std::vector<std::string> *cmGlobalVisualStudio7Generator::GetConfigurations() { return &this->Configurations; -}; +} + +PlatformDefs const& cmGlobalVisualStudio7Generator::GetPlatformDef() const +{ + return m_platform; +} //---------------------------------------------------------------------------- void cmGlobalVisualStudio7Generator diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.h 2009-04-16 15:41:56.406250000 +0200 @@ -18,6 +18,7 @@ #define cmGlobalVisualStudio7Generator_h #include "cmGlobalVisualStudioGenerator.h" +#include "cmSDKConfigParser.h" class cmTarget; struct cmVS7FlagTable; @@ -81,6 +82,12 @@ */ std::vector<std::string> *GetConfigurations(); + /** + * Get the platform definition + */ + virtual PlatformDefs const& GetPlatformDef() const; + + ///! Create a GUID or get an existing one. void CreateGUID(const char* name); std::string GetGUID(const char* name); @@ -160,6 +167,8 @@ // Set during OutputSLNFile with the name of the current project. // There is one SLN file per project. std::string CurrentProject; + + PlatformDefs m_platform; // Platform definition, empty when not used with an SDK }; #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK" diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.cxx 2009-04-14 10:46:41.625000000 +0200 @@ -36,6 +36,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -341,6 +342,10 @@ cmVS7FlagTable::UserValueRequired}, // There is no YX option in the VS8 IDE. + // WHY WAS THIS REMOVED FROM VS7 to VS8? + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + // Exception handling mode. If no entries match, it will be FALSE. {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.h 2009-04-14 10:46:41.843750000 +0200 @@ -67,7 +67,7 @@ virtual bool VSLinksDependencies() const { return false; } - static cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); virtual void AddPlatformDefinitions(cmMakefile* mf); virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-04-14 10:46:41.843750000 +0200 @@ -34,6 +34,7 @@ lg->SetVersion8(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 2009-04-17 14:56:15.687500000 +0200 @@ -0,0 +1,256 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" +#include "cmGeneratedFileStream.h" + + +cmGlobalVisualStudio8_SDKGenerator::cmGlobalVisualStudio8_SDKGenerator(PlatformDefs const& platform) +: m_platformName("Mobile Platform"), m_actualGeneratorName("Visual Studio 8.0 " + platform.PlatformName) +{ + m_platform = platform; + FindMakeProgramFile = "CMakeVS8FindMake.cmake"; + ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio8_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(m_platformName.c_str()); + lg->SetVersion8(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio .NET 2005 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC80", "1"); + mf->AddCacheDefinition("CMAKE_C_COMPILER",m_platform.Compiler.c_str(),"C Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_CXX_COMPILER",m_platform.Compiler.c_str(),"C++ Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_NAME","WinCE","Operating System",cmCacheManager::STRING,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_VERSION",m_platform.SystemVersion.c_str(),"CE Version",cmCacheManager::STRING,true); + + if(!m_platform.Archfam.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam).c_str()); + + // this one should never be empty + if(!m_platform.Archfam_.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam_).c_str()); + + if(!m_platform.InstructionSet.empty()) + mf->AddDefineFlag(("-D"+m_platform.InstructionSet).c_str()); + + // can be empty + if(!m_platform.PlatformDefines.empty()) + mf->AddDefineFlag(("-D"+m_platform.PlatformDefines).c_str()); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::Configure() +{ + this->cmGlobalVisualStudio7Generator::Configure(); + this->CreateGUID(CMAKE_CHECK_BUILD_SYSTEM_TARGET); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteSLNFile( + std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators) +{ + // Make all targets depend on their respective project's build + // system check target. + unsigned int i; + for(i = 0; i < generators.size(); ++i) + { + if(this->IsExcluded(root, generators[i])) + { + continue; + } + cmMakefile* mf = generators[i]->GetMakefile(); + cmTargets& tgts = mf->GetTargets(); + for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + { + if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + for(unsigned int j = 0; j < generators.size(); ++j) + { + // Every target in all generators should depend on this target. + cmMakefile* lmf = generators[j]->GetMakefile(); + cmTargets &atgts = lmf->GetTargets(); + for(cmTargets::iterator al = atgts.begin(); al != atgts.end(); ++al) + { + al->second.AddUtility(l->first.c_str()); + } + } + } + } + } + + // Now write the solution file. + this->cmGlobalVisualStudio71Generator::WriteSLNFile(fout, root, generators); +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8_SDKGenerator +::WriteSolutionConfigurations(std::ostream& fout) +{ + fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"; + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t" << *i << "|" << m_platform.PlatformName << " = " << *i << "|" + << m_platform.PlatformName << "\n"; + } + fout << "\tEndGlobalSection\n"; +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8_SDKGenerator +::WriteProjectConfigurations(std::ostream& fout, const char* name, + bool partOfDefaultBuild) +{ + std::string guid = this->GetGUID(name); + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".ActiveCfg = " + << *i << "|" << m_platform.PlatformName << "\n"; + if(partOfDefaultBuild) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".Build.0 = " + << *i << "|" << m_platform.PlatformName << "\n"; + } + } +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraFlagTable[] = +{ + {"CallingConvention", "Gd", "cdecl", "0", 0 }, + {"CallingConvention", "Gr", "fastcall", "1", 0 }, + {"CallingConvention", "Gz", "stdcall", "2", 0 }, + + {"StringPooling", "GF", "Enable Stringpooling", "true", 0 }, + + {"Detect64BitPortabilityProblems", "Wp64", + "Detect 64Bit Portability Problems", "true", 0 }, + {"ErrorReporting", "errorReport:prompt", "Report immediately", "1", 0 }, + {"ErrorReporting", "errorReport:queue", "Queue for next login", "2", 0 }, + // Precompiled header and related options. Note that the + // UsePrecompiledHeader entries are marked as "Continue" so that the + // corresponding PrecompiledHeaderThrough entry can be found. + {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "2", + cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, + {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "", + cmVS7FlagTable::UserValueRequired}, + // There is no YX option in the VS8 IDE. + + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + + // Exception handling mode. If no entries match, it will be FALSE. + {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, + + // Compile for special architecture + {"CompileForArchitecture", "QRarch4", "ARM4 without Thumb instructions", "0", 0}, + {"CompileForArchitecture", "QRarch5", "ARM5 without Thumb instructions", "1", 0}, + {"CompileForArchitecture", "QRarch4t", "ARM4 with Thumb instructions", "2", 0}, + {"CompileForArchitecture", "QRarch5t", "ARM5 with Thumb instructions", "3", 0}, + + {0,0,0,0,0} +}; +cmVS7FlagTable const* cmGlobalVisualStudio8_SDKGenerator::GetExtraFlagTableVS8() +{ + return cmVS8SDKExtraFlagTable; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraLinkFlagTable[] = +{ + + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:POSIX", "Posix application output", "8", 0}, // THIS IS ONLY AVAILABLE ON VC 8 + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "9", 0}, + + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio8_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS8SDKExtraLinkFlagTable; +} \ No newline at end of file diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.h 2009-04-16 15:42:09.046875000 +0200 @@ -0,0 +1,82 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio8_SDKGenerator_h +#define cmGlobalVisualStudio8_SDKGenerator_h + +#include "cmGlobalVisualStudio8Generator.h" +#include "cmGeneratorFactory.h" + +template<typename Generator> +class cmSDKGeneratorFactory : public cmGeneratorFactory +{ +public: + cmSDKGeneratorFactory(PlatformDefs const& platform) + : m_platform(platform) + {} + + cmGlobalGenerator * Create() + { + return new Generator(m_platform); + } +private: + PlatformDefs m_platform; +}; + +/** \class cmGlobalVisualStudio8_SDKGenerator + * \brief Creates Visual Studio 8 project files based on a platform + * SDK description + * + */ +class cmGlobalVisualStudio8_SDKGenerator : public cmGlobalVisualStudio8Generator +{ +public: + cmGlobalVisualStudio8_SDKGenerator(PlatformDefs const& platform); + + ///! Get the name for the generator. + virtual const char* GetName() const { + return m_actualGeneratorName.c_str();} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! Create a local generator appropriate to this Global Generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Override Configure and Generate to add the build-system check + * target. + */ + virtual void Configure(); + +protected: + + virtual bool VSLinksDependencies() const { return false; } + + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); + virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators); + virtual void WriteSolutionConfigurations(std::ostream& fout); + virtual void WriteProjectConfigurations(std::ostream& fout, + const char* name, + bool partOfDefaultBuild); + virtual void AddPlatformDefinitions(cmMakefile* mf); + + std::string m_platformName; + std::string m_actualGeneratorName; +}; +#endif diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Generator.cxx 2009-04-14 10:46:41.578125000 +0200 @@ -46,6 +46,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-04-14 10:46:41.546875000 +0200 @@ -31,6 +31,7 @@ lg->SetVersion9(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 2009-04-17 14:56:19.468750000 +0200 @@ -0,0 +1,180 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.6 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio9_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio9_SDKGenerator::cmGlobalVisualStudio9_SDKGenerator(PlatformDefs const& platform) +: cmGlobalVisualStudio8_SDKGenerator(platform) +{ + this->FindMakeProgramFile = "CMakeVS9FindMake.cmake"; + this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->PlatformName = "Mobile Platform"; + m_actualGeneratorName = "Visual Studio 9.0 " + m_platform.PlatformName; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC90", "1"); + mf->AddCacheDefinition("CMAKE_C_COMPILER",m_platform.Compiler.c_str(),"C Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_CXX_COMPILER",m_platform.Compiler.c_str(),"C++ Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_NAME","WinCE","Operating System",cmCacheManager::STRING,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_VERSION",m_platform.SystemVersion.c_str(),"CE Version",cmCacheManager::STRING,true); + + if(!m_platform.Archfam.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam).c_str()); + + // this one should never be empty + if(!m_platform.Archfam_.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam_).c_str()); + + if(!m_platform.InstructionSet.empty()) + mf->AddDefineFlag(("-D"+m_platform.InstructionSet).c_str()); + + // can be empty + if(!m_platform.PlatformDefines.empty()) + mf->AddDefineFlag(("-D"+m_platform.PlatformDefines).c_str()); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n"; + fout << "# Visual Studio 2008\n"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio9_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetVersion9(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio 9 2008 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::EnableLanguage(std::vector<std::string>const & lang, + cmMakefile *mf, bool optional) +{ + cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosDirectory() +{ + std::string base; + std::string path; + + // base begins with the VisualStudioProjectsLocation reg value... + if (cmSystemTools::ReadRegistryValue( + "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;" + "VisualStudioProjectsLocation", + base)) + { + cmSystemTools::ConvertToUnixSlashes(base); + + // 9.0 macros folder: + path = base + "/VSMacros80"; + // *NOT* a typo; right now in Visual Studio 2008 beta the macros + // folder is VSMacros80... They may change it to 90 before final + // release of 2008 or they may not... we'll have to keep our eyes + // on it + } + + // path is (correctly) still empty if we did not read the base value from + // the Registry value + return path; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosRegKeyBase() +{ + return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros"; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS9SDKExtraLinkFlagTable[] = +{ + + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "8", 0}, + + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio9_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS9SDKExtraLinkFlagTable; +} \ No newline at end of file diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.h 2009-04-16 14:42:54.656250000 +0200 @@ -0,0 +1,67 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.4 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio9_SDKGenerator_h +#define cmGlobalVisualStudio9_SDKGenerator_h + +#include "cmGlobalVisualStudio8_SDKGenerator.h" + + +/** \class cmGlobalVisualStudio9_WindowsMobile_Generator + * \brief Write a Unix makefiles. + * + * cmGlobalVisualStudio9_WindowsMobile_Generator manages UNIX build process for a tree + */ +class cmGlobalVisualStudio9_SDKGenerator : + public cmGlobalVisualStudio8_SDKGenerator +{ +public: + cmGlobalVisualStudio9_SDKGenerator(PlatformDefs const& platformDefs ); + + virtual void AddPlatformDefinitions(cmMakefile* mf); + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! create the correct local generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Try to determine system infomation such as shared library + * extension, pthreads, byte order etc. + */ + virtual void EnableLanguage(std::vector<std::string>const& languages, + cmMakefile *, bool optional); + + virtual void WriteSLNHeader(std::ostream& fout); + + /** + * Where does this version of Visual Studio look for macros for the + * current user? Returns the empty string if this version of Visual + * Studio does not implement support for VB macros. + */ + virtual std::string GetUserMacrosDirectory(); + + /** + * What is the reg key path to "vsmacros" for this version of Visual + * Studio? + */ + virtual std::string GetUserMacrosRegKeyBase(); + +protected: + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); +}; +#endif diff -Nur cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.cxx 2009-04-17 12:30:11.671875000 +0200 @@ -536,9 +536,10 @@ bool& flag_handled); }; -void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, +void cmLocalVisualStudio7Generator::WritePlatformConfiguration(std::ostream& fout, const char* configName, const char *libName, + const char *platformName, cmTarget &target) { const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); @@ -546,9 +547,21 @@ { mfcFlag = "0"; } + + const char* wholeprogoptFlag; + if(strcmp(configName,"Release")==0) + wholeprogoptFlag = this->Makefile->GetDefinition("CMAKE_WHOLEPROGOPT_FLAG_RELEASE"); + else + wholeprogoptFlag = this->Makefile->GetDefinition("CMAKE_WHOLEPROGOPT_FLAG_DEBUG"); + if(!wholeprogoptFlag) + { + wholeprogoptFlag = "0"; + } + fout << "\t\t<Configuration\n" - << "\t\t\tName=\"" << configName << "|" << this->PlatformName << "\"\n" + << "\t\t\tName=\"" << configName << "|" << platformName << "\"\n" << "\t\t\tOutputDirectory=\"" << configName << "\"\n"; + // This is an internal type to Visual Studio, it seems that: // 4 == static library // 2 == dll @@ -667,6 +680,7 @@ << "\"\n" << "\t\t\tConfigurationType=\"" << configType << "\"\n" << "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n" + << "\t\t\tWholeProgramOptimization=\"" << wholeprogoptFlag << "\"\n" << "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n"; // If unicode is enabled change the character set to unicode, if not @@ -815,10 +829,26 @@ } this->OutputTargetRules(fout, configName, target, libName); - this->OutputBuildTool(fout, configName, target, targetOptions.IsDebug()); + this->OutputBuildTool(fout, configName, platformName, target, targetOptions.IsDebug()); fout << "\t\t</Configuration>\n"; } +void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + cmTarget &target) +{ + if((this->PlatformName).compare("Mobile Platform") == 0) + { + cmGlobalVisualStudio7Generator *gg = static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); + WritePlatformConfiguration(fout,configName,libName,gg->GetPlatformDef().PlatformName.c_str(),target); + } + else + { + WritePlatformConfiguration(fout,configName,libName,(this->PlatformName).c_str(),target); + } +} + //---------------------------------------------------------------------------- std::string cmLocalVisualStudio7Generator @@ -837,6 +867,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, const char* configName, + const char* platformName, cmTarget &target, bool isDebug) { @@ -879,7 +910,7 @@ extraLinkOptions += " "; extraLinkOptions += targetLinkFlags; } - Options linkOptions(this, this->Version, Options::Linker); + Options linkOptions(this, this->Version, Options::Linker, this->ExtraLinkFlagTable); // MODIFIED BY CLEMENS linkOptions.Parse(extraLinkOptions.c_str()); switch(target.GetType()) { @@ -937,16 +968,30 @@ fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. - fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " - << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) - << " "; - this->Internal->OutputLibraries(fout, cli.GetItems()); - fout << "\"\n"; - temp = target.GetDirectory(configName); - temp += "/"; - temp += targetNameFull; + fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) + << " "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + + } + else + { + fout << "\t\t\t\tAdditionalDependencies=\" "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + + // dlls in Windows CE also need /SUBSYSTEM:WINDOWSCE set + fout << "\t\t\t\tSubSystem=\"9\"\n"; + } + temp = target.GetDirectory(configName) + "/" + targetNameFull; fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; this->WriteTargetVersionAttribute(fout, target); @@ -955,6 +1000,7 @@ this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; this->OutputModuleDefinitionFile(fout, target); + temp = target.GetDirectory(configName); temp += "/"; temp += targetNamePDB; @@ -972,6 +1018,7 @@ { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n"; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1009,6 +1056,8 @@ } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. @@ -1017,6 +1066,22 @@ << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; + } else + { + linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + // Use the NOINHERIT macro to avoid getting VS project default + // libraries which may be set by the user to something bad. + fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) + << " "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + //fout << "\t\t\t\tSubSystem=\"0" << "\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + } temp = target.GetDirectory(configName); temp += "/"; temp += targetNameFull; @@ -1027,20 +1092,33 @@ fout << "\t\t\t\tAdditionalLibraryDirectories=\""; this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; - fout << "\t\t\t\tProgramDataBaseFile=\"" - << target.GetDirectory(configName) << "/" << targetNamePDB + fout << "\t\t\t\tProgramDataBaseFile=\"" + << target.GetDirectory(configName) << "/" << targetNamePDB << "\"\n"; + if(isDebug) { fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; } - if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) { - fout << "\t\t\t\tSubSystem=\"2\"\n"; - } + if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + fout << "\t\t\t\tSubSystem=\"2\"\n"; + } + else + { + fout << "\t\t\t\tSubSystem=\"1\"\n"; + } + } else { - fout << "\t\t\t\tSubSystem=\"1\"\n"; + // assumge WinCE/Windows Mobile + fout << "\t\t\t\tSubSystem=\"9\"\n"; + if ( ! target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + fout << "\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n"; + } } std::string stackVar = "CMAKE_"; stackVar += linkLanguage; @@ -1050,6 +1128,7 @@ { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\""; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1379,6 +1458,9 @@ dir_max += config_max; dir_max += "/"; + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + // Loop through each source in the source group. std::string objectName; for(std::vector<const cmSourceFile *>::const_iterator sf = @@ -1432,6 +1514,50 @@ fci = fcinfo.FileConfigMap.begin(); fci != fcinfo.FileConfigMap.end(); ++fci) { + if((this->PlatformName).compare("Mobile Platform") == 0) + { + PlatformDefs const& pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fci->second; + fout << "\t\t\t\t<FileConfiguration\n" + << "\t\t\t\t\tName=\"" << fci->first + << "|" << pldef.PlatformName << "\""; + if(fc.ExcludedFromBuild) + { + fout << " ExcludedFromBuild=\"true\""; + } + fout << ">\n"; + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n"; + if(!fc.CompileFlags.empty() || + !fc.CompileDefs.empty() || + !fc.CompileDefsConfig.empty()) + { + Options fileOptions(this, this->Version, Options::Compiler, + this->ExtraFlagTable); + fileOptions.Parse(fc.CompileFlags.c_str()); + fileOptions.AddDefines(fc.CompileDefs.c_str()); + fileOptions.AddDefines(fc.CompileDefsConfig.c_str()); + fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n"); + fileOptions.OutputFlagMap(fout, "\t\t\t\t\t"); + fileOptions.OutputPreprocessorDefinitions(fout, + "\t\t\t\t\t", "\n"); + } + if(!fc.AdditionalDeps.empty()) + { + fout << "\t\t\t\t\tAdditionalDependencies=\"" + << fc.AdditionalDeps.c_str() << "\"\n"; + } + if(!fc.ObjectName.empty()) + { + fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" + << fc.ObjectName.c_str() << "\"\n"; + } + fout << "\t\t\t\t\t/>\n" + << "\t\t\t\t</FileConfiguration>\n"; + + } + else + { cmLVS7GFileConfig const& fc = fci->second; fout << "\t\t\t\t<FileConfiguration\n" << "\t\t\t\t\tName=\"" << fci->first @@ -1471,6 +1597,7 @@ << "\t\t\t\t</FileConfiguration>\n"; } } + } fout << "\t\t\t</File>\n"; } } @@ -1499,9 +1626,9 @@ // Write the rule for each configuration. std::vector<std::string>::iterator i; - std::vector<std::string> *configs = - static_cast<cmGlobalVisualStudio7Generator *> - (this->GlobalGenerator)->GetConfigurations(); + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + std::vector<std::string> *configs = gg->GetConfigurations(); const char* compileTool = "VCCLCompilerTool"; if(this->FortranProject) { @@ -1514,6 +1641,82 @@ } for(i = configs->begin(); i != configs->end(); ++i) { + if((this->PlatformName).compare("Mobile Platform") == 0) + { + PlatformDefs const &pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; + fout << "\t\t\t\t<FileConfiguration\n"; + fout << "\t\t\t\t\tName=\"" << *i << "|" << pldef.PlatformName << "\">\n"; + if(!fc.CompileFlags.empty()) + { + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << compileTool << "\"\n" + << "\t\t\t\t\tAdditionalOptions=\"" + << this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n"; + } + + std::string script = + this->ConstructScript(command.GetCommandLines(), + command.GetWorkingDirectory(), + i->c_str(), + command.GetEscapeOldStyle(), + command.GetEscapeAllowMakeVars()); + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << customTool << "\"\n" + << "\t\t\t\t\tDescription=\"" + << this->EscapeForXML(comment.c_str()) << "\"\n" + << "\t\t\t\t\tCommandLine=\"" + << this->EscapeForXML(script.c_str()) << "\"\n" + << "\t\t\t\t\tAdditionalDependencies=\""; + if(command.GetDepends().empty()) + { + // There are no real dependencies. Produce an artificial one to + // make sure the rule runs reliably. + if(!cmSystemTools::FileExists(source)) + { + std::ofstream depout(source); + depout << "Artificial dependency for a custom command.\n"; + } + fout << this->ConvertToXMLOutputPath(source); + } + else + { + // Write out the dependencies for the rule. + for(std::vector<std::string>::const_iterator d = + command.GetDepends().begin(); + d != command.GetDepends().end(); + ++d) + { + // Get the real name of the dependency in case it is a CMake target. + std::string dep = this->GetRealDependency(d->c_str(), i->c_str()); + fout << this->ConvertToXMLOutputPath(dep.c_str()) + << ";"; + } + } + fout << "\"\n"; + fout << "\t\t\t\t\tOutputs=\""; + if(command.GetOutputs().empty()) + { + fout << source << "_force"; + } + else + { + // Write a rule for the output generated by this command. + const char* sep = ""; + for(std::vector<std::string>::const_iterator o = + command.GetOutputs().begin(); + o != command.GetOutputs().end(); + ++o) + { + fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str()); + sep = ";"; + } + } + fout << "\"/>\n"; + fout << "\t\t\t\t</FileConfiguration>\n"; + } + else + { cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; fout << "\t\t\t\t<FileConfiguration\n"; fout << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n"; @@ -1586,6 +1789,7 @@ fout << "\t\t\t\t</FileConfiguration>\n"; } } +} void cmLocalVisualStudio7Generator::WriteVCProjBeginGroup(std::ostream& fout, @@ -1789,13 +1993,17 @@ } if(projectType) { - fout << "\tProjectType=\"" << projectType << "\"\n"; + fout << "\tProjectType=\"" << projectType << "\">\n"; } fout<< "\tKeyword=\"" << keyword << "\">\n" << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if((this->PlatformName).compare("Mobile Platform") == 0) + fout << "\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } @@ -1850,9 +2058,13 @@ << "\tSccProvider=\"" << vsProvider << "\"\n"; } fout << "\tKeyword=\"" << keyword << "\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if((this->PlatformName).compare("Mobile Platform") == 0) + fout << "\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } diff -Nur cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.h 2009-04-14 10:46:41.859375000 +0200 @@ -68,6 +68,8 @@ void SetExtraFlagTable(cmVS7FlagTable const* table) { this->ExtraFlagTable = table; } + void SetExtraLinkFlagTable(cmVS7FlagTable const* table) + { this->ExtraLinkFlagTable = table; } private: typedef cmLocalVisualStudio7GeneratorOptions Options; typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; @@ -85,6 +87,11 @@ void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); cmSourceFile* CreateVCProjBuildRule(); + void WritePlatformConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + const char *platformName, + cmTarget &target); void WriteConfigurations(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfiguration(std::ostream& fout, @@ -96,7 +103,7 @@ void OutputTargetRules(std::ostream& fout, const char* configName, cmTarget &target, const char *libName); void OutputBuildTool(std::ostream& fout, const char* configName, - cmTarget& t, bool debug); + const char* platformName, cmTarget& t, bool debug); void OutputLibraryDirectories(std::ostream& fout, std::vector<std::string> const& dirs); void OutputModuleDefinitionFile(std::ostream& fout, cmTarget &target); @@ -124,6 +131,7 @@ friend class cmLocalVisualStudio7GeneratorInternals; cmVS7FlagTable const* ExtraFlagTable; + cmVS7FlagTable const* ExtraLinkFlagTable; std::string ModuleDefinitionFile; int Version; bool FortranProject; diff -Nur cmake-2.6.3/Source/cmMakefile.cxx cmake-2.6.3-p1/Source/cmMakefile.cxx --- cmake-2.6.3/Source/cmMakefile.cxx 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmMakefile.cxx 2009-04-16 13:09:00.218750000 +0200 @@ -21,6 +21,10 @@ #include "cmSourceFileLocation.h" #include "cmSystemTools.h" #include "cmGlobalGenerator.h" +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW) +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" +#endif #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" @@ -2740,8 +2744,9 @@ std::string cmakeCommand = this->GetDefinition("CMAKE_COMMAND"); cmake cm; cm.SetIsInTryCompile(true); - cmGlobalGenerator *gg = cm.CreateGlobalGenerator - (this->LocalGenerator->GetGlobalGenerator()->GetName()); + cmGlobalGenerator *parentgg = this->LocalGenerator->GetGlobalGenerator(); + std::string parentggname(parentgg->GetName()); + cmGlobalGenerator *gg = cm.CreateGlobalGenerator(parentggname.c_str()); if (!gg) { cmSystemTools::Error( @@ -2750,6 +2755,22 @@ cmSystemTools::ChangeDirectory(cwd.c_str()); return 1; } + // check to update platforms list if it is an SDK based builder +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW) + if(parentggname.compare(cmGlobalVisualStudio8_SDKGenerator::GetActualName()) == 0) + { // gg should inherit platform vector from parent + cmGlobalVisualStudio8_SDKGenerator* srcgg = static_cast<cmGlobalVisualStudio8_SDKGenerator*>(parentgg); + cmGlobalVisualStudio8_SDKGenerator* targg = static_cast<cmGlobalVisualStudio8_SDKGenerator*>(gg); +// targg->filterSDKs(srcgg->GetPlatforms()); + } + else if(parentggname.compare(cmGlobalVisualStudio9_SDKGenerator::GetActualName()) == 0) + { // gg should inherit platform vector from parent + cmGlobalVisualStudio9_SDKGenerator* srcgg = static_cast<cmGlobalVisualStudio9_SDKGenerator*>(parentgg); + cmGlobalVisualStudio9_SDKGenerator* targg = static_cast<cmGlobalVisualStudio9_SDKGenerator*>(gg); +// targg->filterSDKs(srcgg->GetPlatforms()); + } +#endif + cm.SetGlobalGenerator(gg); // do a configure diff -Nur cmake-2.6.3/Source/cmSDKConfigParser.cxx cmake-2.6.3-p1/Source/cmSDKConfigParser.cxx --- cmake-2.6.3/Source/cmSDKConfigParser.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmSDKConfigParser.cxx 2009-04-17 11:10:17.765625000 +0200 @@ -0,0 +1,187 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include <iomanip> +#include <sstream> +#include "cmSDKConfigParser.h" +#include "cmake.h" + +cmSDKConfigParser::cmSDKConfigParser(std::string const& basePath) +: m_vsBasePath(basePath) +{ + current_platform_valid = false; +} + +void cmSDKConfigParser::StartElement(const char* name, const char** atts) +{ + if ( strcmp(name, "Platform") == 0 ) + { + PlatformDefs nPlatform; + platformVec.push_back(nPlatform); + current_platform_valid = true; + } + if ( strcmp(name, "Directories") == 0 ) + { + const char* includes = this->FindAttribute(atts, "Include"); + if (includes) + { + platformVec.back().IncludePaths = std::string(includes); + } + const char* libs = this->FindAttribute(atts, "Library"); + if (libs) + { + platformVec.back().LibraryPaths = std::string(libs); + } + } + if ( strcmp(name, "Macro") == 0 ) + { + const char* rev = this->FindAttribute(atts, "Name"); + if (rev) + { + if ( strcmp(rev, "PLATFORMDEFINES") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().PlatformDefines = std::string(rev); + } + else if ( strcmp(rev, "CEVER") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().CEver = std::string(rev); + } + else if ( strcmp(rev, "ARCHFAM") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().Archfam = std::string(rev); + } + else if ( strcmp(rev, "_ARCHFAM_") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().Archfam_ = std::string(rev); + } + else if ( strcmp(rev, "INSTRUCTIONSET") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().InstructionSet= std::string(rev); + } + } + } + this->CharacterData.clear(); +} + +void cmSDKConfigParser::EndElement(const char* name) +{ + if ( strcmp(name, "PlatformName") == 0 ) + { + platformVec.back().PlatformName = std::string(this->CharacterData.begin(),this->CharacterData.end()); + } + else if ( strcmp(name, "OSMinorVersion") == 0 && current_platform_valid) + { + platformVec.back().MinorVer = atoi(std::string(this->CharacterData.begin(),this->CharacterData.end()).c_str()); + } + else if ( strcmp(name, "OSMajorVersion") == 0 && current_platform_valid) + { + platformVec.back().MajorVer = atoi(std::string(this->CharacterData.begin(),this->CharacterData.end()).c_str()); + } + if ( strcmp(name, "Platform") == 0 ) + { + // done with parsing the platform now we set the compiler path + // that can be used by the generators. + if( platformVec.back().Archfam.find("ARM") != std::string::npos || + platformVec.back().Archfam.find("arm") != std::string::npos) + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/ce/bin/x86_arm/cl.exe"; + } + else if( platformVec.back().Archfam.find("SH") != std::string::npos || + platformVec.back().Archfam.find("sh") != std::string::npos) + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/ce/bin/x86_sh/cl.exe"; + } + else if( platformVec.back().Archfam.find("MIPS") != std::string::npos || + platformVec.back().Archfam.find("mips") != std::string::npos ) + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/ce/bin/x86_mips/cl.exe"; + } + // could be a special x86 wince platform - we have to do more parsing if + // wince gets a 64bit version + else + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/bin/cl.exe"; + } + + std::ostringstream out; + out << platformVec.back().MajorVer << '.' + << std::setw(2)<< std::setfill('0') + << platformVec.back().MinorVer; + platformVec.back().SystemVersion = out.str(); + } + + this->CharacterData.clear(); +} + +void cmSDKConfigParser::CharacterDataHandler(const char* data, int length) +{ + this->CharacterData.insert(this->CharacterData.end(), data, data+length); +} + +const char* cmSDKConfigParser::FindAttribute( const char** atts, const char* attribute ) +{ + if ( !atts || !attribute ) + { + return 0; + } + const char **atr = atts; + while ( *atr && **atr && **(atr+1) ) + { + if ( strcmp(*atr, attribute) == 0 ) + { + return *(atr+1); + } + atr+=2; + } + return 0; +} + + +void cmSDKConfigParser::GetSDKsInstalled(std::string vsVersionString, std::vector<PlatformDefs> & platformSDKs ) +{ + platformSDKs.clear(); + + std::string regkey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\VisualStudio\\"); + regkey += vsVersionString; + regkey += std::string("\\Setup\\VS;"); + + std::string base; + + + if (!cmSystemTools::ReadRegistryValue((regkey+ + std::string("ProductDir")).c_str(), + base)) + { + return; + } + + cmSystemTools::ConvertToUnixSlashes(base); + + // NOW READ THE CONFIG FILE FOR THE SDKs + std::string configFilename = base + std::string("/VC/vcpackages/WCE.VCPlatform.config"); + cmSDKConfigParser parser(base); + if(parser.ParseFile(configFilename.c_str()) == 0) { + return; + } + swap(platformSDKs, parser.getPlatforms()); +} + diff -Nur cmake-2.6.3/Source/cmSDKConfigParser.h cmake-2.6.3-p1/Source/cmSDKConfigParser.h --- cmake-2.6.3/Source/cmSDKConfigParser.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmSDKConfigParser.h 2009-04-17 10:57:54.953125000 +0200 @@ -0,0 +1,63 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmSDKConfigParser_h +#define cmSDKConfigParser_h + +#include "cmXMLParser.h" + +typedef struct { + int MajorVer; + int MinorVer; + std::string PlatformDefines; + std::string SystemVersion; //! CMAKE_SYSTEM_VERSION + std::string CEver; //! == UNDER_CE + std::string Archfam; + std::string Archfam_; + std::string InstructionSet; + std::string PlatformName; + std::string LibraryPaths; + std::string IncludePaths; + std::string Compiler; // cl compiler with absolute path +} PlatformDefs; + + +class cmSDKConfigParser : public cmXMLParser +{ +public: + cmSDKConfigParser(std::string const& vsPath); + + std::vector<PlatformDefs> & getPlatforms() {return platformVec;}; + std::vector<PlatformDefs> const& getPlatforms() const {return platformVec;}; + + /*! + \brief Parses the SDKs installed for the given visual studio version. + \param VSversionString visual studio version, i.e. 8.0 or 9.0 + */ + static void GetSDKsInstalled(std::string VSversionString, std::vector<PlatformDefs> & platformSDKs ); +protected: + void StartElement(const char* name, const char** atts); + void EndElement(const char* name); + void CharacterDataHandler(const char* data, int length); + const char* FindAttribute( const char** atts, const char* attribute ); +private: + std::vector<char> CharacterData; + std::vector<PlatformDefs> platformVec; + bool current_platform_valid; + std::string m_vsBasePath; +}; + +#endif diff -Nur cmake-2.6.3/Source/cmake.cxx cmake-2.6.3-p1/Source/cmake.cxx --- cmake-2.6.3/Source/cmake.cxx 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmake.cxx 2009-04-16 13:09:23.437500000 +0200 @@ -65,6 +65,8 @@ # include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio8Generator.h" # include "cmGlobalVisualStudio9Generator.h" +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" # include "cmGlobalVisualStudio9Win64Generator.h" # include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" @@ -1726,7 +1728,7 @@ } } - generator = (genIt->second)(); + generator = (genIt->second)->Create(); generator->SetCMakeInstance(this); generator->SetExternalMakefileProjectGenerator(extraGenerator); return generator; @@ -2405,33 +2407,52 @@ #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(CMAKE_BOOT_MINGW) this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] = - &cmGlobalVisualStudio6Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio6Generator::New); this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] = - &cmGlobalVisualStudio7Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio7Generator::New); this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = - &cmGlobalVisualStudio71Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio71Generator::New); this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = - &cmGlobalVisualStudio8Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Generator::New); this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = - &cmGlobalVisualStudio9Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Generator::New); + + std::vector<PlatformDefs> vs8Platforms; + cmSDKConfigParser::GetSDKsInstalled("8.0", vs8Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs8Platforms.begin(), + e = vs8Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 8.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio8_SDKGenerator>(*it); + } + + std::vector<PlatformDefs> vs9Platforms; + cmSDKConfigParser::GetSDKsInstalled("9.0", vs9Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs9Platforms.begin(), + e = vs9Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 9.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio9_SDKGenerator>(*it); + } + this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = - &cmGlobalVisualStudio9Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Win64Generator::New); this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = - &cmGlobalVisualStudio8Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Win64Generator::New); this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = - &cmGlobalBorlandMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalBorlandMakefileGenerator::New); this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = - &cmGlobalNMakeMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalNMakeMakefileGenerator::New); this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] = - &cmGlobalWatcomWMakeGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalWatcomWMakeGenerator::New); # endif this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = - &cmGlobalMSYSMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMSYSMakefileGenerator::New); this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] = - &cmGlobalMinGWMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMinGWMakefileGenerator::New); #endif this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] = - &cmGlobalUnixMakefileGenerator3::New; + new cmFunctionGeneratorFactory(&cmGlobalUnixMakefileGenerator3::New); #ifdef CMAKE_USE_XCODE this->Generators[cmGlobalXCodeGenerator::GetActualName()] = &cmGlobalXCodeGenerator::New; @@ -2530,7 +2551,7 @@ i != this->Generators.end(); ++i) { cmDocumentationEntry e; - cmGlobalGenerator* generator = (i->second)(); + cmGlobalGenerator* generator = (i->second)->Create(); generator->GetDocumentation(e); delete generator; v.push_back(e); diff -Nur cmake-2.6.3/Source/cmake.h cmake-2.6.3-p1/Source/cmake.h --- cmake-2.6.3/Source/cmake.h 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmake.h 2009-04-16 12:31:28.531250000 +0200 @@ -43,6 +43,7 @@ #include "cmSystemTools.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +#include "cmGeneratorFactory.h" class cmGlobalGenerator; class cmLocalGenerator; @@ -56,6 +57,9 @@ class cmPolicies; class cmListFileBacktrace; + + + class cmake { public: @@ -370,9 +374,8 @@ typedef std::map<cmStdString, CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap; - typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); typedef std::map<cmStdString, - CreateGeneratorFunctionType> RegisteredGeneratorsMap; + cmGeneratorFactory*> RegisteredGeneratorsMap; RegisteredCommandsMap Commands; RegisteredGeneratorsMap Generators; RegisteredExtraGeneratorsMap ExtraGenerators; diff -Nur cmake-2.6.3/Tests/CMakeLists.txt cmake-2.6.3-p1/Tests/CMakeLists.txt --- cmake-2.6.3/Tests/CMakeLists.txt 2009-02-21 21:36:55.000000000 +0100 +++ cmake-2.6.3-p1/Tests/CMakeLists.txt 2009-04-14 10:46:41.921875000 +0200 @@ -65,6 +65,19 @@ SET(CMAKE_LONG_TEST_TIMEOUT 1500) ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003/CMakeCache.txt.in" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003/CMakeCache.txt" COPYONLY + ) + ADD_TEST(SimplePPC2003 ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003" + --build-two-config + --build-generator "Visual Studio 9 2008 (with SDK support)" + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project SimplePPC2003) + # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) ADD_TEST_MACRO(FindPackageTest FindPackageTest) @@ -429,6 +442,7 @@ --test-command Tutorial 25.0) ENDFOREACH(STP) + ADD_TEST(testing ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Testing" diff -Nur cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeCache.txt.in --- cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeCache.txt.in 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,5 @@ +//SDK to use +CMAKE_GENERATOR:INTERNAL=Visual Studio 9 2008 (with SDK support) +CMAKE_SYSTEM_NAME:STRING=WINCE +CMAKE_SYSTEM_VERSION:STRING=4.20 +PLATFORM_SDKS:STRING=Pocket PC 2003 (ARMV4) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeLists.txt --- cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeLists.txt 2009-04-14 10:46:41.921875000 +0200 @@ -0,0 +1,14 @@ +# a simple test case for compiling a PPC 2003 project +PROJECT(SimplePPC2003) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(RESOURCEFILES resourceppc.h SimplePPC2003ppc.rc SimplePPC2003ppc.rc2) +SET(SOURCEFILES SimplePPC2003.cpp stdafx.cpp) +SET(HEADERFILES stdafx.h SimplePPC2003.h) + +ADD_DEFINITIONS(-DWINCE -D$(ARCHFAM) -D$(_ARCHFAM_) -D_UNICODE -DUNICODE -D_USRDLL ) + +ADD_EXECUTABLE(SimplePPC2003 ${RESOURCEFILES} ${SOURCEFILES} ${HEADERFILES}) + +SET_TARGET_PROPERTIES(SimplePPC2003 PROPERTIES LINK_FLAGS /machine:ARM) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake cmake-2.6.3-p1/Tests/SimplePPC2003/GetCompilerVersion.cmake --- cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/GetCompilerVersion.cmake 2009-04-14 10:46:41.859375000 +0200 @@ -0,0 +1,95 @@ + +FIND_PROGRAM(CMAKE_VCVARS + NAMES vcvarsall.bat + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC" + ) + +# Testing the machine type of the generated binaries: +FIND_PROGRAM(CMAKE_TEST_COMPILER + NAMES cl.exe + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + ) + +SET(testNmakeCLVersionFile + "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c") +STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}") + +EXEC_PROGRAM("\"${CMAKE_VCVARS}\" && \"${CMAKE_TEST_COMPILER}\" /nologo -EP \"${testNmakeCLVersionFile}\"" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT + RETURN_VALUE CMAKE_COMPILER_RETURN + ) + +IF(NOT CMAKE_COMPILER_RETURN) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining the version of compiler passed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}") + STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1" + compilerVersion "${compilerVersion}") + MESSAGE(STATUS "Check for CL compiler version - ${compilerVersion}") + SET(MSVC60) + SET(MSVC70) + SET(MSVC71) + SET(MSVC80) + SET(CMAKE_COMPILER_2005) + IF("${compilerVersion}" LESS 1300) + SET(MSVC60 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1) + ENDIF("${compilerVersion}" LESS 1300) + IF("${compilerVersion}" EQUAL 1300) + SET(MSVC70 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1300) + IF("${compilerVersion}" EQUAL 1310) + SET(MSVC71 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1310) + IF("${compilerVersion}" EQUAL 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" EQUAL 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" EQUAL 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" EQUAL 1500) + IF("${compilerVersion}" GREATER 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" GREATER 1500) + SET(MSVC_VERSION "${compilerVersion}") +ELSE(NOT CMAKE_COMPILER_RETURN) + MESSAGE(STATUS "Check for CL compiler version - failed") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining the version of compiler failed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") +ENDIF(NOT CMAKE_COMPILER_RETURN) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.cpp --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.cpp 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,259 @@ +// SimplePPC2003.cpp : Defines the entry point for the application. +// + +#include "stdafx.h" +#include "SimplePPC2003.h" + + +#define MAX_LOADSTRING 100 + +// Global Variables: +HINSTANCE g_hInst; // current instance +HWND g_hWndMenuBar; // menu bar handle + +// Forward declarations of functions included in this code module: +ATOM MyRegisterClass(HINSTANCE, LPTSTR); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); + +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + MSG msg; + + // Perform application initialization: + if (!InitInstance(hInstance, nCmdShow)) + { + return FALSE; + } + + HACCEL hAccelTable; + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SIMPLEPPC2003)); + + // Main message loop: + while (GetMessage(&msg, NULL, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + +// +// FUNCTION: MyRegisterClass() +// +// PURPOSE: Registers the window class. +// +// COMMENTS: +// +ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) +{ + WNDCLASS wc; + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SIMPLEPPC2003)); + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = 0; + wc.lpszClassName = szWindowClass; + + return RegisterClass(&wc); +} + +// +// FUNCTION: InitInstance(HINSTANCE, int) +// +// PURPOSE: Saves instance handle and creates main window +// +// COMMENTS: +// +// In this function, we save the instance handle in a global variable and +// create and display the main program window. +// +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + HWND hWnd; + TCHAR szTitle[MAX_LOADSTRING]; // title bar text + TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name + + g_hInst = hInstance; // Store instance handle in our global variable + + // SHInitExtraControls should be called once during your application's initialization to initialize any + // of the device specific controls such as CAPEDIT and SIPPREF. + SHInitExtraControls(); + + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDC_SIMPLEPPC2003, szWindowClass, MAX_LOADSTRING); + + //If it is already running, then focus on the window, and exit + hWnd = FindWindow(szWindowClass, szTitle); + if (hWnd) + { + // set focus to foremost child window + // The "| 0x00000001" is used to bring any owned windows to the foreground and + // activate them. + SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); + return 0; + } + + if (!MyRegisterClass(hInstance, szWindowClass)) + { + return FALSE; + } + + hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); + + if (!hWnd) + { + return FALSE; + } + + // When the main window is created using CW_USEDEFAULT the height of the menubar (if one + // is created is not taken into account). So we resize the window after creating it + // if a menubar is present + if (g_hWndMenuBar) + { + RECT rc; + RECT rcMenuBar; + + GetWindowRect(hWnd, &rc); + GetWindowRect(g_hWndMenuBar, &rcMenuBar); + rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top); + + MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE); + } + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + + return TRUE; +} + +// +// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) +// +// PURPOSE: Processes messages for the main window. +// +// WM_COMMAND - process the application menu +// WM_PAINT - Paint the main window +// WM_DESTROY - post a quit message and return +// +// +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + PAINTSTRUCT ps; + HDC hdc; + + static SHACTIVATEINFO s_sai; + + switch (message) + { + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + // Parse the menu selections: + switch (wmId) + { + case IDM_HELP_ABOUT: + DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, About); + break; + case IDM_OK: + SendMessage (hWnd, WM_CLOSE, 0, 0); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + case WM_CREATE: + SHMENUBARINFO mbi; + + memset(&mbi, 0, sizeof(SHMENUBARINFO)); + mbi.cbSize = sizeof(SHMENUBARINFO); + mbi.hwndParent = hWnd; + mbi.nToolBarId = IDR_MENU; + mbi.hInstRes = g_hInst; + + if (!SHCreateMenuBar(&mbi)) + { + g_hWndMenuBar = NULL; + } + else + { + g_hWndMenuBar = mbi.hwndMB; + } + + // Initialize the shell activate info structure + memset(&s_sai, 0, sizeof (s_sai)); + s_sai.cbSize = sizeof (s_sai); + break; + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + + // TODO: Add any drawing code here... + + EndPaint(hWnd, &ps); + break; + case WM_DESTROY: + CommandBar_Destroy(g_hWndMenuBar); + PostQuitMessage(0); + break; + + case WM_ACTIVATE: + // Notify shell of our activate message + SHHandleWMActivate(hWnd, wParam, lParam, &s_sai, FALSE); + break; + case WM_SETTINGCHANGE: + SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai); + break; + + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +// Message handler for about box. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + { + // Create a Done button and size it. + SHINITDLGINFO shidi; + shidi.dwMask = SHIDIM_FLAGS; + shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_EMPTYMENU; + shidi.hDlg = hDlg; + SHInitDialog(&shidi); + } + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + break; + + case WM_CLOSE: + EndDialog(hDlg, message); + return TRUE; + + } + return (INT_PTR)FALSE; +} diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.h --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.h 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,2 @@ +#pragma once +#include "resourceppc.h" diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,170 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resourceppc.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#include "resdefce.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +//IDI_SIMPLEPPC2003 ICON "SimplePPC2003.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU MENU DISCARDABLE +BEGIN + POPUP "Help" + BEGIN + MENUITEM "About", IDM_HELP_ABOUT + END +END + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_SIMPLEPPC2003 ACCELERATORS +BEGIN + "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT + "Q", IDM_OK, VIRTKEY, CONTROL, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG 0, 0, 156, 129 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,12,36,70,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,12,48,66,8 +END + +IDD_ABOUTBOX_WIDE DIALOG 0, 0, 210, 129 +STYLE WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,48,12,66,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,48,24,66,8 +END + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 149 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END + + IDD_ABOUTBOX_WIDE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END +END +#endif // APSTUDIO_INVOKED + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resourceppc.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#include ""resdefce.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""SimplePPC2003ppc.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// +STRINGTABLE +BEGIN + IDC_SIMPLEPPC2003 "SIMPLEPPC2003" + IDS_APP_TITLE "SimplePPC2003" + IDS_OK "OK" + IDS_HELP "HELP" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "SimplePPC2003ppc.rc2" // non-Microsoft Visual C++ edited resources +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,35 @@ +// +// SimplePPC2003PPC.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// +HI_RES_AWARE CEUX {1} // turn off the emulation layer + // Remove this resource to enable pixel- + // doubling on platforms that support it +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// +// SHMENUBAR +// + +IDR_MENU SHMENUBAR DISCARDABLE +BEGIN + IDR_MENU, + 2, + + I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, + IDS_OK, 0, NOMENU, + + I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, + IDS_HELP, 0, 0, +END + diff -Nur cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h cmake-2.6.3-p1/Tests/SimplePPC2003/resourceppc.h --- cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/resourceppc.h 2009-04-14 10:46:41.875000000 +0200 @@ -0,0 +1,34 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SimplePPC2003ppc.rc +// + +#define IDS_APP_TITLE 1 +#define IDC_SIMPLEPPC2003 2 +#define IDI_SIMPLEPPC2003 101 +#define IDR_MENU 102 +#define IDS_OK 103 +#define IDS_HELP 104 +#define IDD_ABOUTBOX 105 +#define IDD_ABOUTBOX_WIDE 106 +#define IDC_STATIC_1 201 +#define IDC_STATIC_2 202 +#define IDC_STATIC_3 203 +#define IDM_OK 40000 +#define IDM_HELP 40001 +#define IDM_HELP_ABOUT 40002 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff -Nur cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.cpp --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.cpp 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// SimplePPC2003.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/stdafx.h cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.h --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.h 2009-04-14 10:46:41.875000000 +0200 @@ -0,0 +1,62 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#pragma comment(linker, "/nodefaultlib:libc.lib") +#pragma comment(linker, "/nodefaultlib:libcd.lib") + +// NOTE - this value is not strongly correlated to the Windows CE OS version being targeted +#define WINVER _WIN32_WCE + +#include <ceconfig.h> +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#define SHELL_AYGSHELL +#endif + +#ifdef _CE_DCOM +#define _ATL_APARTMENT_THREADED +#endif + +#include <windows.h> +#include <commctrl.h> + +#include <aygshell.h> +#pragma comment(lib, "aygshell.lib") + + +// Windows Header Files: +#include <windows.h> + +// C RunTime Header Files +#include <stdlib.h> +#include <malloc.h> +#include <memory.h> +#include <tchar.h> + +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#ifndef _DEVICE_RESOLUTION_AWARE +#define _DEVICE_RESOLUTION_AWARE +#endif +#endif + +#ifdef _DEVICE_RESOLUTION_AWARE +#include "DeviceResolutionAware.h" +#endif + +#if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) ) + #pragma comment(lib, "ccrtrtti.lib") + #ifdef _X86_ + #if defined(_DEBUG) + #pragma comment(lib, "libcmtx86d.lib") + #else + #pragma comment(lib, "libcmtx86.lib") + #endif + #endif +#endif + +#include <altcecrt.h> + +// TODO: reference additional headers your program requires here devenv-before-VCExpress.patch [^] (1,120 bytes) 2009-04-18 13:26 [Show Content] [Hide Content] diff -Nur cmake-2.6.3/Modules/CMakeVS8FindMake.cmake cmake-2.6.3-p1/Modules/CMakeVS8FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS8FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeVS8FindMake.cmake 2009-04-14 17:26:13.046875000 +0200 @@ -1,5 +1,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path] diff -Nur cmake-2.6.3/Modules/CMakeVS9FindMake.cmake cmake-2.6.3-p1/Modules/CMakeVS9FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS9FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeVS9FindMake.cmake 2009-04-14 17:26:01.328125000 +0200 @@ -1,5 +1,5 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path] wince-cmakefiles-support.patch [^] (11,657 bytes) 2009-04-18 13:26 [Show Content] [Hide Content] diff -Nur cmake-2.6.3/Modules/CMakeTestCLMachineType.c cmake-2.6.3-p1/Modules/CMakeTestCLMachineType.c --- cmake-2.6.3/Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/CMakeTestCLMachineType.c 2009-04-14 10:46:17.125000000 +0200 @@ -0,0 +1 @@ +int dummy() { return 0;} diff -Nur cmake-2.6.3/Modules/Platform/WinCE-cl.cmake cmake-2.6.3-p1/Modules/Platform/WinCE-cl.cmake --- cmake-2.6.3/Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/WinCE-cl.cmake 2009-04-17 12:32:39.078125000 +0200 @@ -0,0 +1,32 @@ + +SET(WIN32 1) +SET(WINCE 1) + + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") +ENDIF(MSVC_VERSION GREATER 1310) + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ws2.lib mmtimer.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce,${CMAKE_SYSTEM_VERSION}) +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE /subsystem:windowsce) + SET(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff -Nur cmake-2.6.3/Modules/Platform/WinCE.cmake cmake-2.6.3-p1/Modules/Platform/WinCE.cmake --- cmake-2.6.3/Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/WinCE.cmake 2009-04-17 12:32:30.921875000 +0200 @@ -0,0 +1,28 @@ + +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "$(CEVER)") + ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + + diff -Nur cmake-2.6.3/Modules/Platform/Windows-cl.cmake cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake 2009-04-15 18:04:33.718750000 +0200 @@ -41,7 +41,8 @@ # that is automatically copied into try_compile directories # by the global generator. SET(MSVC_IDE 1) -IF(CMAKE_GENERATOR MATCHES "Makefiles") + +## IF(CMAKE_GENERATOR MATCHES "Makefiles") SET(MSVC_IDE 0) IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) SET(CMAKE_VC_COMPILER_TESTS 1) @@ -137,35 +138,86 @@ MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) - MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN - ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) + + # Testing the machine type of the generated binaries: + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/VC/bin" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "/Program Files/Microsoft Visual Studio 9/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + + ## TODO add further dumpbin machine to visual studio machine type conversion here, + ## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "CL platform seems to be:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") +## ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) ENDIF(CMAKE_FORCE_WIN64) @@ -228,14 +280,35 @@ # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + +SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + +# machine type +## IF(CMAKE_GENERATOR MATCHES "Makefiles") +## Setting machine makes only sense when linking cross compiled binaries with makefiles? + IF(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") + ELSE(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") + ENDIF(CMAKE_CL_MACHINE_TYPE) + + # append /ARMPADCODE + IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE ") + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + +## ELSE(CMAKE_GENERATOR MATCHES "Makefiles") + + IF(CMAKE_FORCE_WIN64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:x64") + ENDIF(CMAKE_FORCE_WIN64) + +## ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it diff -Nur cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake.in --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Modules/Platform/Windows-cl.cmake.in 2009-04-14 10:46:17.140625000 +0200 @@ -3,6 +3,7 @@ SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) SET(CMAKE_CL_64 @CMAKE_CL_64@) +SET(CMAKE_CL_MACHINE_TYPE @CMAKE_CL_MACHINE_TYPE@) SET(MSVC60 @MSVC60@) SET(MSVC70 @MSVC70@) SET(MSVC71 @MSVC71@) wince-generators.patch [^] (69,451 bytes) 2009-04-18 13:27 [Show Content] [Hide Content] diff -Nur cmake-2.6.3/Source/CMakeLists.txt cmake-2.6.3-p1/Source/CMakeLists.txt --- cmake-2.6.3/Source/CMakeLists.txt 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/CMakeLists.txt 2009-04-16 11:29:45.531250000 +0200 @@ -250,6 +250,8 @@ IF(NOT UNIX) SET(SRCS ${SRCS} + cmSDKConfigParser.cxx + cmSDKConfigParser.h cmGlobalBorlandMakefileGenerator.cxx cmGlobalBorlandMakefileGenerator.h cmGlobalMSYSMakefileGenerator.cxx @@ -264,8 +266,12 @@ cmGlobalVisualStudio7Generator.h cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio8Generator.h + cmGlobalVisualStudio8_SDKGenerator.cxx + cmGlobalVisualStudio8_SDKGenerator.h cmGlobalVisualStudio9Generator.cxx cmGlobalVisualStudio9Generator.h + cmGlobalVisualStudio9_SDKGenerator.cxx + cmGlobalVisualStudio9_SDKGenerator.h cmGlobalVisualStudio8Win64Generator.cxx cmGlobalVisualStudio8Win64Generator.h cmGlobalVisualStudio9Win64Generator.cxx Files cmake-2.6.3/Source/QtDialog/CMakeSetup.aps and cmake-2.6.3-p1/Source/QtDialog/CMakeSetup.aps differ diff -Nur cmake-2.6.3/Source/cmGeneratorFactory.h cmake-2.6.3-p1/Source/cmGeneratorFactory.h --- cmake-2.6.3/Source/cmGeneratorFactory.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGeneratorFactory.h 2009-04-16 13:00:30.281250000 +0200 @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGeneratorFactory_h +#define cmGeneratorFactory_h + + +class cmGlobalGenerator; + +/*! + * \brief Factory interface for global generators + * + * \note if we had a functor type like boost.function + binders we could + * avoid that. + */ +class cmGeneratorFactory +{ +public: + virtual cmGlobalGenerator* Create() = 0; + virtual ~cmGeneratorFactory() {}; + +}; + +/*! + * \brief Default Factory for Global Generators, requires only + * a simple factory function. + */ +class cmFunctionGeneratorFactory : public cmGeneratorFactory +{ +public: + typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); + + cmFunctionGeneratorFactory( CreateGeneratorFunctionType Fun ) + : fun(Fun) + { + } + + virtual cmGlobalGenerator* Create() + { + return fun(); + } +private: + CreateGeneratorFunctionType fun; +}; + + +#endif + diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio71Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio71Generator.cxx 2009-04-14 10:46:41.828125000 +0200 @@ -34,6 +34,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion71(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.cxx 2009-04-16 15:41:59.500000000 +0200 @@ -139,6 +139,7 @@ { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -663,7 +664,12 @@ std::vector<std::string> *cmGlobalVisualStudio7Generator::GetConfigurations() { return &this->Configurations; -}; +} + +PlatformDefs const& cmGlobalVisualStudio7Generator::GetPlatformDef() const +{ + return m_platform; +} //---------------------------------------------------------------------------- void cmGlobalVisualStudio7Generator diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio7Generator.h 2009-04-16 15:41:56.406250000 +0200 @@ -18,6 +18,7 @@ #define cmGlobalVisualStudio7Generator_h #include "cmGlobalVisualStudioGenerator.h" +#include "cmSDKConfigParser.h" class cmTarget; struct cmVS7FlagTable; @@ -81,6 +82,12 @@ */ std::vector<std::string> *GetConfigurations(); + /** + * Get the platform definition + */ + virtual PlatformDefs const& GetPlatformDef() const; + + ///! Create a GUID or get an existing one. void CreateGUID(const char* name); std::string GetGUID(const char* name); @@ -160,6 +167,8 @@ // Set during OutputSLNFile with the name of the current project. // There is one SLN file per project. std::string CurrentProject; + + PlatformDefs m_platform; // Platform definition, empty when not used with an SDK }; #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK" diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.cxx 2009-04-14 10:46:41.625000000 +0200 @@ -36,6 +36,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -341,6 +342,10 @@ cmVS7FlagTable::UserValueRequired}, // There is no YX option in the VS8 IDE. + // WHY WAS THIS REMOVED FROM VS7 to VS8? + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + // Exception handling mode. If no entries match, it will be FALSE. {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Generator.h 2009-04-14 10:46:41.843750000 +0200 @@ -67,7 +67,7 @@ virtual bool VSLinksDependencies() const { return false; } - static cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); virtual void AddPlatformDefinitions(cmMakefile* mf); virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-04-14 10:46:41.843750000 +0200 @@ -34,6 +34,7 @@ lg->SetVersion8(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 2009-04-17 14:56:15.687500000 +0200 @@ -0,0 +1,256 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" +#include "cmGeneratedFileStream.h" + + +cmGlobalVisualStudio8_SDKGenerator::cmGlobalVisualStudio8_SDKGenerator(PlatformDefs const& platform) +: m_platformName("Mobile Platform"), m_actualGeneratorName("Visual Studio 8.0 " + platform.PlatformName) +{ + m_platform = platform; + FindMakeProgramFile = "CMakeVS8FindMake.cmake"; + ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio8_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(m_platformName.c_str()); + lg->SetVersion8(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio .NET 2005 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC80", "1"); + mf->AddCacheDefinition("CMAKE_C_COMPILER",m_platform.Compiler.c_str(),"C Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_CXX_COMPILER",m_platform.Compiler.c_str(),"C++ Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_NAME","WinCE","Operating System",cmCacheManager::STRING,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_VERSION",m_platform.SystemVersion.c_str(),"CE Version",cmCacheManager::STRING,true); + + if(!m_platform.Archfam.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam).c_str()); + + // this one should never be empty + if(!m_platform.Archfam_.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam_).c_str()); + + if(!m_platform.InstructionSet.empty()) + mf->AddDefineFlag(("-D"+m_platform.InstructionSet).c_str()); + + // can be empty + if(!m_platform.PlatformDefines.empty()) + mf->AddDefineFlag(("-D"+m_platform.PlatformDefines).c_str()); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::Configure() +{ + this->cmGlobalVisualStudio7Generator::Configure(); + this->CreateGUID(CMAKE_CHECK_BUILD_SYSTEM_TARGET); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteSLNFile( + std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators) +{ + // Make all targets depend on their respective project's build + // system check target. + unsigned int i; + for(i = 0; i < generators.size(); ++i) + { + if(this->IsExcluded(root, generators[i])) + { + continue; + } + cmMakefile* mf = generators[i]->GetMakefile(); + cmTargets& tgts = mf->GetTargets(); + for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + { + if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + for(unsigned int j = 0; j < generators.size(); ++j) + { + // Every target in all generators should depend on this target. + cmMakefile* lmf = generators[j]->GetMakefile(); + cmTargets &atgts = lmf->GetTargets(); + for(cmTargets::iterator al = atgts.begin(); al != atgts.end(); ++al) + { + al->second.AddUtility(l->first.c_str()); + } + } + } + } + } + + // Now write the solution file. + this->cmGlobalVisualStudio71Generator::WriteSLNFile(fout, root, generators); +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8_SDKGenerator +::WriteSolutionConfigurations(std::ostream& fout) +{ + fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"; + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t" << *i << "|" << m_platform.PlatformName << " = " << *i << "|" + << m_platform.PlatformName << "\n"; + } + fout << "\tEndGlobalSection\n"; +} + +//---------------------------------------------------------------------------- +void +cmGlobalVisualStudio8_SDKGenerator +::WriteProjectConfigurations(std::ostream& fout, const char* name, + bool partOfDefaultBuild) +{ + std::string guid = this->GetGUID(name); + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".ActiveCfg = " + << *i << "|" << m_platform.PlatformName << "\n"; + if(partOfDefaultBuild) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".Build.0 = " + << *i << "|" << m_platform.PlatformName << "\n"; + } + } +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraFlagTable[] = +{ + {"CallingConvention", "Gd", "cdecl", "0", 0 }, + {"CallingConvention", "Gr", "fastcall", "1", 0 }, + {"CallingConvention", "Gz", "stdcall", "2", 0 }, + + {"StringPooling", "GF", "Enable Stringpooling", "true", 0 }, + + {"Detect64BitPortabilityProblems", "Wp64", + "Detect 64Bit Portability Problems", "true", 0 }, + {"ErrorReporting", "errorReport:prompt", "Report immediately", "1", 0 }, + {"ErrorReporting", "errorReport:queue", "Queue for next login", "2", 0 }, + // Precompiled header and related options. Note that the + // UsePrecompiledHeader entries are marked as "Continue" so that the + // corresponding PrecompiledHeaderThrough entry can be found. + {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "2", + cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, + {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "", + cmVS7FlagTable::UserValueRequired}, + // There is no YX option in the VS8 IDE. + + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + + // Exception handling mode. If no entries match, it will be FALSE. + {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, + + // Compile for special architecture + {"CompileForArchitecture", "QRarch4", "ARM4 without Thumb instructions", "0", 0}, + {"CompileForArchitecture", "QRarch5", "ARM5 without Thumb instructions", "1", 0}, + {"CompileForArchitecture", "QRarch4t", "ARM4 with Thumb instructions", "2", 0}, + {"CompileForArchitecture", "QRarch5t", "ARM5 with Thumb instructions", "3", 0}, + + {0,0,0,0,0} +}; +cmVS7FlagTable const* cmGlobalVisualStudio8_SDKGenerator::GetExtraFlagTableVS8() +{ + return cmVS8SDKExtraFlagTable; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraLinkFlagTable[] = +{ + + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:POSIX", "Posix application output", "8", 0}, // THIS IS ONLY AVAILABLE ON VC 8 + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "9", 0}, + + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio8_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS8SDKExtraLinkFlagTable; +} \ No newline at end of file diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio8_SDKGenerator.h 2009-04-16 15:42:09.046875000 +0200 @@ -0,0 +1,82 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio8_SDKGenerator_h +#define cmGlobalVisualStudio8_SDKGenerator_h + +#include "cmGlobalVisualStudio8Generator.h" +#include "cmGeneratorFactory.h" + +template<typename Generator> +class cmSDKGeneratorFactory : public cmGeneratorFactory +{ +public: + cmSDKGeneratorFactory(PlatformDefs const& platform) + : m_platform(platform) + {} + + cmGlobalGenerator * Create() + { + return new Generator(m_platform); + } +private: + PlatformDefs m_platform; +}; + +/** \class cmGlobalVisualStudio8_SDKGenerator + * \brief Creates Visual Studio 8 project files based on a platform + * SDK description + * + */ +class cmGlobalVisualStudio8_SDKGenerator : public cmGlobalVisualStudio8Generator +{ +public: + cmGlobalVisualStudio8_SDKGenerator(PlatformDefs const& platform); + + ///! Get the name for the generator. + virtual const char* GetName() const { + return m_actualGeneratorName.c_str();} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! Create a local generator appropriate to this Global Generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Override Configure and Generate to add the build-system check + * target. + */ + virtual void Configure(); + +protected: + + virtual bool VSLinksDependencies() const { return false; } + + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); + virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators); + virtual void WriteSolutionConfigurations(std::ostream& fout); + virtual void WriteProjectConfigurations(std::ostream& fout, + const char* name, + bool partOfDefaultBuild); + virtual void AddPlatformDefinitions(cmMakefile* mf); + + std::string m_platformName; + std::string m_actualGeneratorName; +}; +#endif diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Generator.cxx 2009-04-14 10:46:41.578125000 +0200 @@ -46,6 +46,7 @@ cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-04-14 10:46:41.546875000 +0200 @@ -31,6 +31,7 @@ lg->SetVersion9(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 2009-04-17 14:56:19.468750000 +0200 @@ -0,0 +1,180 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.6 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio9_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio9_SDKGenerator::cmGlobalVisualStudio9_SDKGenerator(PlatformDefs const& platform) +: cmGlobalVisualStudio8_SDKGenerator(platform) +{ + this->FindMakeProgramFile = "CMakeVS9FindMake.cmake"; + this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->PlatformName = "Mobile Platform"; + m_actualGeneratorName = "Visual Studio 9.0 " + m_platform.PlatformName; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC90", "1"); + mf->AddCacheDefinition("CMAKE_C_COMPILER",m_platform.Compiler.c_str(),"C Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_CXX_COMPILER",m_platform.Compiler.c_str(),"C++ Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_NAME","WinCE","Operating System",cmCacheManager::STRING,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_VERSION",m_platform.SystemVersion.c_str(),"CE Version",cmCacheManager::STRING,true); + + if(!m_platform.Archfam.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam).c_str()); + + // this one should never be empty + if(!m_platform.Archfam_.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam_).c_str()); + + if(!m_platform.InstructionSet.empty()) + mf->AddDefineFlag(("-D"+m_platform.InstructionSet).c_str()); + + // can be empty + if(!m_platform.PlatformDefines.empty()) + mf->AddDefineFlag(("-D"+m_platform.PlatformDefines).c_str()); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n"; + fout << "# Visual Studio 2008\n"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio9_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetVersion9(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio 9 2008 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::EnableLanguage(std::vector<std::string>const & lang, + cmMakefile *mf, bool optional) +{ + cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosDirectory() +{ + std::string base; + std::string path; + + // base begins with the VisualStudioProjectsLocation reg value... + if (cmSystemTools::ReadRegistryValue( + "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;" + "VisualStudioProjectsLocation", + base)) + { + cmSystemTools::ConvertToUnixSlashes(base); + + // 9.0 macros folder: + path = base + "/VSMacros80"; + // *NOT* a typo; right now in Visual Studio 2008 beta the macros + // folder is VSMacros80... They may change it to 90 before final + // release of 2008 or they may not... we'll have to keep our eyes + // on it + } + + // path is (correctly) still empty if we did not read the base value from + // the Registry value + return path; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosRegKeyBase() +{ + return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros"; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS9SDKExtraLinkFlagTable[] = +{ + + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "8", 0}, + + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio9_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS9SDKExtraLinkFlagTable; +} \ No newline at end of file diff -Nur cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmGlobalVisualStudio9_SDKGenerator.h 2009-04-16 14:42:54.656250000 +0200 @@ -0,0 +1,67 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.4 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio9_SDKGenerator_h +#define cmGlobalVisualStudio9_SDKGenerator_h + +#include "cmGlobalVisualStudio8_SDKGenerator.h" + + +/** \class cmGlobalVisualStudio9_WindowsMobile_Generator + * \brief Write a Unix makefiles. + * + * cmGlobalVisualStudio9_WindowsMobile_Generator manages UNIX build process for a tree + */ +class cmGlobalVisualStudio9_SDKGenerator : + public cmGlobalVisualStudio8_SDKGenerator +{ +public: + cmGlobalVisualStudio9_SDKGenerator(PlatformDefs const& platformDefs ); + + virtual void AddPlatformDefinitions(cmMakefile* mf); + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! create the correct local generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Try to determine system infomation such as shared library + * extension, pthreads, byte order etc. + */ + virtual void EnableLanguage(std::vector<std::string>const& languages, + cmMakefile *, bool optional); + + virtual void WriteSLNHeader(std::ostream& fout); + + /** + * Where does this version of Visual Studio look for macros for the + * current user? Returns the empty string if this version of Visual + * Studio does not implement support for VB macros. + */ + virtual std::string GetUserMacrosDirectory(); + + /** + * What is the reg key path to "vsmacros" for this version of Visual + * Studio? + */ + virtual std::string GetUserMacrosRegKeyBase(); + +protected: + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); +}; +#endif diff -Nur cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.cxx 2009-04-17 12:30:11.671875000 +0200 @@ -536,9 +536,10 @@ bool& flag_handled); }; -void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, +void cmLocalVisualStudio7Generator::WritePlatformConfiguration(std::ostream& fout, const char* configName, const char *libName, + const char *platformName, cmTarget &target) { const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); @@ -546,9 +547,21 @@ { mfcFlag = "0"; } + + const char* wholeprogoptFlag; + if(strcmp(configName,"Release")==0) + wholeprogoptFlag = this->Makefile->GetDefinition("CMAKE_WHOLEPROGOPT_FLAG_RELEASE"); + else + wholeprogoptFlag = this->Makefile->GetDefinition("CMAKE_WHOLEPROGOPT_FLAG_DEBUG"); + if(!wholeprogoptFlag) + { + wholeprogoptFlag = "0"; + } + fout << "\t\t<Configuration\n" - << "\t\t\tName=\"" << configName << "|" << this->PlatformName << "\"\n" + << "\t\t\tName=\"" << configName << "|" << platformName << "\"\n" << "\t\t\tOutputDirectory=\"" << configName << "\"\n"; + // This is an internal type to Visual Studio, it seems that: // 4 == static library // 2 == dll @@ -667,6 +680,7 @@ << "\"\n" << "\t\t\tConfigurationType=\"" << configType << "\"\n" << "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n" + << "\t\t\tWholeProgramOptimization=\"" << wholeprogoptFlag << "\"\n" << "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n"; // If unicode is enabled change the character set to unicode, if not @@ -815,10 +829,26 @@ } this->OutputTargetRules(fout, configName, target, libName); - this->OutputBuildTool(fout, configName, target, targetOptions.IsDebug()); + this->OutputBuildTool(fout, configName, platformName, target, targetOptions.IsDebug()); fout << "\t\t</Configuration>\n"; } +void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + cmTarget &target) +{ + if((this->PlatformName).compare("Mobile Platform") == 0) + { + cmGlobalVisualStudio7Generator *gg = static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); + WritePlatformConfiguration(fout,configName,libName,gg->GetPlatformDef().PlatformName.c_str(),target); + } + else + { + WritePlatformConfiguration(fout,configName,libName,(this->PlatformName).c_str(),target); + } +} + //---------------------------------------------------------------------------- std::string cmLocalVisualStudio7Generator @@ -837,6 +867,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, const char* configName, + const char* platformName, cmTarget &target, bool isDebug) { @@ -879,7 +910,7 @@ extraLinkOptions += " "; extraLinkOptions += targetLinkFlags; } - Options linkOptions(this, this->Version, Options::Linker); + Options linkOptions(this, this->Version, Options::Linker, this->ExtraLinkFlagTable); // MODIFIED BY CLEMENS linkOptions.Parse(extraLinkOptions.c_str()); switch(target.GetType()) { @@ -937,16 +968,30 @@ fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. - fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " - << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) - << " "; - this->Internal->OutputLibraries(fout, cli.GetItems()); - fout << "\"\n"; - temp = target.GetDirectory(configName); - temp += "/"; - temp += targetNameFull; + fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) + << " "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + + } + else + { + fout << "\t\t\t\tAdditionalDependencies=\" "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + + // dlls in Windows CE also need /SUBSYSTEM:WINDOWSCE set + fout << "\t\t\t\tSubSystem=\"9\"\n"; + } + temp = target.GetDirectory(configName) + "/" + targetNameFull; fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; this->WriteTargetVersionAttribute(fout, target); @@ -955,6 +1000,7 @@ this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; this->OutputModuleDefinitionFile(fout, target); + temp = target.GetDirectory(configName); temp += "/"; temp += targetNamePDB; @@ -972,6 +1018,7 @@ { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n"; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1009,6 +1056,8 @@ } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) + { linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. @@ -1017,6 +1066,22 @@ << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; + } else + { + linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + // Use the NOINHERIT macro to avoid getting VS project default + // libraries which may be set by the user to something bad. + fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " + << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()) + << " "; + this->Internal->OutputLibraries(fout, cli.GetItems()); + fout << "\"\n"; + + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + //fout << "\t\t\t\tSubSystem=\"0" << "\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + } temp = target.GetDirectory(configName); temp += "/"; temp += targetNameFull; @@ -1027,20 +1092,33 @@ fout << "\t\t\t\tAdditionalLibraryDirectories=\""; this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; - fout << "\t\t\t\tProgramDataBaseFile=\"" - << target.GetDirectory(configName) << "/" << targetNamePDB + fout << "\t\t\t\tProgramDataBaseFile=\"" + << target.GetDirectory(configName) << "/" << targetNamePDB << "\"\n"; + if(isDebug) { fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; } - if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + if(strcmp(platformName,"Win32") == 0 || strcmp(platformName,"x64") == 0) { - fout << "\t\t\t\tSubSystem=\"2\"\n"; - } + if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + fout << "\t\t\t\tSubSystem=\"2\"\n"; + } + else + { + fout << "\t\t\t\tSubSystem=\"1\"\n"; + } + } else { - fout << "\t\t\t\tSubSystem=\"1\"\n"; + // assumge WinCE/Windows Mobile + fout << "\t\t\t\tSubSystem=\"9\"\n"; + if ( ! target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + fout << "\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n"; + } } std::string stackVar = "CMAKE_"; stackVar += linkLanguage; @@ -1050,6 +1128,7 @@ { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\""; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1379,6 +1458,9 @@ dir_max += config_max; dir_max += "/"; + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + // Loop through each source in the source group. std::string objectName; for(std::vector<const cmSourceFile *>::const_iterator sf = @@ -1432,6 +1514,50 @@ fci = fcinfo.FileConfigMap.begin(); fci != fcinfo.FileConfigMap.end(); ++fci) { + if((this->PlatformName).compare("Mobile Platform") == 0) + { + PlatformDefs const& pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fci->second; + fout << "\t\t\t\t<FileConfiguration\n" + << "\t\t\t\t\tName=\"" << fci->first + << "|" << pldef.PlatformName << "\""; + if(fc.ExcludedFromBuild) + { + fout << " ExcludedFromBuild=\"true\""; + } + fout << ">\n"; + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n"; + if(!fc.CompileFlags.empty() || + !fc.CompileDefs.empty() || + !fc.CompileDefsConfig.empty()) + { + Options fileOptions(this, this->Version, Options::Compiler, + this->ExtraFlagTable); + fileOptions.Parse(fc.CompileFlags.c_str()); + fileOptions.AddDefines(fc.CompileDefs.c_str()); + fileOptions.AddDefines(fc.CompileDefsConfig.c_str()); + fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n"); + fileOptions.OutputFlagMap(fout, "\t\t\t\t\t"); + fileOptions.OutputPreprocessorDefinitions(fout, + "\t\t\t\t\t", "\n"); + } + if(!fc.AdditionalDeps.empty()) + { + fout << "\t\t\t\t\tAdditionalDependencies=\"" + << fc.AdditionalDeps.c_str() << "\"\n"; + } + if(!fc.ObjectName.empty()) + { + fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" + << fc.ObjectName.c_str() << "\"\n"; + } + fout << "\t\t\t\t\t/>\n" + << "\t\t\t\t</FileConfiguration>\n"; + + } + else + { cmLVS7GFileConfig const& fc = fci->second; fout << "\t\t\t\t<FileConfiguration\n" << "\t\t\t\t\tName=\"" << fci->first @@ -1471,6 +1597,7 @@ << "\t\t\t\t</FileConfiguration>\n"; } } + } fout << "\t\t\t</File>\n"; } } @@ -1499,9 +1626,9 @@ // Write the rule for each configuration. std::vector<std::string>::iterator i; - std::vector<std::string> *configs = - static_cast<cmGlobalVisualStudio7Generator *> - (this->GlobalGenerator)->GetConfigurations(); + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + std::vector<std::string> *configs = gg->GetConfigurations(); const char* compileTool = "VCCLCompilerTool"; if(this->FortranProject) { @@ -1514,6 +1641,82 @@ } for(i = configs->begin(); i != configs->end(); ++i) { + if((this->PlatformName).compare("Mobile Platform") == 0) + { + PlatformDefs const &pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; + fout << "\t\t\t\t<FileConfiguration\n"; + fout << "\t\t\t\t\tName=\"" << *i << "|" << pldef.PlatformName << "\">\n"; + if(!fc.CompileFlags.empty()) + { + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << compileTool << "\"\n" + << "\t\t\t\t\tAdditionalOptions=\"" + << this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n"; + } + + std::string script = + this->ConstructScript(command.GetCommandLines(), + command.GetWorkingDirectory(), + i->c_str(), + command.GetEscapeOldStyle(), + command.GetEscapeAllowMakeVars()); + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << customTool << "\"\n" + << "\t\t\t\t\tDescription=\"" + << this->EscapeForXML(comment.c_str()) << "\"\n" + << "\t\t\t\t\tCommandLine=\"" + << this->EscapeForXML(script.c_str()) << "\"\n" + << "\t\t\t\t\tAdditionalDependencies=\""; + if(command.GetDepends().empty()) + { + // There are no real dependencies. Produce an artificial one to + // make sure the rule runs reliably. + if(!cmSystemTools::FileExists(source)) + { + std::ofstream depout(source); + depout << "Artificial dependency for a custom command.\n"; + } + fout << this->ConvertToXMLOutputPath(source); + } + else + { + // Write out the dependencies for the rule. + for(std::vector<std::string>::const_iterator d = + command.GetDepends().begin(); + d != command.GetDepends().end(); + ++d) + { + // Get the real name of the dependency in case it is a CMake target. + std::string dep = this->GetRealDependency(d->c_str(), i->c_str()); + fout << this->ConvertToXMLOutputPath(dep.c_str()) + << ";"; + } + } + fout << "\"\n"; + fout << "\t\t\t\t\tOutputs=\""; + if(command.GetOutputs().empty()) + { + fout << source << "_force"; + } + else + { + // Write a rule for the output generated by this command. + const char* sep = ""; + for(std::vector<std::string>::const_iterator o = + command.GetOutputs().begin(); + o != command.GetOutputs().end(); + ++o) + { + fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str()); + sep = ";"; + } + } + fout << "\"/>\n"; + fout << "\t\t\t\t</FileConfiguration>\n"; + } + else + { cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; fout << "\t\t\t\t<FileConfiguration\n"; fout << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n"; @@ -1586,6 +1789,7 @@ fout << "\t\t\t\t</FileConfiguration>\n"; } } +} void cmLocalVisualStudio7Generator::WriteVCProjBeginGroup(std::ostream& fout, @@ -1789,13 +1993,17 @@ } if(projectType) { - fout << "\tProjectType=\"" << projectType << "\"\n"; + fout << "\tProjectType=\"" << projectType << "\">\n"; } fout<< "\tKeyword=\"" << keyword << "\">\n" << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if((this->PlatformName).compare("Mobile Platform") == 0) + fout << "\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } @@ -1850,9 +2058,13 @@ << "\tSccProvider=\"" << vsProvider << "\"\n"; } fout << "\tKeyword=\"" << keyword << "\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if((this->PlatformName).compare("Mobile Platform") == 0) + fout << "\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } diff -Nur cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmLocalVisualStudio7Generator.h 2009-04-14 10:46:41.859375000 +0200 @@ -68,6 +68,8 @@ void SetExtraFlagTable(cmVS7FlagTable const* table) { this->ExtraFlagTable = table; } + void SetExtraLinkFlagTable(cmVS7FlagTable const* table) + { this->ExtraLinkFlagTable = table; } private: typedef cmLocalVisualStudio7GeneratorOptions Options; typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; @@ -85,6 +87,11 @@ void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); cmSourceFile* CreateVCProjBuildRule(); + void WritePlatformConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + const char *platformName, + cmTarget &target); void WriteConfigurations(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfiguration(std::ostream& fout, @@ -96,7 +103,7 @@ void OutputTargetRules(std::ostream& fout, const char* configName, cmTarget &target, const char *libName); void OutputBuildTool(std::ostream& fout, const char* configName, - cmTarget& t, bool debug); + const char* platformName, cmTarget& t, bool debug); void OutputLibraryDirectories(std::ostream& fout, std::vector<std::string> const& dirs); void OutputModuleDefinitionFile(std::ostream& fout, cmTarget &target); @@ -124,6 +131,7 @@ friend class cmLocalVisualStudio7GeneratorInternals; cmVS7FlagTable const* ExtraFlagTable; + cmVS7FlagTable const* ExtraLinkFlagTable; std::string ModuleDefinitionFile; int Version; bool FortranProject; diff -Nur cmake-2.6.3/Source/cmMakefile.cxx cmake-2.6.3-p1/Source/cmMakefile.cxx --- cmake-2.6.3/Source/cmMakefile.cxx 2009-02-21 21:36:53.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmMakefile.cxx 2009-04-16 13:09:00.218750000 +0200 @@ -21,6 +21,10 @@ #include "cmSourceFileLocation.h" #include "cmSystemTools.h" #include "cmGlobalGenerator.h" +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW) +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" +#endif #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" @@ -2740,8 +2744,9 @@ std::string cmakeCommand = this->GetDefinition("CMAKE_COMMAND"); cmake cm; cm.SetIsInTryCompile(true); - cmGlobalGenerator *gg = cm.CreateGlobalGenerator - (this->LocalGenerator->GetGlobalGenerator()->GetName()); + cmGlobalGenerator *parentgg = this->LocalGenerator->GetGlobalGenerator(); + std::string parentggname(parentgg->GetName()); + cmGlobalGenerator *gg = cm.CreateGlobalGenerator(parentggname.c_str()); if (!gg) { cmSystemTools::Error( @@ -2750,6 +2755,22 @@ cmSystemTools::ChangeDirectory(cwd.c_str()); return 1; } + // check to update platforms list if it is an SDK based builder +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW) + if(parentggname.compare(cmGlobalVisualStudio8_SDKGenerator::GetActualName()) == 0) + { // gg should inherit platform vector from parent + cmGlobalVisualStudio8_SDKGenerator* srcgg = static_cast<cmGlobalVisualStudio8_SDKGenerator*>(parentgg); + cmGlobalVisualStudio8_SDKGenerator* targg = static_cast<cmGlobalVisualStudio8_SDKGenerator*>(gg); +// targg->filterSDKs(srcgg->GetPlatforms()); + } + else if(parentggname.compare(cmGlobalVisualStudio9_SDKGenerator::GetActualName()) == 0) + { // gg should inherit platform vector from parent + cmGlobalVisualStudio9_SDKGenerator* srcgg = static_cast<cmGlobalVisualStudio9_SDKGenerator*>(parentgg); + cmGlobalVisualStudio9_SDKGenerator* targg = static_cast<cmGlobalVisualStudio9_SDKGenerator*>(gg); +// targg->filterSDKs(srcgg->GetPlatforms()); + } +#endif + cm.SetGlobalGenerator(gg); // do a configure diff -Nur cmake-2.6.3/Source/cmSDKConfigParser.cxx cmake-2.6.3-p1/Source/cmSDKConfigParser.cxx --- cmake-2.6.3/Source/cmSDKConfigParser.cxx 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmSDKConfigParser.cxx 2009-04-17 11:10:17.765625000 +0200 @@ -0,0 +1,187 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include <iomanip> +#include <sstream> +#include "cmSDKConfigParser.h" +#include "cmake.h" + +cmSDKConfigParser::cmSDKConfigParser(std::string const& basePath) +: m_vsBasePath(basePath) +{ + current_platform_valid = false; +} + +void cmSDKConfigParser::StartElement(const char* name, const char** atts) +{ + if ( strcmp(name, "Platform") == 0 ) + { + PlatformDefs nPlatform; + platformVec.push_back(nPlatform); + current_platform_valid = true; + } + if ( strcmp(name, "Directories") == 0 ) + { + const char* includes = this->FindAttribute(atts, "Include"); + if (includes) + { + platformVec.back().IncludePaths = std::string(includes); + } + const char* libs = this->FindAttribute(atts, "Library"); + if (libs) + { + platformVec.back().LibraryPaths = std::string(libs); + } + } + if ( strcmp(name, "Macro") == 0 ) + { + const char* rev = this->FindAttribute(atts, "Name"); + if (rev) + { + if ( strcmp(rev, "PLATFORMDEFINES") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().PlatformDefines = std::string(rev); + } + else if ( strcmp(rev, "CEVER") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().CEver = std::string(rev); + } + else if ( strcmp(rev, "ARCHFAM") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().Archfam = std::string(rev); + } + else if ( strcmp(rev, "_ARCHFAM_") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().Archfam_ = std::string(rev); + } + else if ( strcmp(rev, "INSTRUCTIONSET") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + platformVec.back().InstructionSet= std::string(rev); + } + } + } + this->CharacterData.clear(); +} + +void cmSDKConfigParser::EndElement(const char* name) +{ + if ( strcmp(name, "PlatformName") == 0 ) + { + platformVec.back().PlatformName = std::string(this->CharacterData.begin(),this->CharacterData.end()); + } + else if ( strcmp(name, "OSMinorVersion") == 0 && current_platform_valid) + { + platformVec.back().MinorVer = atoi(std::string(this->CharacterData.begin(),this->CharacterData.end()).c_str()); + } + else if ( strcmp(name, "OSMajorVersion") == 0 && current_platform_valid) + { + platformVec.back().MajorVer = atoi(std::string(this->CharacterData.begin(),this->CharacterData.end()).c_str()); + } + if ( strcmp(name, "Platform") == 0 ) + { + // done with parsing the platform now we set the compiler path + // that can be used by the generators. + if( platformVec.back().Archfam.find("ARM") != std::string::npos || + platformVec.back().Archfam.find("arm") != std::string::npos) + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/ce/bin/x86_arm/cl.exe"; + } + else if( platformVec.back().Archfam.find("SH") != std::string::npos || + platformVec.back().Archfam.find("sh") != std::string::npos) + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/ce/bin/x86_sh/cl.exe"; + } + else if( platformVec.back().Archfam.find("MIPS") != std::string::npos || + platformVec.back().Archfam.find("mips") != std::string::npos ) + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/ce/bin/x86_mips/cl.exe"; + } + // could be a special x86 wince platform - we have to do more parsing if + // wince gets a 64bit version + else + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/bin/cl.exe"; + } + + std::ostringstream out; + out << platformVec.back().MajorVer << '.' + << std::setw(2)<< std::setfill('0') + << platformVec.back().MinorVer; + platformVec.back().SystemVersion = out.str(); + } + + this->CharacterData.clear(); +} + +void cmSDKConfigParser::CharacterDataHandler(const char* data, int length) +{ + this->CharacterData.insert(this->CharacterData.end(), data, data+length); +} + +const char* cmSDKConfigParser::FindAttribute( const char** atts, const char* attribute ) +{ + if ( !atts || !attribute ) + { + return 0; + } + const char **atr = atts; + while ( *atr && **atr && **(atr+1) ) + { + if ( strcmp(*atr, attribute) == 0 ) + { + return *(atr+1); + } + atr+=2; + } + return 0; +} + + +void cmSDKConfigParser::GetSDKsInstalled(std::string vsVersionString, std::vector<PlatformDefs> & platformSDKs ) +{ + platformSDKs.clear(); + + std::string regkey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\VisualStudio\\"); + regkey += vsVersionString; + regkey += std::string("\\Setup\\VS;"); + + std::string base; + + + if (!cmSystemTools::ReadRegistryValue((regkey+ + std::string("ProductDir")).c_str(), + base)) + { + return; + } + + cmSystemTools::ConvertToUnixSlashes(base); + + // NOW READ THE CONFIG FILE FOR THE SDKs + std::string configFilename = base + std::string("/VC/vcpackages/WCE.VCPlatform.config"); + cmSDKConfigParser parser(base); + if(parser.ParseFile(configFilename.c_str()) == 0) { + return; + } + swap(platformSDKs, parser.getPlatforms()); +} + diff -Nur cmake-2.6.3/Source/cmSDKConfigParser.h cmake-2.6.3-p1/Source/cmSDKConfigParser.h --- cmake-2.6.3/Source/cmSDKConfigParser.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmSDKConfigParser.h 2009-04-17 10:57:54.953125000 +0200 @@ -0,0 +1,63 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmSDKConfigParser_h +#define cmSDKConfigParser_h + +#include "cmXMLParser.h" + +typedef struct { + int MajorVer; + int MinorVer; + std::string PlatformDefines; + std::string SystemVersion; //! CMAKE_SYSTEM_VERSION + std::string CEver; //! == UNDER_CE + std::string Archfam; + std::string Archfam_; + std::string InstructionSet; + std::string PlatformName; + std::string LibraryPaths; + std::string IncludePaths; + std::string Compiler; // cl compiler with absolute path +} PlatformDefs; + + +class cmSDKConfigParser : public cmXMLParser +{ +public: + cmSDKConfigParser(std::string const& vsPath); + + std::vector<PlatformDefs> & getPlatforms() {return platformVec;}; + std::vector<PlatformDefs> const& getPlatforms() const {return platformVec;}; + + /*! + \brief Parses the SDKs installed for the given visual studio version. + \param VSversionString visual studio version, i.e. 8.0 or 9.0 + */ + static void GetSDKsInstalled(std::string VSversionString, std::vector<PlatformDefs> & platformSDKs ); +protected: + void StartElement(const char* name, const char** atts); + void EndElement(const char* name); + void CharacterDataHandler(const char* data, int length); + const char* FindAttribute( const char** atts, const char* attribute ); +private: + std::vector<char> CharacterData; + std::vector<PlatformDefs> platformVec; + bool current_platform_valid; + std::string m_vsBasePath; +}; + +#endif diff -Nur cmake-2.6.3/Source/cmake.cxx cmake-2.6.3-p1/Source/cmake.cxx --- cmake-2.6.3/Source/cmake.cxx 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmake.cxx 2009-04-16 13:09:23.437500000 +0200 @@ -65,6 +65,8 @@ # include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio8Generator.h" # include "cmGlobalVisualStudio9Generator.h" +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" # include "cmGlobalVisualStudio9Win64Generator.h" # include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" @@ -1726,7 +1728,7 @@ } } - generator = (genIt->second)(); + generator = (genIt->second)->Create(); generator->SetCMakeInstance(this); generator->SetExternalMakefileProjectGenerator(extraGenerator); return generator; @@ -2405,33 +2407,52 @@ #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(CMAKE_BOOT_MINGW) this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] = - &cmGlobalVisualStudio6Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio6Generator::New); this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] = - &cmGlobalVisualStudio7Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio7Generator::New); this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = - &cmGlobalVisualStudio71Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio71Generator::New); this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = - &cmGlobalVisualStudio8Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Generator::New); this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = - &cmGlobalVisualStudio9Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Generator::New); + + std::vector<PlatformDefs> vs8Platforms; + cmSDKConfigParser::GetSDKsInstalled("8.0", vs8Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs8Platforms.begin(), + e = vs8Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 8.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio8_SDKGenerator>(*it); + } + + std::vector<PlatformDefs> vs9Platforms; + cmSDKConfigParser::GetSDKsInstalled("9.0", vs9Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs9Platforms.begin(), + e = vs9Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 9.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio9_SDKGenerator>(*it); + } + this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = - &cmGlobalVisualStudio9Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Win64Generator::New); this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = - &cmGlobalVisualStudio8Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Win64Generator::New); this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = - &cmGlobalBorlandMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalBorlandMakefileGenerator::New); this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = - &cmGlobalNMakeMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalNMakeMakefileGenerator::New); this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] = - &cmGlobalWatcomWMakeGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalWatcomWMakeGenerator::New); # endif this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = - &cmGlobalMSYSMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMSYSMakefileGenerator::New); this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] = - &cmGlobalMinGWMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMinGWMakefileGenerator::New); #endif this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] = - &cmGlobalUnixMakefileGenerator3::New; + new cmFunctionGeneratorFactory(&cmGlobalUnixMakefileGenerator3::New); #ifdef CMAKE_USE_XCODE this->Generators[cmGlobalXCodeGenerator::GetActualName()] = &cmGlobalXCodeGenerator::New; @@ -2530,7 +2551,7 @@ i != this->Generators.end(); ++i) { cmDocumentationEntry e; - cmGlobalGenerator* generator = (i->second)(); + cmGlobalGenerator* generator = (i->second)->Create(); generator->GetDocumentation(e); delete generator; v.push_back(e); diff -Nur cmake-2.6.3/Source/cmake.h cmake-2.6.3-p1/Source/cmake.h --- cmake-2.6.3/Source/cmake.h 2009-02-21 21:36:51.000000000 +0100 +++ cmake-2.6.3-p1/Source/cmake.h 2009-04-16 12:31:28.531250000 +0200 @@ -43,6 +43,7 @@ #include "cmSystemTools.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +#include "cmGeneratorFactory.h" class cmGlobalGenerator; class cmLocalGenerator; @@ -56,6 +57,9 @@ class cmPolicies; class cmListFileBacktrace; + + + class cmake { public: @@ -370,9 +374,8 @@ typedef std::map<cmStdString, CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap; - typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); typedef std::map<cmStdString, - CreateGeneratorFunctionType> RegisteredGeneratorsMap; + cmGeneratorFactory*> RegisteredGeneratorsMap; RegisteredCommandsMap Commands; RegisteredGeneratorsMap Generators; RegisteredExtraGeneratorsMap ExtraGenerators; wince-tests.patch [^] (24,444 bytes) 2009-04-18 13:27 [Show Content] [Hide Content] diff -Nur cmake-2.6.3/Tests/CMakeLists.txt cmake-2.6.3-p1/Tests/CMakeLists.txt --- cmake-2.6.3/Tests/CMakeLists.txt 2009-02-21 21:36:55.000000000 +0100 +++ cmake-2.6.3-p1/Tests/CMakeLists.txt 2009-04-14 10:46:41.921875000 +0200 @@ -65,6 +65,19 @@ SET(CMAKE_LONG_TEST_TIMEOUT 1500) ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003/CMakeCache.txt.in" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003/CMakeCache.txt" COPYONLY + ) + ADD_TEST(SimplePPC2003 ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003" + --build-two-config + --build-generator "Visual Studio 9 2008 (with SDK support)" + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project SimplePPC2003) + # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) ADD_TEST_MACRO(FindPackageTest FindPackageTest) @@ -429,6 +442,7 @@ --test-command Tutorial 25.0) ENDFOREACH(STP) + ADD_TEST(testing ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Testing" diff -Nur cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeCache.txt.in --- cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeCache.txt.in 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,5 @@ +//SDK to use +CMAKE_GENERATOR:INTERNAL=Visual Studio 9 2008 (with SDK support) +CMAKE_SYSTEM_NAME:STRING=WINCE +CMAKE_SYSTEM_VERSION:STRING=4.20 +PLATFORM_SDKS:STRING=Pocket PC 2003 (ARMV4) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeLists.txt --- cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/CMakeLists.txt 2009-04-14 10:46:41.921875000 +0200 @@ -0,0 +1,14 @@ +# a simple test case for compiling a PPC 2003 project +PROJECT(SimplePPC2003) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(RESOURCEFILES resourceppc.h SimplePPC2003ppc.rc SimplePPC2003ppc.rc2) +SET(SOURCEFILES SimplePPC2003.cpp stdafx.cpp) +SET(HEADERFILES stdafx.h SimplePPC2003.h) + +ADD_DEFINITIONS(-DWINCE -D$(ARCHFAM) -D$(_ARCHFAM_) -D_UNICODE -DUNICODE -D_USRDLL ) + +ADD_EXECUTABLE(SimplePPC2003 ${RESOURCEFILES} ${SOURCEFILES} ${HEADERFILES}) + +SET_TARGET_PROPERTIES(SimplePPC2003 PROPERTIES LINK_FLAGS /machine:ARM) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake cmake-2.6.3-p1/Tests/SimplePPC2003/GetCompilerVersion.cmake --- cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/GetCompilerVersion.cmake 2009-04-14 10:46:41.859375000 +0200 @@ -0,0 +1,95 @@ + +FIND_PROGRAM(CMAKE_VCVARS + NAMES vcvarsall.bat + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC" + ) + +# Testing the machine type of the generated binaries: +FIND_PROGRAM(CMAKE_TEST_COMPILER + NAMES cl.exe + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + ) + +SET(testNmakeCLVersionFile + "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c") +STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}") + +EXEC_PROGRAM("\"${CMAKE_VCVARS}\" && \"${CMAKE_TEST_COMPILER}\" /nologo -EP \"${testNmakeCLVersionFile}\"" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT + RETURN_VALUE CMAKE_COMPILER_RETURN + ) + +IF(NOT CMAKE_COMPILER_RETURN) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining the version of compiler passed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}") + STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1" + compilerVersion "${compilerVersion}") + MESSAGE(STATUS "Check for CL compiler version - ${compilerVersion}") + SET(MSVC60) + SET(MSVC70) + SET(MSVC71) + SET(MSVC80) + SET(CMAKE_COMPILER_2005) + IF("${compilerVersion}" LESS 1300) + SET(MSVC60 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1) + ENDIF("${compilerVersion}" LESS 1300) + IF("${compilerVersion}" EQUAL 1300) + SET(MSVC70 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1300) + IF("${compilerVersion}" EQUAL 1310) + SET(MSVC71 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1310) + IF("${compilerVersion}" EQUAL 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" EQUAL 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" EQUAL 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" EQUAL 1500) + IF("${compilerVersion}" GREATER 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" GREATER 1500) + SET(MSVC_VERSION "${compilerVersion}") +ELSE(NOT CMAKE_COMPILER_RETURN) + MESSAGE(STATUS "Check for CL compiler version - failed") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining the version of compiler failed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") +ENDIF(NOT CMAKE_COMPILER_RETURN) \ No newline at end of file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.cpp --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.cpp 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,259 @@ +// SimplePPC2003.cpp : Defines the entry point for the application. +// + +#include "stdafx.h" +#include "SimplePPC2003.h" + + +#define MAX_LOADSTRING 100 + +// Global Variables: +HINSTANCE g_hInst; // current instance +HWND g_hWndMenuBar; // menu bar handle + +// Forward declarations of functions included in this code module: +ATOM MyRegisterClass(HINSTANCE, LPTSTR); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); + +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + MSG msg; + + // Perform application initialization: + if (!InitInstance(hInstance, nCmdShow)) + { + return FALSE; + } + + HACCEL hAccelTable; + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SIMPLEPPC2003)); + + // Main message loop: + while (GetMessage(&msg, NULL, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + +// +// FUNCTION: MyRegisterClass() +// +// PURPOSE: Registers the window class. +// +// COMMENTS: +// +ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) +{ + WNDCLASS wc; + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SIMPLEPPC2003)); + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = 0; + wc.lpszClassName = szWindowClass; + + return RegisterClass(&wc); +} + +// +// FUNCTION: InitInstance(HINSTANCE, int) +// +// PURPOSE: Saves instance handle and creates main window +// +// COMMENTS: +// +// In this function, we save the instance handle in a global variable and +// create and display the main program window. +// +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + HWND hWnd; + TCHAR szTitle[MAX_LOADSTRING]; // title bar text + TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name + + g_hInst = hInstance; // Store instance handle in our global variable + + // SHInitExtraControls should be called once during your application's initialization to initialize any + // of the device specific controls such as CAPEDIT and SIPPREF. + SHInitExtraControls(); + + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDC_SIMPLEPPC2003, szWindowClass, MAX_LOADSTRING); + + //If it is already running, then focus on the window, and exit + hWnd = FindWindow(szWindowClass, szTitle); + if (hWnd) + { + // set focus to foremost child window + // The "| 0x00000001" is used to bring any owned windows to the foreground and + // activate them. + SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); + return 0; + } + + if (!MyRegisterClass(hInstance, szWindowClass)) + { + return FALSE; + } + + hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); + + if (!hWnd) + { + return FALSE; + } + + // When the main window is created using CW_USEDEFAULT the height of the menubar (if one + // is created is not taken into account). So we resize the window after creating it + // if a menubar is present + if (g_hWndMenuBar) + { + RECT rc; + RECT rcMenuBar; + + GetWindowRect(hWnd, &rc); + GetWindowRect(g_hWndMenuBar, &rcMenuBar); + rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top); + + MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE); + } + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + + return TRUE; +} + +// +// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) +// +// PURPOSE: Processes messages for the main window. +// +// WM_COMMAND - process the application menu +// WM_PAINT - Paint the main window +// WM_DESTROY - post a quit message and return +// +// +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + PAINTSTRUCT ps; + HDC hdc; + + static SHACTIVATEINFO s_sai; + + switch (message) + { + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + // Parse the menu selections: + switch (wmId) + { + case IDM_HELP_ABOUT: + DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, About); + break; + case IDM_OK: + SendMessage (hWnd, WM_CLOSE, 0, 0); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + case WM_CREATE: + SHMENUBARINFO mbi; + + memset(&mbi, 0, sizeof(SHMENUBARINFO)); + mbi.cbSize = sizeof(SHMENUBARINFO); + mbi.hwndParent = hWnd; + mbi.nToolBarId = IDR_MENU; + mbi.hInstRes = g_hInst; + + if (!SHCreateMenuBar(&mbi)) + { + g_hWndMenuBar = NULL; + } + else + { + g_hWndMenuBar = mbi.hwndMB; + } + + // Initialize the shell activate info structure + memset(&s_sai, 0, sizeof (s_sai)); + s_sai.cbSize = sizeof (s_sai); + break; + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + + // TODO: Add any drawing code here... + + EndPaint(hWnd, &ps); + break; + case WM_DESTROY: + CommandBar_Destroy(g_hWndMenuBar); + PostQuitMessage(0); + break; + + case WM_ACTIVATE: + // Notify shell of our activate message + SHHandleWMActivate(hWnd, wParam, lParam, &s_sai, FALSE); + break; + case WM_SETTINGCHANGE: + SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai); + break; + + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +// Message handler for about box. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + { + // Create a Done button and size it. + SHINITDLGINFO shidi; + shidi.dwMask = SHIDIM_FLAGS; + shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_EMPTYMENU; + shidi.hDlg = hDlg; + SHInitDialog(&shidi); + } + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + break; + + case WM_CLOSE: + EndDialog(hDlg, message); + return TRUE; + + } + return (INT_PTR)FALSE; +} diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.h --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003.h 2009-04-14 10:46:41.890625000 +0200 @@ -0,0 +1,2 @@ +#pragma once +#include "resourceppc.h" diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,170 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resourceppc.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#include "resdefce.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +//IDI_SIMPLEPPC2003 ICON "SimplePPC2003.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU MENU DISCARDABLE +BEGIN + POPUP "Help" + BEGIN + MENUITEM "About", IDM_HELP_ABOUT + END +END + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_SIMPLEPPC2003 ACCELERATORS +BEGIN + "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT + "Q", IDM_OK, VIRTKEY, CONTROL, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG 0, 0, 156, 129 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,12,36,70,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,12,48,66,8 +END + +IDD_ABOUTBOX_WIDE DIALOG 0, 0, 210, 129 +STYLE WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,48,12,66,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,48,24,66,8 +END + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 149 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END + + IDD_ABOUTBOX_WIDE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END +END +#endif // APSTUDIO_INVOKED + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resourceppc.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#include ""resdefce.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""SimplePPC2003ppc.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// +STRINGTABLE +BEGIN + IDC_SIMPLEPPC2003 "SIMPLEPPC2003" + IDS_APP_TITLE "SimplePPC2003" + IDS_OK "OK" + IDS_HELP "HELP" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "SimplePPC2003ppc.rc2" // non-Microsoft Visual C++ edited resources +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff -Nur cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,35 @@ +// +// SimplePPC2003PPC.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// +HI_RES_AWARE CEUX {1} // turn off the emulation layer + // Remove this resource to enable pixel- + // doubling on platforms that support it +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// +// SHMENUBAR +// + +IDR_MENU SHMENUBAR DISCARDABLE +BEGIN + IDR_MENU, + 2, + + I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, + IDS_OK, 0, NOMENU, + + I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, + IDS_HELP, 0, 0, +END + diff -Nur cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h cmake-2.6.3-p1/Tests/SimplePPC2003/resourceppc.h --- cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/resourceppc.h 2009-04-14 10:46:41.875000000 +0200 @@ -0,0 +1,34 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SimplePPC2003ppc.rc +// + +#define IDS_APP_TITLE 1 +#define IDC_SIMPLEPPC2003 2 +#define IDI_SIMPLEPPC2003 101 +#define IDR_MENU 102 +#define IDS_OK 103 +#define IDS_HELP 104 +#define IDD_ABOUTBOX 105 +#define IDD_ABOUTBOX_WIDE 106 +#define IDC_STATIC_1 201 +#define IDC_STATIC_2 202 +#define IDC_STATIC_3 203 +#define IDM_OK 40000 +#define IDM_HELP 40001 +#define IDM_HELP_ABOUT 40002 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff -Nur cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.cpp --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.cpp 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// SimplePPC2003.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff -Nur cmake-2.6.3/Tests/SimplePPC2003/stdafx.h cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.h --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.h 1970-01-01 01:00:00.000000000 +0100 +++ cmake-2.6.3-p1/Tests/SimplePPC2003/stdafx.h 2009-04-14 10:46:41.875000000 +0200 @@ -0,0 +1,62 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#pragma comment(linker, "/nodefaultlib:libc.lib") +#pragma comment(linker, "/nodefaultlib:libcd.lib") + +// NOTE - this value is not strongly correlated to the Windows CE OS version being targeted +#define WINVER _WIN32_WCE + +#include <ceconfig.h> +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#define SHELL_AYGSHELL +#endif + +#ifdef _CE_DCOM +#define _ATL_APARTMENT_THREADED +#endif + +#include <windows.h> +#include <commctrl.h> + +#include <aygshell.h> +#pragma comment(lib, "aygshell.lib") + + +// Windows Header Files: +#include <windows.h> + +// C RunTime Header Files +#include <stdlib.h> +#include <malloc.h> +#include <memory.h> +#include <tchar.h> + +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#ifndef _DEVICE_RESOLUTION_AWARE +#define _DEVICE_RESOLUTION_AWARE +#endif +#endif + +#ifdef _DEVICE_RESOLUTION_AWARE +#include "DeviceResolutionAware.h" +#endif + +#if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) ) + #pragma comment(lib, "ccrtrtti.lib") + #ifdef _X86_ + #if defined(_DEBUG) + #pragma comment(lib, "libcmtx86d.lib") + #else + #pragma comment(lib, "libcmtx86.lib") + #endif + #endif +#endif + +#include <altcecrt.h> + +// TODO: reference additional headers your program requires here devenv-before-VCExpress-2.patch [^] (2,804 bytes) 2009-04-28 09:23 [Show Content] [Hide Content] diff -wNuprt --tabsize=2 cmake-2.6.3/Modules/CMakeVS8FindMake.cmake current_patch_version/patched_cmake_src/Modules/CMakeVS8FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS8FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/CMakeVS8FindMake.cmake 2009-04-23 10:41:45.078125000 +0200 @@ -1,15 +1,15 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path] - "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio 8/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio8/Common7/IDE" - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE" "/Program Files/Microsoft Visual Studio 8/Common7/IDE/" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC80 1) diff -wNuprt --tabsize=2 cmake-2.6.3/Modules/CMakeVS9FindMake.cmake current_patch_version/patched_cmake_src/Modules/CMakeVS9FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS9FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/CMakeVS9FindMake.cmake 2009-04-23 10:41:45.031250000 +0200 @@ -1,15 +1,17 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv + NAMES devenv VCExpress PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path] - "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio9.0/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio 9/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio9/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9.0/Common7/IDE" + "/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/Common7/IDE" - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/Common7/IDE" - "/Program Files/Microsoft Visual Studio 9/Common7/IDE/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC90 1) wince-cmakefiles-support-2.patch [^] (13,399 bytes) 2009-04-28 09:23 [Show Content] [Hide Content] diff -wNuprt --tabsize=2 cmake-2.6.3/Modules/CMakeTestCLMachineType.c current_patch_version/patched_cmake_src/Modules/CMakeTestCLMachineType.c --- cmake-2.6.3/Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/CMakeTestCLMachineType.c 2009-04-23 10:36:35.468750000 +0200 @@ -0,0 +1 @@ +int dummy() { return 0;} diff -wNuprt --tabsize=2 cmake-2.6.3/Modules/Platform/WinCE-cl.cmake current_patch_version/patched_cmake_src/Modules/Platform/WinCE-cl.cmake --- cmake-2.6.3/Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/Platform/WinCE-cl.cmake 2009-04-23 10:36:28.093750000 +0200 @@ -0,0 +1,38 @@ + +SET(WIN32 1) +SET(WINCE 1) + + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + +# OLDNAMES.lib is not available for WinCE +SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO /NODEFAULTLIB:\"oldnames.lib\"") + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + # We deactivate Manifest creation + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO") + SET (CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO") + SET (CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} /MANIFEST:NO") +ENDIF(MSVC_VERSION GREATER 1310) + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWSCE,${CMAKE_SYSTEM_VERSION}") +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/SUBSYSTEM:WINDOWSCE,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWSCE") + SET(CMAKE_CREATE_CONSOLE_EXE "/SUBSYSTEMY:WINDOWSCE /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff -wNuprt --tabsize=2 cmake-2.6.3/Modules/Platform/WinCE.cmake current_patch_version/patched_cmake_src/Modules/Platform/WinCE.cmake --- cmake-2.6.3/Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/Platform/WinCE.cmake 2009-04-23 10:36:30.218750000 +0200 @@ -0,0 +1,30 @@ +SET(WINCE 1) + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "$(CEVER)") + ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + diff -wNuprt --tabsize=2 cmake-2.6.3/Modules/Platform/Windows-cl.cmake current_patch_version/patched_cmake_src/Modules/Platform/Windows-cl.cmake --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake 2009-02-21 21:36:51.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/Platform/Windows-cl.cmake 2009-04-23 10:36:29.406250000 +0200 @@ -41,6 +41,7 @@ SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> / # that is automatically copied into try_compile directories # by the global generator. SET(MSVC_IDE 1) + IF(CMAKE_GENERATOR MATCHES "Makefiles") SET(MSVC_IDE 0) IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) @@ -49,6 +50,8 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c") STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}") MESSAGE(STATUS "Check for CL compiler version") + + SET(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER}) IF (NOT CMAKE_C_COMPILER) SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER}) @@ -137,38 +140,116 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) + ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + +# Testing the machine type of the generated binaries: +IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) + + ## IF CMAKE_CL_MACHINE_TYPE has been set in the toolchain file, we do not look for dumpbin + IF(NOT CMAKE_CL_MACHINE_TYPE) + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9.0/VC/bin" + "/Program Files/Microsoft Visual Studio 9.0/VC/bin/" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + GET_FILENAME_COMPONENT(CL_PATH ${CMAKE_C_COMPILER} PATH) + GET_FILENAME_COMPONENT(MAKE_PATH ${CMAKE_MAKE_PROGRAM} PATH) + GET_FILENAME_COMPONENT(DUMPBIN_PATH ${CMAKE_DUMPBIN} PATH) + SET(ENV{PATH} "${MAKE_PATH};${CL_PATH};${DUMPBIN_PATH};$ENV{PATH}") + + # We compile a trivial source file and run dumpbin on the object file + # the headers section should contain the machine type that the selected cl + # produces. + + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) - ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + MESSAGE(Status "You can override the setting by clearing the build path and setting CMAKE_CL_MACHINE_TYPE") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + ENDIF(NOT CMAKE_CL_MACHINE_TYPE) + +## TODO add further dumpbin machine to visual studio machine type conversion here, +## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + ## If everything above failed, we default to i386 + IF(NOT CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_CL_MACHINE_TYPE "i386") + ENDIF(NOT CMAKE_CL_MACHINE_TYPE) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) + MESSAGE(STATUS "CL platform was forced to:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(CMAKE_FORCE_WIN64) + ## CMAKE_CL_64 is set for compatibility reasons + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x64) + SET(CMAKE_CL_64 1) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x64) + +ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) + # default to Debug builds IF(MSVC_VERSION GREATER 1310) # for 2005 make sure the manifest is put in the dll with mt @@ -228,14 +309,21 @@ SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "$ # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + + +SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MACHINE:${CMAKE_CL_MACHINE_TYPE}") + + # append /ARMPADCODE +IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE") +ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it diff -wNuprt --tabsize=2 cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in current_patch_version/patched_cmake_src/Modules/Platform/Windows-cl.cmake.in --- cmake-2.6.3/Modules/Platform/Windows-cl.cmake.in 2009-02-21 21:36:51.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/Platform/Windows-cl.cmake.in 2009-04-23 10:36:29.046875000 +0200 @@ -3,6 +3,7 @@ SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMA SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) SET(CMAKE_CL_64 @CMAKE_CL_64@) +SET(CMAKE_CL_MACHINE_TYPE @CMAKE_CL_MACHINE_TYPE@) SET(MSVC60 @MSVC60@) SET(MSVC70 @MSVC70@) SET(MSVC71 @MSVC71@) generator-factory.patch [^] (6,681 bytes) 2009-04-28 09:24 [Show Content] [Hide Content] diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGeneratorFactory.h current_patch_version/patched_cmake_src/Source/cmGeneratorFactory.h --- cmake-2.6.3/Source/cmGeneratorFactory.h 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGeneratorFactory.h 2009-04-23 10:42:07.218750000 +0200 @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGeneratorFactory_h +#define cmGeneratorFactory_h + + +class cmGlobalGenerator; + +/*! + * \brief Factory interface for global generators + * + * \note if we had a functor type like boost.function + binders we could + * avoid that. + */ +class cmGeneratorFactory +{ +public: + virtual cmGlobalGenerator* Create() = 0; + virtual ~cmGeneratorFactory() {}; + +}; + +/*! + * \brief Default Factory for Global Generators, requires only + * a simple factory function. + */ +class cmFunctionGeneratorFactory : public cmGeneratorFactory +{ +public: + typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); + + cmFunctionGeneratorFactory( CreateGeneratorFunctionType Fun ) + : fun(Fun) + { + } + + virtual cmGlobalGenerator* Create() + { + return fun(); + } +private: + CreateGeneratorFunctionType fun; +}; + + +#endif + diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmake.cxx current_patch_version/patched_cmake_src/Source/cmake.cxx --- cmake-2.6.3/Source/cmake.cxx 2009-02-21 21:36:51.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmake.cxx 2009-04-23 10:42:16.906250000 +0200 @@ -1726,7 +1726,7 @@ cmGlobalGenerator* cmake::CreateGlobalGe } } - generator = (genIt->second)(); + generator = (genIt->second)->Create(); generator->SetCMakeInstance(this); generator->SetExternalMakefileProjectGenerator(extraGenerator); return generator; @@ -2405,33 +2405,33 @@ void cmake::AddDefaultGenerators() #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(CMAKE_BOOT_MINGW) this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] = - &cmGlobalVisualStudio6Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio6Generator::New); this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] = - &cmGlobalVisualStudio7Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio7Generator::New); this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = - &cmGlobalVisualStudio71Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio71Generator::New); this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = - &cmGlobalVisualStudio8Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Generator::New); this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = - &cmGlobalVisualStudio9Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Generator::New); this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = - &cmGlobalVisualStudio9Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Win64Generator::New); this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = - &cmGlobalVisualStudio8Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Win64Generator::New); this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = - &cmGlobalBorlandMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalBorlandMakefileGenerator::New); this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = - &cmGlobalNMakeMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalNMakeMakefileGenerator::New); this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] = - &cmGlobalWatcomWMakeGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalWatcomWMakeGenerator::New); # endif this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = - &cmGlobalMSYSMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMSYSMakefileGenerator::New); this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] = - &cmGlobalMinGWMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMinGWMakefileGenerator::New); #endif this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] = - &cmGlobalUnixMakefileGenerator3::New; + new cmFunctionGeneratorFactory(&cmGlobalUnixMakefileGenerator3::New); #ifdef CMAKE_USE_XCODE this->Generators[cmGlobalXCodeGenerator::GetActualName()] = &cmGlobalXCodeGenerator::New; @@ -2530,7 +2530,7 @@ void cmake::GetGeneratorDocumentation(st i != this->Generators.end(); ++i) { cmDocumentationEntry e; - cmGlobalGenerator* generator = (i->second)(); + cmGlobalGenerator* generator = (i->second)->Create(); generator->GetDocumentation(e); delete generator; v.push_back(e); diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmake.h current_patch_version/patched_cmake_src/Source/cmake.h --- cmake-2.6.3/Source/cmake.h 2009-02-21 21:36:51.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmake.h 2009-04-23 10:42:16.859375000 +0200 @@ -43,6 +43,7 @@ #include "cmSystemTools.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +#include "cmGeneratorFactory.h" class cmGlobalGenerator; class cmLocalGenerator; @@ -56,6 +57,9 @@ class cmDocumentationSection; class cmPolicies; class cmListFileBacktrace; + + + class cmake { public: @@ -370,9 +374,8 @@ protected: typedef std::map<cmStdString, CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap; - typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); typedef std::map<cmStdString, - CreateGeneratorFunctionType> RegisteredGeneratorsMap; + cmGeneratorFactory*> RegisteredGeneratorsMap; RegisteredCommandsMap Commands; RegisteredGeneratorsMap Generators; RegisteredExtraGeneratorsMap ExtraGenerators; wince-generators-2.patch [^] (66,632 bytes) 2009-04-28 09:24 [Show Content] [Hide Content] diff -wNuprt --tabsize=2 cmake-2.6.3/Source/CMakeLists.txt current_patch_version/patched_cmake_src/Source/CMakeLists.txt --- cmake-2.6.3/Source/CMakeLists.txt 2009-02-21 21:36:51.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/CMakeLists.txt 2009-04-23 10:42:16.796875000 +0200 @@ -250,6 +250,8 @@ IF (WIN32) IF(NOT UNIX) SET(SRCS ${SRCS} + cmSDKConfigParser.cxx + cmSDKConfigParser.h cmGlobalBorlandMakefileGenerator.cxx cmGlobalBorlandMakefileGenerator.h cmGlobalMSYSMakefileGenerator.cxx @@ -264,8 +266,12 @@ IF (WIN32) cmGlobalVisualStudio7Generator.h cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio8Generator.h + cmGlobalVisualStudio8_SDKGenerator.cxx + cmGlobalVisualStudio8_SDKGenerator.h cmGlobalVisualStudio9Generator.cxx cmGlobalVisualStudio9Generator.h + cmGlobalVisualStudio9_SDKGenerator.cxx + cmGlobalVisualStudio9_SDKGenerator.h cmGlobalVisualStudio8Win64Generator.cxx cmGlobalVisualStudio8Win64Generator.h cmGlobalVisualStudio9Win64Generator.cxx diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio71Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio71Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio71Generator.cxx 2009-04-23 10:44:48.187500000 +0200 @@ -34,6 +34,7 @@ cmLocalGenerator *cmGlobalVisualStudio71 cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion71(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio7Generator.cxx 2009-04-23 10:44:48.125000000 +0200 @@ -139,6 +139,7 @@ cmLocalGenerator *cmGlobalVisualStudio7G { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -663,7 +664,12 @@ void cmGlobalVisualStudio7Generator::Cre std::vector<std::string> *cmGlobalVisualStudio7Generator::GetConfigurations() { return &this->Configurations; -}; +} + +PlatformDefs const& cmGlobalVisualStudio7Generator::GetPlatformDef() const +{ + return m_platform; +} //---------------------------------------------------------------------------- void cmGlobalVisualStudio7Generator diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio7Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio7Generator.h 2009-04-23 10:44:48.046875000 +0200 @@ -18,6 +18,7 @@ #define cmGlobalVisualStudio7Generator_h #include "cmGlobalVisualStudioGenerator.h" +#include "cmSDKConfigParser.h" class cmTarget; struct cmVS7FlagTable; @@ -81,6 +82,12 @@ public: */ std::vector<std::string> *GetConfigurations(); + /** + * Get the platform definition + */ + virtual PlatformDefs const& GetPlatformDef() const; + + ///! Create a GUID or get an existing one. void CreateGUID(const char* name); std::string GetGUID(const char* name); @@ -160,8 +167,12 @@ protected: // Set during OutputSLNFile with the name of the current project. // There is one SLN file per project. std::string CurrentProject; + + //! Platform definitions, uninitialized when not used with a WinCE SDK + PlatformDefs m_platform; }; #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK" #endif + diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8Generator.cxx 2009-04-23 10:44:47.953125000 +0200 @@ -36,6 +36,7 @@ cmLocalGenerator *cmGlobalVisualStudio8G cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -341,6 +342,10 @@ static cmVS7FlagTable cmVS8ExtraFlagTabl cmVS7FlagTable::UserValueRequired}, // There is no YX option in the VS8 IDE. + // WHY WAS THIS REMOVED FROM VS7 to VS8? + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + // Exception handling mode. If no entries match, it will be FALSE. {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8Generator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8Generator.h 2009-02-21 21:36:52.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8Generator.h 2009-04-23 10:44:47.921875000 +0200 @@ -67,7 +67,7 @@ protected: virtual bool VSLinksDependencies() const { return false; } - static cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); virtual void AddPlatformDefinitions(cmMakefile* mf); virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators); diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8Win64Generator.cxx 2009-04-23 10:44:47.890625000 +0200 @@ -34,6 +34,7 @@ cmLocalGenerator *cmGlobalVisualStudio8W lg->SetVersion8(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8_SDKGenerator.cxx 2009-04-24 09:30:26.187500000 +0200 @@ -0,0 +1,282 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" +#include "cmGeneratedFileStream.h" + + +cmGlobalVisualStudio8_SDKGenerator::cmGlobalVisualStudio8_SDKGenerator( + PlatformDefs const& platform + ) +: m_platformName("Mobile Platform"), + m_actualGeneratorName("Visual Studio 8.0 " + platform.PlatformName) +{ + m_platform = platform; + FindMakeProgramFile = "CMakeVS8FindMake.cmake"; + ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio8_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(m_platformName.c_str()); + lg->SetVersion8(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = + "Generates Visual Studio .NET 2005 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::AddPlatformDefinitions( + cmMakefile* mf + ) +{ + mf->AddDefinition("MSVC80", "1"); + mf->AddCacheDefinition("CMAKE_C_COMPILER",m_platform.Compiler.c_str(), + "C Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_CXX_COMPILER",m_platform.Compiler.c_str(), + "C++ Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_NAME","WinCE", + "Operating System",cmCacheManager::STRING,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_VERSION", + m_platform.SystemVersion.c_str(),"CE Version", + cmCacheManager::STRING,true); + + if(!m_platform.Archfam.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam).c_str()); + + // this one should never be empty + if(!m_platform.Archfam_.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam_).c_str()); + + if(!m_platform.InstructionSet.empty()) + mf->AddDefineFlag(("-D"+m_platform.InstructionSet).c_str()); + + // can be empty + if(!m_platform.PlatformDefines.empty()) + mf->AddDefineFlag(("-D"+m_platform.PlatformDefines).c_str()); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::Configure() +{ + this->cmGlobalVisualStudio7Generator::Configure(); + this->CreateGUID(CMAKE_CHECK_BUILD_SYSTEM_TARGET); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteSLNFile( + std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators) +{ + // Make all targets depend on their respective project's build + // system check target. + unsigned int i; + for(i = 0; i < generators.size(); ++i) + { + if(this->IsExcluded(root, generators[i])) + { + continue; + } + cmMakefile* mf = generators[i]->GetMakefile(); + cmTargets& tgts = mf->GetTargets(); + for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + { + if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + for(unsigned int j = 0; j < generators.size(); ++j) + { + // Every target in all generators should depend on this target. + cmMakefile* lmf = generators[j]->GetMakefile(); + cmTargets &atgts = lmf->GetTargets(); + for(cmTargets::iterator al = atgts.begin(); al != atgts.end(); ++al) + { + al->second.AddUtility(l->first.c_str()); + } + } + } + } + } + + // Now write the solution file. + this->cmGlobalVisualStudio71Generator::WriteSLNFile(fout, root, generators); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteSolutionConfigurations( + std::ostream& fout + ) +{ + fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"; + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t" << *i << "|" << m_platform.PlatformName + << " = " << *i << "|" << m_platform.PlatformName << "\n"; + } + fout << "\tEndGlobalSection\n"; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteProjectConfigurations( + std::ostream& fout, const char* name, + bool partOfDefaultBuild) +{ + std::string guid = this->GetGUID(name); + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".ActiveCfg = " + << *i << "|" << m_platform.PlatformName << "\n"; + if(partOfDefaultBuild) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".Build.0 = " + << *i << "|" << m_platform.PlatformName << "\n"; + } + } +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraFlagTable[] = +{ + {"CallingConvention", "Gd", "cdecl", "0", 0 }, + {"CallingConvention", "Gr", "fastcall", "1", 0 }, + {"CallingConvention", "Gz", "stdcall", "2", 0 }, + + {"StringPooling", "GF", "Enable Stringpooling", "true", 0 }, + + {"Detect64BitPortabilityProblems", "Wp64", + "Detect 64Bit Portability Problems", "true", 0 }, + {"ErrorReporting", "errorReport:prompt", "Report immediately", "1", 0 }, + {"ErrorReporting", "errorReport:queue", "Queue for next login", "2", 0 }, + // Precompiled header and related options. Note that the + // UsePrecompiledHeader entries are marked as "Continue" so that the + // corresponding PrecompiledHeaderThrough entry can be found. + {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "2", + cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, + {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "", + cmVS7FlagTable::UserValueRequired}, + // There is no YX option in the VS8 IDE. + + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + + // Exception handling mode. If no entries match, it will be FALSE. + {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, + + // Compile for special architecture + {"CompileForArchitecture", "QRarch4", + "ARM4 without Thumb instructions", "0", 0}, + {"CompileForArchitecture", "QRarch5", + "ARM5 without Thumb instructions", "1", 0}, + {"CompileForArchitecture", "QRarch4t", + "ARM4 with Thumb instructions", "2", 0}, + {"CompileForArchitecture", "QRarch5t", + "ARM5 with Thumb instructions", "3", 0}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* +cmGlobalVisualStudio8_SDKGenerator::GetExtraFlagTableVS8() +{ + return cmVS8SDKExtraFlagTable; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraLinkFlagTable[] = +{ + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + // Subsystems have an optional version number, but vcproj xml has no + // attribute to store that value, so a subsystem with version number + // will be treated as "additional" option then. + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", + "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:POSIX", + "Posix application output", "8", 0}, //THIS IS ONLY AVAILABLE ON VC 8 + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "9", 0 }, + + {"EntryPointSymbol", "ENTRY:", + "Entry Point Symbol","", cmVS7FlagTable::UserValue}, + // Stack size to reserve + {"StackReserveSize", "STACK:", + "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* +cmGlobalVisualStudio8_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS8SDKExtraLinkFlagTable; +} diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio8_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio8_SDKGenerator.h 2009-04-23 10:44:48.000000000 +0200 @@ -0,0 +1,83 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio8_SDKGenerator_h +#define cmGlobalVisualStudio8_SDKGenerator_h + +#include "cmGlobalVisualStudio8Generator.h" +#include "cmGeneratorFactory.h" + +template<typename Generator> +class cmSDKGeneratorFactory : public cmGeneratorFactory +{ +public: + cmSDKGeneratorFactory(PlatformDefs const& platform) + : m_platform(platform) + {} + + cmGlobalGenerator * Create() { + return new Generator(m_platform); + } +private: + PlatformDefs m_platform; +}; + +/** + * \brief Creates Visual Studio 8 project files based on a platform + * SDK description + * + */ +class cmGlobalVisualStudio8_SDKGenerator : + public cmGlobalVisualStudio8Generator +{ +public: + cmGlobalVisualStudio8_SDKGenerator(PlatformDefs const& platform); + + ///! Get the name for the generator. + virtual const char* GetName() const { + return m_actualGeneratorName.c_str();} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! Create a local generator appropriate to this Global Generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Override Configure and Generate to add the build-system check + * target. + */ + virtual void Configure(); + +protected: + + virtual bool VSLinksDependencies() const { return false; } + + virtual cmVS7FlagTable const* GetExtraFlagTableVS8(); + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); + virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, + std::vector<cmLocalGenerator*>& generators); + virtual void WriteSolutionConfigurations(std::ostream& fout); + virtual void WriteProjectConfigurations(std::ostream& fout, + const char* name, + bool partOfDefaultBuild); + virtual void AddPlatformDefinitions(cmMakefile* mf); + + std::string m_platformName; + std::string m_actualGeneratorName; +}; +#endif + diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio9Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio9Generator.cxx 2009-04-23 10:44:47.812500000 +0200 @@ -46,6 +46,7 @@ cmLocalGenerator *cmGlobalVisualStudio9G cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio9Win64Generator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-02-21 21:36:52.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio9Win64Generator.cxx 2009-04-23 10:44:47.703125000 +0200 @@ -31,6 +31,7 @@ cmLocalGenerator *cmGlobalVisualStudio9W lg->SetVersion9(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio9_SDKGenerator.cxx --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio9_SDKGenerator.cxx 2009-04-24 09:30:26.234375000 +0200 @@ -0,0 +1,199 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.6 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio9_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio9_SDKGenerator::cmGlobalVisualStudio9_SDKGenerator( + PlatformDefs const& platform + ) +: cmGlobalVisualStudio8_SDKGenerator(platform) +{ + this->FindMakeProgramFile = "CMakeVS9FindMake.cmake"; + this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->PlatformName = "Mobile Platform"; + m_actualGeneratorName = "Visual Studio 9.0 " + m_platform.PlatformName; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::AddPlatformDefinitions( + cmMakefile* mf + ) +{ + mf->AddDefinition("MSVC90", "1"); + mf->AddCacheDefinition("CMAKE_C_COMPILER",m_platform.Compiler.c_str(), + "C Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_CXX_COMPILER",m_platform.Compiler.c_str(), + "C++ Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_NAME","WinCE","Operating System", + cmCacheManager::STRING,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_VERSION", + m_platform.SystemVersion.c_str(), + "CE Version",cmCacheManager::STRING,true); + + if(!m_platform.Archfam.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam).c_str()); + + // this one should never be empty + if(!m_platform.Archfam_.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam_).c_str()); + + if(!m_platform.InstructionSet.empty()) + mf->AddDefineFlag(("-D"+m_platform.InstructionSet).c_str()); + + // can be empty + if(!m_platform.PlatformDefines.empty()) + mf->AddDefineFlag(("-D"+m_platform.PlatformDefines).c_str()); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n"; + fout << "# Visual Studio 2008\n"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio9_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetVersion9(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = + "Generates Visual Studio 9 2008 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::EnableLanguage( + std::vector<std::string>const & lang, + cmMakefile *mf, bool optional) +{ + cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosDirectory() +{ + std::string base; + std::string path; + + // base begins with the VisualStudioProjectsLocation reg value... + if (cmSystemTools::ReadRegistryValue( + "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;" + "VisualStudioProjectsLocation", + base)) + { + cmSystemTools::ConvertToUnixSlashes(base); + + // 9.0 macros folder: + path = base + "/VSMacros80"; + // *NOT* a typo; right now in Visual Studio 2008 beta the macros + // folder is VSMacros80... They may change it to 90 before final + // release of 2008 or they may not... we'll have to keep our eyes + // on it + } + + // path is (correctly) still empty if we did not read the base value from + // the Registry value + return path; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosRegKeyBase() +{ + return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros"; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS9SDKExtraLinkFlagTable[] = +{ + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + // Subsystems have an optional version number, but vcproj xml has no + // attribute to store that value, so a subsystem with version number + // will be treated as "additional" option then. + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", + "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "8", 0}, + + {"EntryPointSymbol", "ENTRY:", + "Entry Point Symbol","", cmVS7FlagTable::UserValue}, + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", + "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio9_SDKGenerator +::GetExtraLinkFlagTableVS8() +{ + return cmVS9SDKExtraLinkFlagTable; +} diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio9_SDKGenerator.h --- cmake-2.6.3/Source/cmGlobalVisualStudio9_SDKGenerator.h 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmGlobalVisualStudio9_SDKGenerator.h 2009-04-23 10:44:47.843750000 +0200 @@ -0,0 +1,68 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.4 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio9_SDKGenerator_h +#define cmGlobalVisualStudio9_SDKGenerator_h + +#include "cmGlobalVisualStudio8_SDKGenerator.h" + + +/** + * \brief Generates Visual Studio 9 projects based on a + * select Platform. + * + */ +class cmGlobalVisualStudio9_SDKGenerator : + public cmGlobalVisualStudio8_SDKGenerator +{ +public: + cmGlobalVisualStudio9_SDKGenerator(PlatformDefs const& platformDefs ); + + virtual void AddPlatformDefinitions(cmMakefile* mf); + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! create the correct local generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Try to determine system infomation such as shared library + * extension, pthreads, byte order etc. + */ + virtual void EnableLanguage(std::vector<std::string>const& languages, + cmMakefile *, bool optional); + + virtual void WriteSLNHeader(std::ostream& fout); + + /** + * Where does this version of Visual Studio look for macros for the + * current user? Returns the empty string if this version of Visual + * Studio does not implement support for VB macros. + */ + virtual std::string GetUserMacrosDirectory(); + + /** + * What is the reg key path to "vsmacros" for this version of Visual + * Studio? + */ + virtual std::string GetUserMacrosRegKeyBase(); + +protected: + virtual cmVS7FlagTable const* GetExtraLinkFlagTableVS8(); +}; +#endif + diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx current_patch_version/patched_cmake_src/Source/cmLocalVisualStudio7Generator.cxx --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.cxx 2009-02-21 21:36:53.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmLocalVisualStudio7Generator.cxx 2009-04-24 09:30:26.234375000 +0200 @@ -327,7 +327,8 @@ cmVS7FlagTable cmLocalVisualStudio7Gener {"OptimizeForProcessor", "QxP", "", "codeExclusivelyCodeNamedPrescott", 0}, {"OptimizeForProcessor", "QxT", "", "codeExclusivelyCore2Duo", 0}, {"OptimizeForProcessor", "QxO", "", "codeExclusivelyCore2StreamingSIMD", 0}, - {"OptimizeForProcessor", "QxS", "", "codeExclusivelyCore2StreamingSIMD4", 0}, + {"OptimizeForProcessor", "QxS", "", + "codeExclusivelyCore2StreamingSIMD4", 0}, {"ModulePath", "module:", "", "", cmVS7FlagTable::UserValueRequired}, @@ -421,7 +422,8 @@ cmVS7FlagTable cmLocalVisualStudio7Gener // boolean flags {"BufferSecurityCheck", "GS", "Buffer security check", "TRUE", 0}, - {"BufferSecurityCheck", "GS-", "Turn off Buffer security check", "FALSE", 0}, + {"BufferSecurityCheck", "GS-", + "Turn off Buffer security check", "FALSE", 0}, {"Detect64BitPortabilityProblems", "Wp64", "Detect 64-bit Portability Problems", "TRUE", 0}, {"EnableFiberSafeOptimizations", "GT", "Enable Fiber-safe Optimizations", @@ -536,19 +538,23 @@ private: bool& flag_handled); }; -void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, +void cmLocalVisualStudio7Generator::WritePlatformConfiguration( + std::ostream& fout, const char* configName, const char *libName, + const char *platformName, cmTarget &target) { - const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); + const char* mfcFlag = Makefile->GetDefinition("CMAKE_MFC_FLAG"); if(!mfcFlag) { mfcFlag = "0"; } + fout << "\t\t<Configuration\n" - << "\t\t\tName=\"" << configName << "|" << this->PlatformName << "\"\n" + << "\t\t\tName=\"" << configName << "|" << platformName << "\"\n" << "\t\t\tOutputDirectory=\"" << configName << "\"\n"; + // This is an internal type to Visual Studio, it seems that: // 4 == static library // 2 == dll @@ -815,10 +821,34 @@ void cmLocalVisualStudio7Generator::Writ } this->OutputTargetRules(fout, configName, target, libName); - this->OutputBuildTool(fout, configName, target, targetOptions.IsDebug()); + this->OutputBuildTool(fout, configName, platformName, + target, targetOptions.IsDebug()); fout << "\t\t</Configuration>\n"; } +void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, + const char *configName, + const char *libName, + cmTarget &target) +{ + if(PlatformName == "Mobile Platform") + { + cmGlobalVisualStudio7Generator *gg = + static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); + WritePlatformConfiguration( + fout,configName,libName, + gg->GetPlatformDef().PlatformName.c_str(), + target); + } + else + { + WritePlatformConfiguration( + fout,configName,libName, + PlatformName.c_str(), + target); + } +} + //---------------------------------------------------------------------------- std::string cmLocalVisualStudio7Generator @@ -837,6 +867,7 @@ cmLocalVisualStudio7Generator void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, const char* configName, + const char* platformName, cmTarget &target, bool isDebug) { @@ -879,7 +910,9 @@ void cmLocalVisualStudio7Generator::Outp extraLinkOptions += " "; extraLinkOptions += targetLinkFlags; } - Options linkOptions(this, this->Version, Options::Linker); + Options linkOptions(this, this->Version, + Options::Linker, + this->ExtraLinkFlagTable); linkOptions.Parse(extraLinkOptions.c_str()); switch(target.GetType()) { @@ -936,7 +969,7 @@ void cmLocalVisualStudio7Generator::Outp } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; - linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) " @@ -944,9 +977,19 @@ void cmLocalVisualStudio7Generator::Outp << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; - temp = target.GetDirectory(configName); - temp += "/"; - temp += targetNameFull; + + if(strcmp(platformName,"Win32") != 0 && strcmp(platformName,"x64") != 0) + { + // TODO: Comment why this is required! + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + + // dlls in Windows CE also need /SUBSYSTEM:WINDOWSCE set + // linkOptions.Parse("/SUBSYSTEM:WINDOWSCE"); + } + linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); + temp = target.GetDirectory(configName) + "/" + targetNameFull; fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; this->WriteTargetVersionAttribute(fout, target); @@ -955,6 +998,7 @@ void cmLocalVisualStudio7Generator::Outp this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; this->OutputModuleDefinitionFile(fout, target); + temp = target.GetDirectory(configName); temp += "/"; temp += targetNamePDB; @@ -972,6 +1016,7 @@ void cmLocalVisualStudio7Generator::Outp { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n"; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1009,6 +1054,28 @@ void cmLocalVisualStudio7Generator::Outp } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; + + if(strcmp(platformName,"Win32") != 0 && strcmp(platformName,"x64") != 0) + { + // Here we set the subsystem and the entry point + char const* pSubSystem = NULL; + if ( ! target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + pSubSystem = Makefile->GetDefinition("CMAKE_CREATE_CONSOLE_EXE"); + } + else + { + pSubSystem = Makefile->GetDefinition("CMAKE_CREATE_WIN32_EXE"); + } + + linkOptions.Parse(pSubSystem); + + // TODO: Comment why this is required! + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + } + linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. @@ -1017,6 +1084,7 @@ void cmLocalVisualStudio7Generator::Outp << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; + temp = target.GetDirectory(configName); temp += "/"; temp += targetNameFull; @@ -1030,10 +1098,14 @@ void cmLocalVisualStudio7Generator::Outp fout << "\t\t\t\tProgramDataBaseFile=\"" << target.GetDirectory(configName) << "/" << targetNamePDB << "\"\n"; + if(isDebug) { fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; } + if(strcmp(platformName,"Win32") == 0 || + strcmp(platformName,"x64") == 0) + { if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) { fout << "\t\t\t\tSubSystem=\"2\"\n"; @@ -1042,6 +1114,7 @@ void cmLocalVisualStudio7Generator::Outp { fout << "\t\t\t\tSubSystem=\"1\"\n"; } + } std::string stackVar = "CMAKE_"; stackVar += linkLanguage; stackVar += "_STACK_SIZE"; @@ -1050,6 +1123,7 @@ void cmLocalVisualStudio7Generator::Outp { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\""; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1201,7 +1275,6 @@ void cmLocalVisualStudio7Generator::Writ this->WriteGroup(&sg, target, fout, libName, configs); } - //} fout << "\t</Files>\n"; @@ -1379,6 +1452,9 @@ void cmLocalVisualStudio7Generator dir_max += config_max; dir_max += "/"; + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + // Loop through each source in the source group. std::string objectName; for(std::vector<const cmSourceFile *>::const_iterator sf = @@ -1432,6 +1508,50 @@ void cmLocalVisualStudio7Generator fci = fcinfo.FileConfigMap.begin(); fci != fcinfo.FileConfigMap.end(); ++fci) { + if(PlatformName == "Mobile Platform") + { + PlatformDefs const& pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fci->second; + fout << "\t\t\t\t<FileConfiguration\n" + << "\t\t\t\t\tName=\"" << fci->first + << "|" << pldef.PlatformName << "\""; + if(fc.ExcludedFromBuild) + { + fout << " ExcludedFromBuild=\"true\""; + } + fout << ">\n"; + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n"; + if(!fc.CompileFlags.empty() || + !fc.CompileDefs.empty() || + !fc.CompileDefsConfig.empty()) + { + Options fileOptions(this, this->Version, Options::Compiler, + this->ExtraFlagTable); + fileOptions.Parse(fc.CompileFlags.c_str()); + fileOptions.AddDefines(fc.CompileDefs.c_str()); + fileOptions.AddDefines(fc.CompileDefsConfig.c_str()); + fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n"); + fileOptions.OutputFlagMap(fout, "\t\t\t\t\t"); + fileOptions.OutputPreprocessorDefinitions(fout, + "\t\t\t\t\t", "\n"); + } + if(!fc.AdditionalDeps.empty()) + { + fout << "\t\t\t\t\tAdditionalDependencies=\"" + << fc.AdditionalDeps.c_str() << "\"\n"; + } + if(!fc.ObjectName.empty()) + { + fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" + << fc.ObjectName.c_str() << "\"\n"; + } + fout << "\t\t\t\t\t/>\n" + << "\t\t\t\t</FileConfiguration>\n"; + + } + else + { cmLVS7GFileConfig const& fc = fci->second; fout << "\t\t\t\t<FileConfiguration\n" << "\t\t\t\t\tName=\"" << fci->first @@ -1471,6 +1591,7 @@ void cmLocalVisualStudio7Generator << "\t\t\t\t</FileConfiguration>\n"; } } + } fout << "\t\t\t</File>\n"; } } @@ -1499,9 +1620,9 @@ WriteCustomRule(std::ostream& fout, // Write the rule for each configuration. std::vector<std::string>::iterator i; - std::vector<std::string> *configs = - static_cast<cmGlobalVisualStudio7Generator *> - (this->GlobalGenerator)->GetConfigurations(); + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + std::vector<std::string> *configs = gg->GetConfigurations(); const char* compileTool = "VCCLCompilerTool"; if(this->FortranProject) { @@ -1514,9 +1635,86 @@ WriteCustomRule(std::ostream& fout, } for(i = configs->begin(); i != configs->end(); ++i) { + if( PlatformName == "Mobile Platform") + { + PlatformDefs const &pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; + fout << "\t\t\t\t<FileConfiguration\n"; + fout << "\t\t\t\t\tName=\"" << *i << "|" + << pldef.PlatformName << "\">\n"; + if(!fc.CompileFlags.empty()) + { + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << compileTool << "\"\n" + << "\t\t\t\t\tAdditionalOptions=\"" + << this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n"; + } + + std::string script = + this->ConstructScript(command.GetCommandLines(), + command.GetWorkingDirectory(), + i->c_str(), + command.GetEscapeOldStyle(), + command.GetEscapeAllowMakeVars()); + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << customTool << "\"\n" + << "\t\t\t\t\tDescription=\"" + << this->EscapeForXML(comment.c_str()) << "\"\n" + << "\t\t\t\t\tCommandLine=\"" + << this->EscapeForXML(script.c_str()) << "\"\n" + << "\t\t\t\t\tAdditionalDependencies=\""; + if(command.GetDepends().empty()) + { + // There are no real dependencies. Produce an artificial one to + // make sure the rule runs reliably. + if(!cmSystemTools::FileExists(source)) + { + std::ofstream depout(source); + depout << "Artificial dependency for a custom command.\n"; + } + fout << this->ConvertToXMLOutputPath(source); + } + else + { + // Write out the dependencies for the rule. + for(std::vector<std::string>::const_iterator d = + command.GetDepends().begin(); + d != command.GetDepends().end(); + ++d) + { + // Get the real name of the dependency in case it is a CMake target. + std::string dep = this->GetRealDependency(d->c_str(), i->c_str()); + fout << this->ConvertToXMLOutputPath(dep.c_str()) + << ";"; + } + } + fout << "\"\n"; + fout << "\t\t\t\t\tOutputs=\""; + if(command.GetOutputs().empty()) + { + fout << source << "_force"; + } + else + { + // Write a rule for the output generated by this command. + const char* sep = ""; + for(std::vector<std::string>::const_iterator o = + command.GetOutputs().begin(); + o != command.GetOutputs().end(); + ++o) + { + fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str()); + sep = ";"; + } + } + fout << "\"/>\n"; + fout << "\t\t\t\t</FileConfiguration>\n"; + } + else + { cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; fout << "\t\t\t\t<FileConfiguration\n"; - fout << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n"; + fout << "\t\t\t\t\tName=\"" << *i << "|" << PlatformName << "\">\n"; if(!fc.CompileFlags.empty()) { fout << "\t\t\t\t\t<Tool\n" @@ -1586,6 +1784,7 @@ WriteCustomRule(std::ostream& fout, fout << "\t\t\t\t</FileConfiguration>\n"; } } +} void cmLocalVisualStudio7Generator::WriteVCProjBeginGroup(std::ostream& fout, @@ -1789,13 +1988,18 @@ cmLocalVisualStudio7Generator } if(projectType) { - fout << "\tProjectType=\"" << projectType << "\"\n"; + fout << "\tProjectType=\"" << projectType << "\">\n"; } fout<< "\tKeyword=\"" << keyword << "\">\n" << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if(PlatformName == "Mobile Platform") + fout << "\t\t<Platform\n\t\t\tName=\"" + << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } @@ -1835,7 +2039,8 @@ cmLocalVisualStudio7Generator::WriteProj const char* vsLocalpath = target.GetProperty("VS_SCC_LOCALPATH"); const char* vsProvider = target.GetProperty("VS_SCC_PROVIDER"); cmGlobalVisualStudio7Generator* gg = - static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + static_cast<cmGlobalVisualStudio7Generator *>(GlobalGenerator); + fout << "\tName=\"" << projLabel << "\"\n"; if(this->Version >= 8) { @@ -1850,9 +2055,14 @@ cmLocalVisualStudio7Generator::WriteProj << "\tSccProvider=\"" << vsProvider << "\"\n"; } fout << "\tKeyword=\"" << keyword << "\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if(PlatformName == "Mobile Platform") + fout << "\t\t<Platform\n\t\t\tName=\"" + << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } @@ -2001,7 +2211,6 @@ void cmLocalVisualStudio7Generator::Conf gg->CreateGUID(l->first.c_str()); } } - } //---------------------------------------------------------------------------- diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h current_patch_version/patched_cmake_src/Source/cmLocalVisualStudio7Generator.h --- cmake-2.6.3/Source/cmLocalVisualStudio7Generator.h 2009-02-21 21:36:53.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmLocalVisualStudio7Generator.h 2009-04-23 10:44:44.328125000 +0200 @@ -68,6 +68,8 @@ public: void SetExtraFlagTable(cmVS7FlagTable const* table) { this->ExtraFlagTable = table; } + void SetExtraLinkFlagTable(cmVS7FlagTable const* table) + { this->ExtraLinkFlagTable = table; } private: typedef cmLocalVisualStudio7GeneratorOptions Options; typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; @@ -85,6 +87,11 @@ private: void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); cmSourceFile* CreateVCProjBuildRule(); + void WritePlatformConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + const char *platformName, + cmTarget &target); void WriteConfigurations(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfiguration(std::ostream& fout, @@ -96,7 +103,7 @@ private: void OutputTargetRules(std::ostream& fout, const char* configName, cmTarget &target, const char *libName); void OutputBuildTool(std::ostream& fout, const char* configName, - cmTarget& t, bool debug); + const char* platformName, cmTarget& t, bool debug); void OutputLibraryDirectories(std::ostream& fout, std::vector<std::string> const& dirs); void OutputModuleDefinitionFile(std::ostream& fout, cmTarget &target); @@ -124,6 +131,7 @@ private: friend class cmLocalVisualStudio7GeneratorInternals; cmVS7FlagTable const* ExtraFlagTable; + cmVS7FlagTable const* ExtraLinkFlagTable; std::string ModuleDefinitionFile; int Version; bool FortranProject; diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmMakefile.cxx current_patch_version/patched_cmake_src/Source/cmMakefile.cxx --- cmake-2.6.3/Source/cmMakefile.cxx 2009-02-21 21:36:53.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmMakefile.cxx 2009-04-24 09:22:11.453125000 +0200 @@ -2750,6 +2750,8 @@ int cmMakefile::TryCompile(const char *s cmSystemTools::ChangeDirectory(cwd.c_str()); return 1; } + + cm.SetGlobalGenerator(gg); // do a configure diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmSDKConfigParser.cxx current_patch_version/patched_cmake_src/Source/cmSDKConfigParser.cxx --- cmake-2.6.3/Source/cmSDKConfigParser.cxx 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmSDKConfigParser.cxx 2009-04-28 14:56:47.171875000 +0200 @@ -0,0 +1,205 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include <iomanip> +#include <sstream> +#include "cmSDKConfigParser.h" +#include "cmake.h" + +cmSDKConfigParser::cmSDKConfigParser(std::string const& basePath) +: m_vsBasePath(basePath) +{ + current_platform_valid = false; +} + +void cmSDKConfigParser::StartElement(const char* name, const char** atts) +{ + if ( strcmp(name, "Platform") == 0 ) + { + PlatformDefs nPlatform; + platformVec.push_back(nPlatform); + current_platform_valid = true; + } + if ( strcmp(name, "Directories") == 0 ) + { + const char* includes = this->FindAttribute(atts, "Include"); + if (includes) + { + platformVec.back().IncludePaths = std::string(includes); + } + const char* libs = this->FindAttribute(atts, "Library"); + if (libs) + { + platformVec.back().LibraryPaths = std::string(libs); + } + } + if ( strcmp(name, "Macro") == 0 ) + { + const char* rev = this->FindAttribute(atts, "Name"); + if (rev) + { + if ( strcmp(rev, "PLATFORMDEFINES") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().PlatformDefines = std::string(rev); + } + else if ( strcmp(rev, "CEVER") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().CEver = std::string(rev); + } + else if ( strcmp(rev, "ARCHFAM") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().Archfam = std::string(rev); + } + else if ( strcmp(rev, "_ARCHFAM_") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().Archfam_ = std::string(rev); + } + else if ( strcmp(rev, "INSTRUCTIONSET") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().InstructionSet= std::string(rev); + } + } + } + this->CharacterData.clear(); +} + +void cmSDKConfigParser::EndElement(const char* name) +{ + if ( strcmp(name, "PlatformName") == 0 ) + { + platformVec.back().PlatformName = + std::string(this->CharacterData.begin(),this->CharacterData.end()); + } + else if ( strcmp(name, "OSMinorVersion") == 0 && current_platform_valid) + { + platformVec.back().MinorVer = + atoi(std::string( + this->CharacterData.begin(), + this->CharacterData.end() + ).c_str()); + } + else if ( strcmp(name, "OSMajorVersion") == 0 && current_platform_valid) + { + platformVec.back().MajorVer = + atoi(std::string( + this->CharacterData.begin(),this->CharacterData.end() + ).c_str()); + } + if ( strcmp(name, "Platform") == 0 ) + { + // done with parsing the platform now we set the compiler path + // that can be used by the generators. + if( platformVec.back().Archfam.find("ARM") != std::string::npos || + platformVec.back().Archfam.find("arm") != std::string::npos) + { + platformVec.back().Compiler = + this->m_vsBasePath+"/VC/ce/bin/x86_arm/cl.exe"; + } + else if( platformVec.back().Archfam.find("SH") != std::string::npos || + platformVec.back().Archfam.find("sh") != std::string::npos) + { + platformVec.back().Compiler = + this->m_vsBasePath+"/VC/ce/bin/x86_sh/cl.exe"; + } + else if( platformVec.back().Archfam.find("MIPS") != std::string::npos || + platformVec.back().Archfam.find("mips") != std::string::npos ) + { + platformVec.back().Compiler = + this->m_vsBasePath+"/VC/ce/bin/x86_mips/cl.exe"; + } + // could be a special x86 wince platform - we have to do more parsing if + // wince gets a 64bit version + else + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/bin/cl.exe"; + } + + std::ostringstream out; + out << platformVec.back().MajorVer << '.' + << std::setw(2)<< std::setfill('0') + << platformVec.back().MinorVer; + platformVec.back().SystemVersion = out.str(); + } + + this->CharacterData.clear(); +} + +void cmSDKConfigParser::CharacterDataHandler(const char* data, int length) +{ + this->CharacterData.insert(this->CharacterData.end(), data, data+length); +} + +const char* cmSDKConfigParser::FindAttribute( + const char** atts, + const char* attribute ) +{ + if ( !atts || !attribute ) + { + return 0; + } + const char **atr = atts; + while ( *atr && **atr && **(atr+1) ) + { + if ( strcmp(*atr, attribute) == 0 ) + { + return *(atr+1); + } + atr+=2; + } + return 0; +} + + +void cmSDKConfigParser::GetSDKsInstalled( + std::string vsVersionString, + std::vector<PlatformDefs> & platformSDKs ) +{ + platformSDKs.clear(); + + std::string regkey( + "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\VisualStudio\\" + ); + regkey += vsVersionString + "\\Setup\\VS;ProductDir"; + + std::string base; + + if (!cmSystemTools::ReadRegistryValue(regkey.c_str(),base)) + { + return; + } + + cmSystemTools::ConvertToUnixSlashes(base); + + // NOW READ THE CONFIG FILE FOR THE SDKs + std::string configFilename = base + "/VC/vcpackages/WCE.VCPlatform.config"; + cmSDKConfigParser parser(base); + if(parser.ParseFile(configFilename.c_str()) == 0) { + return; + } + swap(platformSDKs, parser.getPlatforms()); +} + diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmSDKConfigParser.h current_patch_version/patched_cmake_src/Source/cmSDKConfigParser.h --- cmake-2.6.3/Source/cmSDKConfigParser.h 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmSDKConfigParser.h 2009-04-28 14:56:47.234375000 +0200 @@ -0,0 +1,72 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmSDKConfigParser_h +#define cmSDKConfigParser_h + +#include "cmXMLParser.h" + +typedef struct { + int MajorVer; + int MinorVer; + std::string PlatformDefines; + std::string SystemVersion; //! CMAKE_SYSTEM_VERSION + std::string CEver; //! == UNDER_CE + std::string Archfam; + std::string Archfam_; + std::string InstructionSet; + std::string PlatformName; + std::string LibraryPaths; + std::string IncludePaths; + std::string Compiler; // cl compiler with absolute path +} PlatformDefs; + + +/*! + * \brief Parser for *.VCPlatform.config xml files. + * + */ +class cmSDKConfigParser : public cmXMLParser +{ +public: + cmSDKConfigParser(std::string const& vsPath); + + std::vector<PlatformDefs> & getPlatforms() {return platformVec;}; + std::vector<PlatformDefs> const& getPlatforms() const {return platformVec;}; + + /*! + \brief Parses the Windows CE SDKs installed for the given visual studio + version. + \param VSversionString visual studio version, i.e. 8.0 or 9.0 + */ + static void GetSDKsInstalled( + std::string VSversionString, + std::vector<PlatformDefs> & platformSDKs + ); +protected: + void StartElement(const char* name, const char** atts); + void EndElement(const char* name); + void CharacterDataHandler(const char* data, int length); + const char* FindAttribute( const char** atts, const char* attribute ); +private: + std::vector<char> CharacterData; + std::vector<PlatformDefs> platformVec; + bool current_platform_valid; + std::string m_vsBasePath; +}; + +#endif + diff -wNuprt --tabsize=2 cmake-2.6.3/Source/cmake.cxx current_patch_version/patched_cmake_src/Source/cmake.cxx --- cmake-2.6.3/Source/cmake.cxx 2009-02-21 21:36:51.000000000 +0100 +++ current_patch_version/patched_cmake_src/Source/cmake.cxx 2009-04-23 10:42:16.906250000 +0200 @@ -65,6 +65,8 @@ # include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio8Generator.h" # include "cmGlobalVisualStudio9Generator.h" +# include "cmGlobalVisualStudio9_SDKGenerator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" # include "cmGlobalVisualStudio9Win64Generator.h" # include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" @@ -2414,6 +2416,25 @@ void cmake::AddDefaultGenerators() new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Generator::New); this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Generator::New); + + std::vector<PlatformDefs> vs8Platforms; + cmSDKConfigParser::GetSDKsInstalled("8.0", vs8Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs8Platforms.begin(), + e = vs8Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 8.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio8_SDKGenerator>(*it); + } + + std::vector<PlatformDefs> vs9Platforms; + cmSDKConfigParser::GetSDKsInstalled("9.0", vs9Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs9Platforms.begin(), + e = vs9Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 9.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio9_SDKGenerator>(*it); + } + this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Win64Generator::New); this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = wince-tests-2.patch [^] (25,375 bytes) 2009-04-28 09:24 [Show Content] [Hide Content] diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/CMakeLists.txt current_patch_version/patched_cmake_src/Tests/CMakeLists.txt --- cmake-2.6.3/Tests/CMakeLists.txt 2009-02-21 21:36:55.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/CMakeLists.txt 2009-04-23 10:43:50.203125000 +0200 @@ -65,6 +65,19 @@ IF(BUILD_TESTING) SET(CMAKE_LONG_TEST_TIMEOUT 1500) ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003/CMakeCache.txt.in" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003/CMakeCache.txt" COPYONLY + ) + ADD_TEST(SimplePPC2003 ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/SimplePPC2003" + "${CMake_BINARY_DIR}/Tests/SimplePPC2003" + --build-two-config + --build-generator "Visual Studio 9 2008 (with SDK support)" + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project SimplePPC2003) + # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) ADD_TEST_MACRO(FindPackageTest FindPackageTest) @@ -429,6 +442,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION= --test-command Tutorial 25.0) ENDFOREACH(STP) + ADD_TEST(testing ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Testing" diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in current_patch_version/patched_cmake_src/Tests/SimplePPC2003/CMakeCache.txt.in --- cmake-2.6.3/Tests/SimplePPC2003/CMakeCache.txt.in 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/CMakeCache.txt.in 2009-04-23 10:43:31.656250000 +0200 @@ -0,0 +1,5 @@ +//SDK to use +CMAKE_GENERATOR:INTERNAL=Visual Studio 9 2008 (with SDK support) +CMAKE_SYSTEM_NAME:STRING=WINCE +CMAKE_SYSTEM_VERSION:STRING=4.20 +PLATFORM_SDKS:STRING=Pocket PC 2003 (ARMV4) \ No newline at end of file diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt current_patch_version/patched_cmake_src/Tests/SimplePPC2003/CMakeLists.txt --- cmake-2.6.3/Tests/SimplePPC2003/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/CMakeLists.txt 2009-04-23 10:43:31.656250000 +0200 @@ -0,0 +1,14 @@ +# a simple test case for compiling a PPC 2003 project +PROJECT(SimplePPC2003) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(RESOURCEFILES resourceppc.h SimplePPC2003ppc.rc SimplePPC2003ppc.rc2) +SET(SOURCEFILES SimplePPC2003.cpp stdafx.cpp) +SET(HEADERFILES stdafx.h SimplePPC2003.h) + +ADD_DEFINITIONS(-DWINCE -D$(ARCHFAM) -D$(_ARCHFAM_) -D_UNICODE -DUNICODE -D_USRDLL ) + +ADD_EXECUTABLE(SimplePPC2003 ${RESOURCEFILES} ${SOURCEFILES} ${HEADERFILES}) + +SET_TARGET_PROPERTIES(SimplePPC2003 PROPERTIES LINK_FLAGS /machine:ARM) \ No newline at end of file diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake current_patch_version/patched_cmake_src/Tests/SimplePPC2003/GetCompilerVersion.cmake --- cmake-2.6.3/Tests/SimplePPC2003/GetCompilerVersion.cmake 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/GetCompilerVersion.cmake 2009-04-23 10:43:31.593750000 +0200 @@ -0,0 +1,95 @@ + +FIND_PROGRAM(CMAKE_VCVARS + NAMES vcvarsall.bat + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC" + ) + +# Testing the machine type of the generated binaries: +FIND_PROGRAM(CMAKE_TEST_COMPILER + NAMES cl.exe + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + ) + +SET(testNmakeCLVersionFile + "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c") +STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}") + +EXEC_PROGRAM("\"${CMAKE_VCVARS}\" && \"${CMAKE_TEST_COMPILER}\" /nologo -EP \"${testNmakeCLVersionFile}\"" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT + RETURN_VALUE CMAKE_COMPILER_RETURN + ) + +IF(NOT CMAKE_COMPILER_RETURN) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining the version of compiler passed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}") + STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1" + compilerVersion "${compilerVersion}") + MESSAGE(STATUS "Check for CL compiler version - ${compilerVersion}") + SET(MSVC60) + SET(MSVC70) + SET(MSVC71) + SET(MSVC80) + SET(CMAKE_COMPILER_2005) + IF("${compilerVersion}" LESS 1300) + SET(MSVC60 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1) + ENDIF("${compilerVersion}" LESS 1300) + IF("${compilerVersion}" EQUAL 1300) + SET(MSVC70 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1300) + IF("${compilerVersion}" EQUAL 1310) + SET(MSVC71 1) + SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) + ENDIF("${compilerVersion}" EQUAL 1310) + IF("${compilerVersion}" EQUAL 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" EQUAL 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" GREATER 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" GREATER 1400) + IF("${compilerVersion}" EQUAL 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" EQUAL 1500) + IF("${compilerVersion}" GREATER 1500) + SET(MSVC90 1) + SET(MSVC80 0) + ENDIF("${compilerVersion}" GREATER 1500) + SET(MSVC_VERSION "${compilerVersion}") +ELSE(NOT CMAKE_COMPILER_RETURN) + MESSAGE(STATUS "Check for CL compiler version - failed") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining the version of compiler failed with the following output:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") +ENDIF(NOT CMAKE_COMPILER_RETURN) \ No newline at end of file diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp current_patch_version/patched_cmake_src/Tests/SimplePPC2003/SimplePPC2003.cpp --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.cpp 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/SimplePPC2003.cpp 2009-04-23 10:43:31.468750000 +0200 @@ -0,0 +1,259 @@ +// SimplePPC2003.cpp : Defines the entry point for the application. +// + +#include "stdafx.h" +#include "SimplePPC2003.h" + + +#define MAX_LOADSTRING 100 + +// Global Variables: +HINSTANCE g_hInst; // current instance +HWND g_hWndMenuBar; // menu bar handle + +// Forward declarations of functions included in this code module: +ATOM MyRegisterClass(HINSTANCE, LPTSTR); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); + +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + MSG msg; + + // Perform application initialization: + if (!InitInstance(hInstance, nCmdShow)) + { + return FALSE; + } + + HACCEL hAccelTable; + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SIMPLEPPC2003)); + + // Main message loop: + while (GetMessage(&msg, NULL, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + +// +// FUNCTION: MyRegisterClass() +// +// PURPOSE: Registers the window class. +// +// COMMENTS: +// +ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) +{ + WNDCLASS wc; + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SIMPLEPPC2003)); + wc.hCursor = 0; + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = 0; + wc.lpszClassName = szWindowClass; + + return RegisterClass(&wc); +} + +// +// FUNCTION: InitInstance(HINSTANCE, int) +// +// PURPOSE: Saves instance handle and creates main window +// +// COMMENTS: +// +// In this function, we save the instance handle in a global variable and +// create and display the main program window. +// +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + HWND hWnd; + TCHAR szTitle[MAX_LOADSTRING]; // title bar text + TCHAR szWindowClass[MAX_LOADSTRING]; // main window class name + + g_hInst = hInstance; // Store instance handle in our global variable + + // SHInitExtraControls should be called once during your application's initialization to initialize any + // of the device specific controls such as CAPEDIT and SIPPREF. + SHInitExtraControls(); + + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDC_SIMPLEPPC2003, szWindowClass, MAX_LOADSTRING); + + //If it is already running, then focus on the window, and exit + hWnd = FindWindow(szWindowClass, szTitle); + if (hWnd) + { + // set focus to foremost child window + // The "| 0x00000001" is used to bring any owned windows to the foreground and + // activate them. + SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); + return 0; + } + + if (!MyRegisterClass(hInstance, szWindowClass)) + { + return FALSE; + } + + hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); + + if (!hWnd) + { + return FALSE; + } + + // When the main window is created using CW_USEDEFAULT the height of the menubar (if one + // is created is not taken into account). So we resize the window after creating it + // if a menubar is present + if (g_hWndMenuBar) + { + RECT rc; + RECT rcMenuBar; + + GetWindowRect(hWnd, &rc); + GetWindowRect(g_hWndMenuBar, &rcMenuBar); + rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top); + + MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE); + } + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + + return TRUE; +} + +// +// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) +// +// PURPOSE: Processes messages for the main window. +// +// WM_COMMAND - process the application menu +// WM_PAINT - Paint the main window +// WM_DESTROY - post a quit message and return +// +// +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + PAINTSTRUCT ps; + HDC hdc; + + static SHACTIVATEINFO s_sai; + + switch (message) + { + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + // Parse the menu selections: + switch (wmId) + { + case IDM_HELP_ABOUT: + DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, About); + break; + case IDM_OK: + SendMessage (hWnd, WM_CLOSE, 0, 0); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + case WM_CREATE: + SHMENUBARINFO mbi; + + memset(&mbi, 0, sizeof(SHMENUBARINFO)); + mbi.cbSize = sizeof(SHMENUBARINFO); + mbi.hwndParent = hWnd; + mbi.nToolBarId = IDR_MENU; + mbi.hInstRes = g_hInst; + + if (!SHCreateMenuBar(&mbi)) + { + g_hWndMenuBar = NULL; + } + else + { + g_hWndMenuBar = mbi.hwndMB; + } + + // Initialize the shell activate info structure + memset(&s_sai, 0, sizeof (s_sai)); + s_sai.cbSize = sizeof (s_sai); + break; + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + + // TODO: Add any drawing code here... + + EndPaint(hWnd, &ps); + break; + case WM_DESTROY: + CommandBar_Destroy(g_hWndMenuBar); + PostQuitMessage(0); + break; + + case WM_ACTIVATE: + // Notify shell of our activate message + SHHandleWMActivate(hWnd, wParam, lParam, &s_sai, FALSE); + break; + case WM_SETTINGCHANGE: + SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai); + break; + + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +// Message handler for about box. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + { + // Create a Done button and size it. + SHINITDLGINFO shidi; + shidi.dwMask = SHIDIM_FLAGS; + shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_EMPTYMENU; + shidi.hDlg = hDlg; + SHInitDialog(&shidi); + } + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + EndDialog(hDlg, LOWORD(wParam)); + return TRUE; + } + break; + + case WM_CLOSE: + EndDialog(hDlg, message); + return TRUE; + + } + return (INT_PTR)FALSE; +} diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h current_patch_version/patched_cmake_src/Tests/SimplePPC2003/SimplePPC2003.h --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003.h 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/SimplePPC2003.h 2009-04-23 10:43:31.421875000 +0200 @@ -0,0 +1,2 @@ +#pragma once +#include "resourceppc.h" diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc current_patch_version/patched_cmake_src/Tests/SimplePPC2003/SimplePPC2003ppc.rc --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/SimplePPC2003ppc.rc 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,170 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resourceppc.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#include "resdefce.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +//IDI_SIMPLEPPC2003 ICON "SimplePPC2003.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU MENU DISCARDABLE +BEGIN + POPUP "Help" + BEGIN + MENUITEM "About", IDM_HELP_ABOUT + END +END + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_SIMPLEPPC2003 ACCELERATORS +BEGIN + "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT + "Q", IDM_OK, VIRTKEY, CONTROL, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG 0, 0, 156, 129 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,12,36,70,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,12,48,66,8 +END + +IDD_ABOUTBOX_WIDE DIALOG 0, 0, 210, 129 +STYLE WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_CAPTIONOKBTN +CAPTION "About SimplePPC2003" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SIMPLEPPC2003,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE + LTEXT "SimplePPC2003 Version 1.0",IDC_STATIC_2,48,12,66,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC_3,48,24,66,8 +END + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 149 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END + + IDD_ABOUTBOX_WIDE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 203 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END +END +#endif // APSTUDIO_INVOKED + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resourceppc.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#include ""resdefce.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""SimplePPC2003ppc.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// +STRINGTABLE +BEGIN + IDC_SIMPLEPPC2003 "SIMPLEPPC2003" + IDS_APP_TITLE "SimplePPC2003" + IDS_OK "OK" + IDS_HELP "HELP" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "SimplePPC2003ppc.rc2" // non-Microsoft Visual C++ edited resources +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 current_patch_version/patched_cmake_src/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 --- cmake-2.6.3/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/SimplePPC2003ppc.rc2 2009-04-14 10:46:41.906250000 +0200 @@ -0,0 +1,35 @@ +// +// SimplePPC2003PPC.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// +HI_RES_AWARE CEUX {1} // turn off the emulation layer + // Remove this resource to enable pixel- + // doubling on platforms that support it +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// +// SHMENUBAR +// + +IDR_MENU SHMENUBAR DISCARDABLE +BEGIN + IDR_MENU, + 2, + + I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, + IDS_OK, 0, NOMENU, + + I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, + IDS_HELP, 0, 0, +END + diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h current_patch_version/patched_cmake_src/Tests/SimplePPC2003/resourceppc.h --- cmake-2.6.3/Tests/SimplePPC2003/resourceppc.h 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/resourceppc.h 2009-04-23 10:43:31.546875000 +0200 @@ -0,0 +1,34 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SimplePPC2003ppc.rc +// + +#define IDS_APP_TITLE 1 +#define IDC_SIMPLEPPC2003 2 +#define IDI_SIMPLEPPC2003 101 +#define IDR_MENU 102 +#define IDS_OK 103 +#define IDS_HELP 104 +#define IDD_ABOUTBOX 105 +#define IDD_ABOUTBOX_WIDE 106 +#define IDC_STATIC_1 201 +#define IDC_STATIC_2 202 +#define IDC_STATIC_3 203 +#define IDM_OK 40000 +#define IDM_HELP 40001 +#define IDM_HELP_ABOUT 40002 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp current_patch_version/patched_cmake_src/Tests/SimplePPC2003/stdafx.cpp --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.cpp 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/stdafx.cpp 2009-04-23 10:43:31.421875000 +0200 @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// SimplePPC2003.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff -wNuprt --tabsize=2 cmake-2.6.3/Tests/SimplePPC2003/stdafx.h current_patch_version/patched_cmake_src/Tests/SimplePPC2003/stdafx.h --- cmake-2.6.3/Tests/SimplePPC2003/stdafx.h 1970-01-01 01:00:00.000000000 +0100 +++ current_patch_version/patched_cmake_src/Tests/SimplePPC2003/stdafx.h 2009-04-23 10:43:31.406250000 +0200 @@ -0,0 +1,62 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#pragma comment(linker, "/nodefaultlib:libc.lib") +#pragma comment(linker, "/nodefaultlib:libcd.lib") + +// NOTE - this value is not strongly correlated to the Windows CE OS version being targeted +#define WINVER _WIN32_WCE + +#include <ceconfig.h> +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#define SHELL_AYGSHELL +#endif + +#ifdef _CE_DCOM +#define _ATL_APARTMENT_THREADED +#endif + +#include <windows.h> +#include <commctrl.h> + +#include <aygshell.h> +#pragma comment(lib, "aygshell.lib") + + +// Windows Header Files: +#include <windows.h> + +// C RunTime Header Files +#include <stdlib.h> +#include <malloc.h> +#include <memory.h> +#include <tchar.h> + +#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) +#ifndef _DEVICE_RESOLUTION_AWARE +#define _DEVICE_RESOLUTION_AWARE +#endif +#endif + +#ifdef _DEVICE_RESOLUTION_AWARE +#include "DeviceResolutionAware.h" +#endif + +#if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) ) + #pragma comment(lib, "ccrtrtti.lib") + #ifdef _X86_ + #if defined(_DEBUG) + #pragma comment(lib, "libcmtx86d.lib") + #else + #pragma comment(lib, "libcmtx86.lib") + #endif + #endif +#endif + +#include <altcecrt.h> + +// TODO: reference additional headers your program requires here devenv-before-VCExpress-3.patch [^] (2,812 bytes) 2009-05-15 12:42 [Show Content] [Hide Content] diff -wNur cmake-2.6.3/Modules/CMakeVS8FindMake.cmake current_patch_version/patched_cmake_src/Modules/CMakeVS8FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS8FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/CMakeVS8FindMake.cmake 2009-05-15 18:42:44.062500000 +0200 @@ -1,15 +1,16 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv - PATHS + NAMES devenv VCExpress + HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path] - "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio 8/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio8/Common7/IDE" - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE" "/Program Files/Microsoft Visual Studio 8/Common7/IDE/" + PATHS + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC80 1) diff -wNur cmake-2.6.3/Modules/CMakeVS9FindMake.cmake current_patch_version/patched_cmake_src/Modules/CMakeVS9FindMake.cmake --- cmake-2.6.3/Modules/CMakeVS9FindMake.cmake 2009-02-21 21:36:50.000000000 +0100 +++ current_patch_version/patched_cmake_src/Modules/CMakeVS9FindMake.cmake 2009-05-15 18:42:17.140625000 +0200 @@ -1,15 +1,18 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES VCExpress devenv - PATHS + NAMES devenv VCExpress + HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path] - "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio9.0/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio 9/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio9/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9.0/Common7/IDE" + "/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/" + PATHS "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/Common7/IDE" - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/Common7/IDE" - "/Program Files/Microsoft Visual Studio 9/Common7/IDE/" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC90 1) devenv.modified_search_order.patch [^] (3,002 bytes) 2009-05-25 18:48 [Show Content] [Hide Content] ? devenv.modified_search_order.patch Index: CMakeVS8FindMake.cmake =================================================================== RCS file: /cvsroot/CMake/CMake/Modules/CMakeVS8FindMake.cmake,v retrieving revision 1.8 diff -b -u -p -r1.8 CMakeVS8FindMake.cmake --- CMakeVS8FindMake.cmake 9 May 2009 12:15:51 -0000 1.8 +++ CMakeVS8FindMake.cmake 25 May 2009 22:47:00 -0000 @@ -7,16 +7,17 @@ ENDIF(NOT CMAKE_CROSSCOMPILING) FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} - PATHS + HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path] - "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio 8/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio8/Common7/IDE" - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE" "/Program Files/Microsoft Visual Studio 8/Common7/IDE/" + PATHS + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC80 1) Index: CMakeVS9FindMake.cmake =================================================================== RCS file: /cvsroot/CMake/CMake/Modules/CMakeVS9FindMake.cmake,v retrieving revision 1.2 diff -b -u -p -r1.2 CMakeVS9FindMake.cmake --- CMakeVS9FindMake.cmake 9 May 2009 12:15:53 -0000 1.2 +++ CMakeVS9FindMake.cmake 25 May 2009 22:47:00 -0000 @@ -7,16 +7,23 @@ ENDIF(NOT CMAKE_CROSSCOMPILING) FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} - PATHS + HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path] - "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio9.0/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio 9/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio9/Common7/IDE" - "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9.0/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/Common7/IDE" + "/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/" "/Program Files/Microsoft Visual Studio 9/Common7/IDE/" + PATHS + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" + ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC90 1) wince-cmakefiles-supprt-3.patch [^] (11,911 bytes) 2009-05-26 17:40 [Show Content] [Hide Content] diff -rbuN Modules/CMakeTestCLMachineType.c Modules-WinCE/CMakeTestCLMachineType.c --- Modules/CMakeTestCLMachineType.c 1970-01-01 01:00:00.000000000 +0100 +++ Modules-WinCE/CMakeTestCLMachineType.c 2009-05-26 23:34:16.000000000 +0200 @@ -0,0 +1 @@ +int dummy() { return 0;} diff -rbuN Modules/Platform/WinCE-cl.cmake Modules-WinCE/Platform/WinCE-cl.cmake --- Modules/Platform/WinCE-cl.cmake 1970-01-01 01:00:00.000000000 +0100 +++ Modules-WinCE/Platform/WinCE-cl.cmake 2009-05-26 23:34:16.000000000 +0200 @@ -0,0 +1,34 @@ + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + +# OLDNAMES.lib is not available for WinCE +SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO /NODEFAULTLIB:\"oldnames.lib\"") + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + # We deactivate Manifest creation + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO") + SET (CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO") + SET (CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} /MANIFEST:NO") +ENDIF(MSVC_VERSION GREATER 1310) + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWSCE,${CMAKE_SYSTEM_VERSION}") +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/SUBSYSTEM:WINDOWSCE,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWSCE") + SET(CMAKE_CREATE_CONSOLE_EXE "/SUBSYSTEMY:WINDOWSCE /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff -rbuN Modules/Platform/WinCE.cmake Modules-WinCE/Platform/WinCE.cmake --- Modules/Platform/WinCE.cmake 1970-01-01 01:00:00.000000000 +0100 +++ Modules-WinCE/Platform/WinCE.cmake 2009-05-26 23:34:16.000000000 +0200 @@ -0,0 +1,26 @@ +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "$(CEVER)") + ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + diff -rbuN Modules/Platform/Windows-cl.cmake Modules-WinCE/Platform/Windows-cl.cmake --- Modules/Platform/Windows-cl.cmake 2009-05-26 23:37:34.000000000 +0200 +++ Modules-WinCE/Platform/Windows-cl.cmake 2009-05-26 23:34:16.000000000 +0200 @@ -137,38 +137,116 @@ MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) + ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + +# Testing the machine type of the generated binaries: +IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) + + ## IF CMAKE_CL_MACHINE_TYPE has been set in the toolchain file, we do not look for dumpbin + IF(NOT CMAKE_CL_MACHINE_TYPE) + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9.0/VC/bin" + "/Program Files/Microsoft Visual Studio 9.0/VC/bin/" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) + + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + GET_FILENAME_COMPONENT(CL_PATH ${CMAKE_C_COMPILER} PATH) + GET_FILENAME_COMPONENT(MAKE_PATH ${CMAKE_MAKE_PROGRAM} PATH) + GET_FILENAME_COMPONENT(DUMPBIN_PATH ${CMAKE_DUMPBIN} PATH) + SET(ENV{PATH} "${MAKE_PATH};${CL_PATH};${DUMPBIN_PATH};$ENV{PATH}") + + # We compile a trivial source file and run dumpbin on the object file + # the headers section should contain the machine type that the selected cl + # produces. + + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) - ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + MESSAGE(Status "You can override the setting by clearing the build path and setting CMAKE_CL_MACHINE_TYPE") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + ENDIF(NOT CMAKE_CL_MACHINE_TYPE) + +## TODO add further dumpbin machine to visual studio machine type conversion here, +## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + ## If everything above failed, we default to i386 + IF(NOT CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_CL_MACHINE_TYPE "i386") + ENDIF(NOT CMAKE_CL_MACHINE_TYPE) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) + MESSAGE(STATUS "CL platform was forced to:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(CMAKE_FORCE_WIN64) + ## CMAKE_CL_64 is set for compatibility reasons + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x64) + SET(CMAKE_CL_64 1) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x64) + +ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) + # default to Debug builds IF(MSVC_VERSION GREATER 1310) # for 2005 make sure the manifest is put in the dll with mt @@ -228,14 +306,21 @@ # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + + +SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MACHINE:${CMAKE_CL_MACHINE_TYPE}") + + # append /ARMPADCODE +IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE") +ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it diff -rbuN Modules/Platform/Windows-cl.cmake.in Modules-WinCE/Platform/Windows-cl.cmake.in --- Modules/Platform/Windows-cl.cmake.in 2009-05-26 23:37:34.000000000 +0200 +++ Modules-WinCE/Platform/Windows-cl.cmake.in 2009-05-26 23:34:16.000000000 +0200 @@ -3,6 +3,7 @@ SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) SET(CMAKE_CL_64 @CMAKE_CL_64@) +SET(CMAKE_CL_MACHINE_TYPE @CMAKE_CL_MACHINE_TYPE@) SET(MSVC60 @MSVC60@) SET(MSVC70 @MSVC70@) SET(MSVC71 @MSVC71@) 0001-applied-adapted-generator-factory.patch.patch [^] (7,057 bytes) 2010-03-09 14:37 [Show Content] [Hide Content] From 206c702fe24de9d04529e1260689daf9ed7ecc61 Mon Sep 17 00:00:00 2001 From: herbst <template.meta.programmer@googlemail.com> Date: Thu, 21 Jan 2010 21:01:30 +0000 Subject: [PATCH 1/3] applied adapted generator-factory.patch --- Source/cmGeneratorFactory.h | 61 +++++++++++++++++++++++++++++++++++++++++++ Source/cmake.cxx | 34 ++++++++++------------- Source/cmake.h | 7 +++- 3 files changed, 81 insertions(+), 21 deletions(-) create mode 100644 Source/cmGeneratorFactory.h diff --git a/Source/cmGeneratorFactory.h b/Source/cmGeneratorFactory.h new file mode 100644 index 0000000..eefd437 --- /dev/null +++ b/Source/cmGeneratorFactory.h @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGeneratorFactory_h +#define cmGeneratorFactory_h + + +class cmGlobalGenerator; + +/*! + * \brief Factory interface for global generators + * + * \note if we had a functor type like boost.function + binders we could + * avoid that. + */ +class cmGeneratorFactory +{ +public: + virtual cmGlobalGenerator* Create() = 0; + virtual ~cmGeneratorFactory() {}; + +}; + +/*! + * \brief Default Factory for Global Generators, requires only + * a simple factory function. + */ +class cmFunctionGeneratorFactory : public cmGeneratorFactory +{ +public: + typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); + + cmFunctionGeneratorFactory( CreateGeneratorFunctionType Fun ) + : fun(Fun) + { + } + + virtual cmGlobalGenerator* Create() + { + return fun(); + } +private: + CreateGeneratorFunctionType fun; +}; + + +#endif + diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 1a85a02..75fd2b2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1754,7 +1754,7 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const char* name) } } - generator = (genIt->second)(); + generator = (genIt->second)->Create(); generator->SetCMakeInstance(this); generator->SetExternalMakefileProjectGenerator(extraGenerator); return generator; @@ -2409,37 +2409,33 @@ void cmake::AddDefaultGenerators() #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(CMAKE_BOOT_MINGW) this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] = - &cmGlobalVisualStudio6Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio6Generator::New); this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] = - &cmGlobalVisualStudio7Generator::New; - this->Generators[cmGlobalVisualStudio10Generator::GetActualName()] = - &cmGlobalVisualStudio10Generator::New; - this->Generators[cmGlobalVisualStudio10Win64Generator::GetActualName()] = - &cmGlobalVisualStudio10Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio7Generator::New); this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = - &cmGlobalVisualStudio71Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio71Generator::New); this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = - &cmGlobalVisualStudio8Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Generator::New); this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = - &cmGlobalVisualStudio9Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Generator::New); this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = - &cmGlobalVisualStudio9Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Win64Generator::New); this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = - &cmGlobalVisualStudio8Win64Generator::New; + new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Win64Generator::New); this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = - &cmGlobalBorlandMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalBorlandMakefileGenerator::New); this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = - &cmGlobalNMakeMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalNMakeMakefileGenerator::New); this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] = - &cmGlobalWatcomWMakeGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalWatcomWMakeGenerator::New); # endif this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = - &cmGlobalMSYSMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMSYSMakefileGenerator::New); this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] = - &cmGlobalMinGWMakefileGenerator::New; + new cmFunctionGeneratorFactory(&cmGlobalMinGWMakefileGenerator::New); #endif this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] = - &cmGlobalUnixMakefileGenerator3::New; + new cmFunctionGeneratorFactory(&cmGlobalUnixMakefileGenerator3::New); #ifdef CMAKE_USE_XCODE this->Generators[cmGlobalXCodeGenerator::GetActualName()] = &cmGlobalXCodeGenerator::New; @@ -2538,7 +2534,7 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v) i != this->Generators.end(); ++i) { cmDocumentationEntry e; - cmGlobalGenerator* generator = (i->second)(); + cmGlobalGenerator* generator = (i->second)->Create(); generator->GetDocumentation(e); delete generator; v.push_back(e); diff --git a/Source/cmake.h b/Source/cmake.h index f983dc2..0dd2b1a 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -38,6 +38,7 @@ #include "cmSystemTools.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +#include "cmGeneratorFactory.h" class cmGlobalGenerator; class cmLocalGenerator; @@ -51,6 +52,9 @@ class cmDocumentationSection; class cmPolicies; class cmListFileBacktrace; + + + class cmake { public: @@ -371,9 +375,8 @@ protected: typedef std::map<cmStdString, CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap; - typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); typedef std::map<cmStdString, - CreateGeneratorFunctionType> RegisteredGeneratorsMap; + cmGeneratorFactory*> RegisteredGeneratorsMap; RegisteredCommandsMap Commands; RegisteredGeneratorsMap Generators; RegisteredExtraGeneratorsMap ExtraGenerators; -- 1.6.5.1.1367.gcd48 0002-applied-wince-generators-2.patch.patch [^] (60,888 bytes) 2010-03-09 14:37 [Show Content] [Hide Content] From 26057e51d7eec5a697508b155b62f97efbf6d7e0 Mon Sep 17 00:00:00 2001 From: herbst <template.meta.programmer@googlemail.com> Date: Thu, 21 Jan 2010 21:01:43 +0000 Subject: [PATCH 2/3] applied wince-generators-2.patch and removed beautifying from the patch --- Source/CMakeLists.txt | 6 + Source/cmGlobalVisualStudio71Generator.cxx | 1 + Source/cmGlobalVisualStudio7Generator.cxx | 6 + Source/cmGlobalVisualStudio7Generator.h | 11 + Source/cmGlobalVisualStudio8Generator.cxx | 5 + Source/cmGlobalVisualStudio8Generator.h | 2 +- Source/cmGlobalVisualStudio8Win64Generator.cxx | 1 + Source/cmGlobalVisualStudio8_SDKGenerator.cxx | 243 ++++++++++++++++++++++++ Source/cmGlobalVisualStudio8_SDKGenerator.h | 81 ++++++++ Source/cmGlobalVisualStudio9Generator.cxx | 1 + Source/cmGlobalVisualStudio9Win64Generator.cxx | 1 + Source/cmGlobalVisualStudio9_SDKGenerator.cxx | 199 +++++++++++++++++++ Source/cmGlobalVisualStudio9_SDKGenerator.h | 68 +++++++ Source/cmLocalVisualStudio7Generator.cxx | 223 ++++++++++++++++++++-- Source/cmLocalVisualStudio7Generator.h | 10 +- Source/cmSDKConfigParser.cxx | 205 ++++++++++++++++++++ Source/cmSDKConfigParser.h | 72 +++++++ Source/cmake.cxx | 21 ++ 18 files changed, 1140 insertions(+), 16 deletions(-) create mode 100644 Source/cmGlobalVisualStudio8_SDKGenerator.cxx create mode 100644 Source/cmGlobalVisualStudio8_SDKGenerator.h create mode 100644 Source/cmGlobalVisualStudio9_SDKGenerator.cxx create mode 100644 Source/cmGlobalVisualStudio9_SDKGenerator.h create mode 100644 Source/cmSDKConfigParser.cxx create mode 100644 Source/cmSDKConfigParser.h diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 9099691..8c59600 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -275,6 +275,8 @@ IF (WIN32) IF(NOT UNIX) SET(SRCS ${SRCS} + cmSDKConfigParser.cxx + cmSDKConfigParser.h cmGlobalBorlandMakefileGenerator.cxx cmGlobalBorlandMakefileGenerator.h cmGlobalMSYSMakefileGenerator.cxx @@ -289,8 +291,12 @@ IF (WIN32) cmGlobalVisualStudio7Generator.h cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio8Generator.h + cmGlobalVisualStudio8_SDKGenerator.cxx + cmGlobalVisualStudio8_SDKGenerator.h cmGlobalVisualStudio9Generator.cxx cmGlobalVisualStudio9Generator.h + cmGlobalVisualStudio9_SDKGenerator.cxx + cmGlobalVisualStudio9_SDKGenerator.h cmGlobalVisualStudio8Win64Generator.cxx cmGlobalVisualStudio8Win64Generator.h cmGlobalVisualStudio9Win64Generator.cxx diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index c7014aa..4c878a1 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -29,6 +29,7 @@ cmLocalGenerator *cmGlobalVisualStudio71Generator::CreateLocalGenerator() cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion71(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index ea9065e..0e6a2b4 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -134,6 +134,7 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetExtraFlagTable(this->GetExtraFlagTableVS7()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -578,6 +579,11 @@ std::vector<std::string> *cmGlobalVisualStudio7Generator::GetConfigurations() return &this->Configurations; }; +PlatformDefs const& cmGlobalVisualStudio7Generator::GetPlatformDef() const +{ + return m_platform; +} + //---------------------------------------------------------------------------- void cmGlobalVisualStudio7Generator ::GetDocumentation(cmDocumentationEntry& entry) const diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 85ba244..133ffe6 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -13,6 +13,7 @@ #define cmGlobalVisualStudio7Generator_h #include "cmGlobalVisualStudioGenerator.h" +#include "cmSDKConfigParser.h" class cmTarget; struct cmIDEFlagTable; @@ -76,6 +77,12 @@ public: */ std::vector<std::string> *GetConfigurations(); + /** + * Get the platform definition + */ + virtual PlatformDefs const& GetPlatformDef() const; + + ///! Create a GUID or get an existing one. void CreateGUID(const char* name); std::string GetGUID(const char* name); @@ -145,8 +152,12 @@ protected: // Set during OutputSLNFile with the name of the current project. // There is one SLN file per project. std::string CurrentProject; + + //! Platform definitions, uninitialized when not used with a WinCE SDK + PlatformDefs m_platform; }; #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK" #endif + diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 8aec865..f6b3f57 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -31,6 +31,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } @@ -323,6 +324,10 @@ static cmVS7FlagTable cmVS8ExtraFlagTable[] = cmVS7FlagTable::UserValueRequired}, // There is no YX option in the VS8 IDE. + // WHY WAS THIS REMOVED FROM VS7 to VS8? + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + // Exception handling mode. If no entries match, it will be FALSE. {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 9d836bd..4b92157 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -71,7 +71,7 @@ protected: void AddCheckTarget(); - static cmIDEFlagTable const* GetExtraFlagTableVS8(); + virtual cmIDEFlagTable const* GetExtraFlagTableVS8(); virtual void AddPlatformDefinitions(cmMakefile* mf); virtual void WriteSLNHeader(std::ostream& fout); virtual void WriteSolutionConfigurations(std::ostream& fout); diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx index aa756d8..659b082 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx @@ -29,6 +29,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Win64Generator::CreateLocalGenerator() lg->SetVersion8(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio8_SDKGenerator.cxx b/Source/cmGlobalVisualStudio8_SDKGenerator.cxx new file mode 100644 index 0000000..6d5648f --- /dev/null +++ b/Source/cmGlobalVisualStudio8_SDKGenerator.cxx @@ -0,0 +1,243 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" +#include "cmGeneratedFileStream.h" + + +cmGlobalVisualStudio8_SDKGenerator::cmGlobalVisualStudio8_SDKGenerator( + PlatformDefs const& platform + ) +: m_platformName("Mobile Platform"), + m_actualGeneratorName("Visual Studio 8.0 " + platform.PlatformName) +{ + m_platform = platform; + FindMakeProgramFile = "CMakeVS8FindMake.cmake"; + ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio8_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(m_platformName.c_str()); + lg->SetVersion8(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = + "Generates Visual Studio .NET 2005 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::AddPlatformDefinitions( + cmMakefile* mf + ) +{ + mf->AddDefinition("MSVC80", "1"); + mf->AddCacheDefinition("CMAKE_C_COMPILER",m_platform.Compiler.c_str(), + "C Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_CXX_COMPILER",m_platform.Compiler.c_str(), + "C++ Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_NAME","WinCE", + "Operating System",cmCacheManager::STRING,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_VERSION", + m_platform.SystemVersion.c_str(),"CE Version", + cmCacheManager::STRING,true); + + if(!m_platform.Archfam.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam).c_str()); + + // this one should never be empty + if(!m_platform.Archfam_.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam_).c_str()); + + if(!m_platform.InstructionSet.empty()) + mf->AddDefineFlag(("-D"+m_platform.InstructionSet).c_str()); + + // can be empty + if(!m_platform.PlatformDefines.empty()) + mf->AddDefineFlag(("-D"+m_platform.PlatformDefines).c_str()); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::Configure() +{ + this->cmGlobalVisualStudio7Generator::Configure(); + this->CreateGUID(CMAKE_CHECK_BUILD_SYSTEM_TARGET); +} + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteSolutionConfigurations( + std::ostream& fout + ) +{ + fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"; + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t" << *i << "|" << m_platform.PlatformName + << " = " << *i << "|" << m_platform.PlatformName << "\n"; + } + fout << "\tEndGlobalSection\n"; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8_SDKGenerator::WriteProjectConfigurations( + std::ostream& fout, const char* name, + bool partOfDefaultBuild) +{ + std::string guid = this->GetGUID(name); + for(std::vector<std::string>::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".ActiveCfg = " + << *i << "|" << m_platform.PlatformName << "\n"; + if(partOfDefaultBuild) + { + fout << "\t\t{" << guid << "}." << *i + << "|" << m_platform.PlatformName << ".Build.0 = " + << *i << "|" << m_platform.PlatformName << "\n"; + } + } +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraFlagTable[] = +{ + {"CallingConvention", "Gd", "cdecl", "0", 0 }, + {"CallingConvention", "Gr", "fastcall", "1", 0 }, + {"CallingConvention", "Gz", "stdcall", "2", 0 }, + + {"Detect64BitPortabilityProblems", "Wp64", + "Detect 64Bit Portability Problems", "true", 0 }, + {"ErrorReporting", "errorReport:prompt", "Report immediately", "1", 0 }, + {"ErrorReporting", "errorReport:queue", "Queue for next login", "2", 0 }, + // Precompiled header and related options. Note that the + // UsePrecompiledHeader entries are marked as "Continue" so that the + // corresponding PrecompiledHeaderThrough entry can be found. + {"UsePrecompiledHeader", "Yu", "Use Precompiled Header", "2", + cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue}, + {"PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "", + cmVS7FlagTable::UserValueRequired}, + // There is no YX option in the VS8 IDE. + + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + {"WholeProgramOptimization", "GL", "WholeProgramOptimization", "TRUE", 0}, + + // Exception handling mode. If no entries match, it will be FALSE. + {"ExceptionHandling", "GX", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, + {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, + + // Compile for special architecture + {"CompileForArchitecture", "QRarch4", + "ARM4 without Thumb instructions", "0", 0}, + {"CompileForArchitecture", "QRarch5", + "ARM5 without Thumb instructions", "1", 0}, + {"CompileForArchitecture", "QRarch4t", + "ARM4 with Thumb instructions", "2", 0}, + {"CompileForArchitecture", "QRarch5t", + "ARM5 with Thumb instructions", "3", 0}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* +cmGlobalVisualStudio8_SDKGenerator::GetExtraFlagTableVS8() +{ + return cmVS8SDKExtraFlagTable; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS8SDKExtraLinkFlagTable[] = +{ + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + // Subsystems have an optional version number, but vcproj xml has no + // attribute to store that value, so a subsystem with version number + // will be treated as "additional" option then. + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", + "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:POSIX", + "Posix application output", "8", 0}, //THIS IS ONLY AVAILABLE ON VC 8 + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "9", 0 }, + + {"EntryPointSymbol", "ENTRY:", + "Entry Point Symbol","", cmVS7FlagTable::UserValue}, + // Stack size to reserve + {"StackReserveSize", "STACK:", + "set the default stack size", "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* +cmGlobalVisualStudio8_SDKGenerator::GetExtraLinkFlagTableVS8() +{ + return cmVS8SDKExtraLinkFlagTable; +} diff --git a/Source/cmGlobalVisualStudio8_SDKGenerator.h b/Source/cmGlobalVisualStudio8_SDKGenerator.h new file mode 100644 index 0000000..7b52b09 --- /dev/null +++ b/Source/cmGlobalVisualStudio8_SDKGenerator.h @@ -0,0 +1,81 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio8_SDKGenerator_h +#define cmGlobalVisualStudio8_SDKGenerator_h + +#include "cmGlobalVisualStudio8Generator.h" +#include "cmGeneratorFactory.h" + +template<typename Generator> +class cmSDKGeneratorFactory : public cmGeneratorFactory +{ +public: + cmSDKGeneratorFactory(PlatformDefs const& platform) + : m_platform(platform) + {} + + cmGlobalGenerator * Create() { + return new Generator(m_platform); + } +private: + PlatformDefs m_platform; +}; + +/** + * \brief Creates Visual Studio 8 project files based on a platform + * SDK description + * + */ +class cmGlobalVisualStudio8_SDKGenerator : + public cmGlobalVisualStudio8Generator +{ +public: + cmGlobalVisualStudio8_SDKGenerator(PlatformDefs const& platform); + + ///! Get the name for the generator. + virtual const char* GetName() const { + return m_actualGeneratorName.c_str();} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! Create a local generator appropriate to this Global Generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Override Configure and Generate to add the build-system check + * target. + */ + virtual void Configure(); + +protected: + + virtual bool VSLinksDependencies() const { return false; } + + virtual cmIDEFlagTable const* GetExtraFlagTableVS8(); + virtual cmIDEFlagTable const* GetExtraLinkFlagTableVS8(); + virtual void WriteSolutionConfigurations(std::ostream& fout); + virtual void WriteProjectConfigurations(std::ostream& fout, + const char* name, + bool partOfDefaultBuild); + virtual void AddPlatformDefinitions(cmMakefile* mf); + + std::string m_platformName; + std::string m_actualGeneratorName; +}; +#endif + diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 75fe900..ac503ba 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -41,6 +41,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator() cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx index 288480f..9f1f1dd 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio9Win64Generator.cxx @@ -26,6 +26,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Win64Generator::CreateLocalGenerator() lg->SetVersion9(); lg->SetPlatformName(this->PlatformName.c_str()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(0); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio9_SDKGenerator.cxx b/Source/cmGlobalVisualStudio9_SDKGenerator.cxx new file mode 100644 index 0000000..c9f1ce6 --- /dev/null +++ b/Source/cmGlobalVisualStudio9_SDKGenerator.cxx @@ -0,0 +1,199 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.6 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio9_SDKGenerator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio9_SDKGenerator::cmGlobalVisualStudio9_SDKGenerator( + PlatformDefs const& platform + ) +: cmGlobalVisualStudio8_SDKGenerator(platform) +{ + this->FindMakeProgramFile = "CMakeVS9FindMake.cmake"; + this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->PlatformName = "Mobile Platform"; + m_actualGeneratorName = "Visual Studio 9.0 " + m_platform.PlatformName; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::AddPlatformDefinitions( + cmMakefile* mf + ) +{ + mf->AddDefinition("MSVC90", "1"); + mf->AddCacheDefinition("CMAKE_C_COMPILER",m_platform.Compiler.c_str(), + "C Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_CXX_COMPILER",m_platform.Compiler.c_str(), + "C++ Compiler",cmCacheManager::FILEPATH,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_NAME","WinCE","Operating System", + cmCacheManager::STRING,true); + mf->AddCacheDefinition("CMAKE_SYSTEM_VERSION", + m_platform.SystemVersion.c_str(), + "CE Version",cmCacheManager::STRING,true); + + if(!m_platform.Archfam.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam).c_str()); + + // this one should never be empty + if(!m_platform.Archfam_.empty()) + mf->AddDefineFlag(("-D"+m_platform.Archfam_).c_str()); + + if(!m_platform.InstructionSet.empty()) + mf->AddDefineFlag(("-D"+m_platform.InstructionSet).c_str()); + + // can be empty + if(!m_platform.PlatformDefines.empty()) + mf->AddDefineFlag(("-D"+m_platform.PlatformDefines).c_str()); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n"; + fout << "# Visual Studio 2008\n"; +} + +//---------------------------------------------------------------------------- +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio9_SDKGenerator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetVersion9(); + lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); + lg->SetExtraLinkFlagTable(this->GetExtraLinkFlagTableVS8()); + lg->SetGlobalGenerator(this); + return lg; +} + + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = + "Generates Visual Studio 9 2008 project files with SDK support."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio9_SDKGenerator::EnableLanguage( + std::vector<std::string>const & lang, + cmMakefile *mf, bool optional) +{ + cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosDirectory() +{ + std::string base; + std::string path; + + // base begins with the VisualStudioProjectsLocation reg value... + if (cmSystemTools::ReadRegistryValue( + "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;" + "VisualStudioProjectsLocation", + base)) + { + cmSystemTools::ConvertToUnixSlashes(base); + + // 9.0 macros folder: + path = base + "/VSMacros80"; + // *NOT* a typo; right now in Visual Studio 2008 beta the macros + // folder is VSMacros80... They may change it to 90 before final + // release of 2008 or they may not... we'll have to keep our eyes + // on it + } + + // path is (correctly) still empty if we did not read the base value from + // the Registry value + return path; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio9_SDKGenerator::GetUserMacrosRegKeyBase() +{ + return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros"; +} + +//---------------------------------------------------------------------------- +static cmVS7FlagTable cmVS9SDKExtraLinkFlagTable[] = +{ + // Optimization + {"OptimizeReferences", "OPT:NOREF", "ReferenceOptimization off", "1", 0}, + {"OptimizeReferences", "OPT:REF", "ReferenceOptimization on", "2", 0}, + {"EnableCOMDATFolding", "OPT:NOICF", "COMDATFolding off", "1", 0}, + {"EnableCOMDATFolding", "OPT:ICF", "COMDATFolding on", "2", 0}, + + // Link Time Code Generation (this is also in LinkFlagTable!?) + {"LinkTimeCodeGeneration", "LTCG", "LinkTimeCodeGeneration", "1", 0}, + + // Link for special target machine + {"TargetMachine", "MACHINE:X86", "X86 compatible", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "AM33 compatible", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "ARM compatible", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "EBC compatible", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "IA64 compatible", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "M32R compatible", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "MIPS compatible", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "MIPS16 compatible", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU", "MIPSFPU compatible", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "MIPSFPU16 compatible", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "MIPSR41XX compatible", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "SH3 compatible", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "SH3DSP compatible", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "SH4 compatible", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "SH5 compatible", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "THUMB compatible", "16", 0}, + {"TargetMachine", "MACHINE:X64", "X64 compatible", "17", 0}, + + // Subsystem to link for + // Subsystems have an optional version number, but vcproj xml has no + // attribute to store that value, so a subsystem with version number + // will be treated as "additional" option then. + {"SubSystem", "SUBSYSTEM:CONSOLE", "Console applicationoutput", "1", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWS", "Windows application output", "2", 0}, + {"SubSystem", "SUBSYSTEM:NATIVE", "Native application output", "3", 0}, + {"SubSystem", "SUBSYSTEM:EFI_APPLICATION", + "EFI application output", "4", 0}, + {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "EFI boot service output", "5", 0}, + {"SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM output", "6", 0}, + {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "EFI runtime driver output", "7", 0}, + {"SubSystem", "SUBSYSTEM:WINDOWSCE", "WinCE application output", "8", 0}, + + {"EntryPointSymbol", "ENTRY:", + "Entry Point Symbol","", cmVS7FlagTable::UserValue}, + // Stack size to reserve + {"StackReserveSize", "STACK:", "set the default stack size", + "", cmVS7FlagTable::UserValue}, + + {0,0,0,0,0} +}; + +cmVS7FlagTable const* cmGlobalVisualStudio9_SDKGenerator +::GetExtraLinkFlagTableVS8() +{ + return cmVS9SDKExtraLinkFlagTable; +} diff --git a/Source/cmGlobalVisualStudio9_SDKGenerator.h b/Source/cmGlobalVisualStudio9_SDKGenerator.h new file mode 100644 index 0000000..eabfeb7 --- /dev/null +++ b/Source/cmGlobalVisualStudio9_SDKGenerator.h @@ -0,0 +1,68 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio9_WindowsMobile_Generator.h,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.4 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio9_SDKGenerator_h +#define cmGlobalVisualStudio9_SDKGenerator_h + +#include "cmGlobalVisualStudio8_SDKGenerator.h" + + +/** + * \brief Generates Visual Studio 9 projects based on a + * select Platform. + * + */ +class cmGlobalVisualStudio9_SDKGenerator : + public cmGlobalVisualStudio8_SDKGenerator +{ +public: + cmGlobalVisualStudio9_SDKGenerator(PlatformDefs const& platformDefs ); + + virtual void AddPlatformDefinitions(cmMakefile* mf); + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! create the correct local generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Try to determine system infomation such as shared library + * extension, pthreads, byte order etc. + */ + virtual void EnableLanguage(std::vector<std::string>const& languages, + cmMakefile *, bool optional); + + virtual void WriteSLNHeader(std::ostream& fout); + + /** + * Where does this version of Visual Studio look for macros for the + * current user? Returns the empty string if this version of Visual + * Studio does not implement support for VB macros. + */ + virtual std::string GetUserMacrosDirectory(); + + /** + * What is the reg key path to "vsmacros" for this version of Visual + * Studio? + */ + virtual std::string GetUserMacrosRegKeyBase(); + +protected: + virtual cmIDEFlagTable const* GetExtraLinkFlagTableVS8(); +}; +#endif + diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 2084808..883b171 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -539,9 +539,10 @@ private: }; //---------------------------------------------------------------------------- -void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, +void cmLocalVisualStudio7Generator::WritePlatformConfiguration(std::ostream& fout, const char* configName, const char *libName, + const char *platformName, cmTarget &target) { const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); @@ -550,7 +551,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, mfcFlag = "0"; } fout << "\t\t<Configuration\n" - << "\t\t\tName=\"" << configName << "|" << this->PlatformName << "\"\n" + << "\t\t\tName=\"" << configName << "|" << platformName << "\"\n" << "\t\t\tOutputDirectory=\"" << configName << "\"\n"; // This is an internal type to Visual Studio, it seems that: // 4 == static library @@ -821,10 +822,33 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, } this->OutputTargetRules(fout, configName, target, libName); - this->OutputBuildTool(fout, configName, target, targetOptions.IsDebug()); + this->OutputBuildTool(fout, configName, platformName, target, targetOptions.IsDebug()); fout << "\t\t</Configuration>\n"; } +void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, + const char *configName, + const char *libName, + cmTarget &target) +{ + if(PlatformName == "Mobile Platform") + { + cmGlobalVisualStudio7Generator *gg = + static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); + WritePlatformConfiguration( + fout,configName,libName, + gg->GetPlatformDef().PlatformName.c_str(), + target); + } + else + { + WritePlatformConfiguration( + fout,configName,libName, + PlatformName.c_str(), + target); + } +} + //---------------------------------------------------------------------------- std::string cmLocalVisualStudio7Generator @@ -843,6 +867,7 @@ cmLocalVisualStudio7Generator void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, const char* configName, + const char* platformName, cmTarget &target, bool isDebug) { @@ -888,7 +913,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, extraLinkOptions += targetLinkFlags; } Options linkOptions(this, this->Version, Options::Linker, - cmLocalVisualStudio7GeneratorLinkFlagTable); + cmLocalVisualStudio7GeneratorLinkFlagTable, + this->ExtraLinkFlagTable); linkOptions.Parse(extraLinkOptions.c_str()); if(!this->ModuleDefinitionFile.empty()) { @@ -990,6 +1016,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n"; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1031,6 +1058,29 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tLinkLibraryDependencies=\"false\"\n"; } + + if(strcmp(platformName,"Win32") != 0 && strcmp(platformName,"x64") != 0) + { + // Here we set the subsystem and the entry point + char const* pSubSystem = NULL; + if ( ! target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + { + pSubSystem = Makefile->GetDefinition("CMAKE_CREATE_CONSOLE_EXE"); + } + else + { + pSubSystem = Makefile->GetDefinition("CMAKE_CREATE_WIN32_EXE"); + } + + linkOptions.Parse(pSubSystem); + + // TODO: Comment why this is required! + fout << "\t\t\t\tDelayLoadDLLs=\"$(NOINHERIT)\"\n"; + fout << "\t\t\t\tRandomizedBaseAddress=\"1\"\n"; + fout << "\t\t\t\tDataExecutionPrevention=\"0\"\n"; + } + + linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); // Use the NOINHERIT macro to avoid getting VS project default // libraries which may be set by the user to something bad. @@ -1039,6 +1089,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; + temp = target.GetDirectory(configName); temp += "/"; temp += targetNameFull; @@ -1052,10 +1103,14 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, fout << "\t\t\t\tProgramDataBaseFile=\"" << target.GetDirectory(configName) << "/" << targetNamePDB << "\"\n"; + if(isDebug) { fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; } + if(strcmp(platformName,"Win32") == 0 || + strcmp(platformName,"x64") == 0) + { if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) { fout << "\t\t\t\tSubSystem=\"2\"\n"; @@ -1064,6 +1119,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tSubSystem=\"1\"\n"; } + } std::string stackVar = "CMAKE_"; stackVar += linkLanguage; stackVar += "_STACK_SIZE"; @@ -1072,6 +1128,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\""; } + temp = target.GetDirectory(configName, true); temp += "/"; temp += targetNameImport; @@ -1397,6 +1454,9 @@ void cmLocalVisualStudio7Generator std::string dir_max; this->ComputeMaxDirectoryLength(dir_max, target); + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + // Loop through each source in the source group. std::string objectName; for(std::vector<const cmSourceFile *>::const_iterator sf = @@ -1450,6 +1510,51 @@ void cmLocalVisualStudio7Generator fci = fcinfo.FileConfigMap.begin(); fci != fcinfo.FileConfigMap.end(); ++fci) { + if(PlatformName == "Mobile Platform") + { + PlatformDefs const& pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fci->second; + fout << "\t\t\t\t<FileConfiguration\n" + << "\t\t\t\t\tName=\"" << fci->first + << "|" << pldef.PlatformName << "\""; + if(fc.ExcludedFromBuild) + { + fout << " ExcludedFromBuild=\"true\""; + } + fout << ">\n"; + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n"; + if(!fc.CompileFlags.empty() || + !fc.CompileDefs.empty() || + !fc.CompileDefsConfig.empty()) + { + Options fileOptions(this, this->Version, Options::Compiler, + cmLocalVisualStudio7GeneratorFlagTable, + this->ExtraFlagTable); + fileOptions.Parse(fc.CompileFlags.c_str()); + fileOptions.AddDefines(fc.CompileDefs.c_str()); + fileOptions.AddDefines(fc.CompileDefsConfig.c_str()); + fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n"); + fileOptions.OutputFlagMap(fout, "\t\t\t\t\t"); + fileOptions.OutputPreprocessorDefinitions(fout, + "\t\t\t\t\t", "\n"); + } + if(!fc.AdditionalDeps.empty()) + { + fout << "\t\t\t\t\tAdditionalDependencies=\"" + << fc.AdditionalDeps.c_str() << "\"\n"; + } + if(!fc.ObjectName.empty()) + { + fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" + << fc.ObjectName.c_str() << "\"\n"; + } + fout << "\t\t\t\t\t/>\n" + << "\t\t\t\t</FileConfiguration>\n"; + + } + else + { cmLVS7GFileConfig const& fc = fci->second; fout << "\t\t\t\t<FileConfiguration\n" << "\t\t\t\t\tName=\"" << fci->first @@ -1490,6 +1595,7 @@ void cmLocalVisualStudio7Generator << "\t\t\t\t</FileConfiguration>\n"; } } + } fout << "\t\t\t</File>\n"; } } @@ -1518,9 +1624,9 @@ WriteCustomRule(std::ostream& fout, // Write the rule for each configuration. std::vector<std::string>::iterator i; - std::vector<std::string> *configs = - static_cast<cmGlobalVisualStudio7Generator *> - (this->GlobalGenerator)->GetConfigurations(); + cmGlobalVisualStudio7Generator * gg = + static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + std::vector<std::string> *configs = gg->GetConfigurations(); const char* compileTool = "VCCLCompilerTool"; if(this->FortranProject) { @@ -1533,6 +1639,83 @@ WriteCustomRule(std::ostream& fout, } for(i = configs->begin(); i != configs->end(); ++i) { + if( PlatformName == "Mobile Platform") + { + PlatformDefs const &pldef = gg->GetPlatformDef(); + cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; + fout << "\t\t\t\t<FileConfiguration\n"; + fout << "\t\t\t\t\tName=\"" << *i << "|" + << pldef.PlatformName << "\">\n"; + if(!fc.CompileFlags.empty()) + { + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << compileTool << "\"\n" + << "\t\t\t\t\tAdditionalOptions=\"" + << this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n"; + } + + std::string script = + this->ConstructScript(command.GetCommandLines(), + command.GetWorkingDirectory(), + i->c_str(), + command.GetEscapeOldStyle(), + command.GetEscapeAllowMakeVars()); + fout << "\t\t\t\t\t<Tool\n" + << "\t\t\t\t\tName=\"" << customTool << "\"\n" + << "\t\t\t\t\tDescription=\"" + << this->EscapeForXML(comment.c_str()) << "\"\n" + << "\t\t\t\t\tCommandLine=\"" + << this->EscapeForXML(script.c_str()) << "\"\n" + << "\t\t\t\t\tAdditionalDependencies=\""; + if(command.GetDepends().empty()) + { + // There are no real dependencies. Produce an artificial one to + // make sure the rule runs reliably. + if(!cmSystemTools::FileExists(source)) + { + std::ofstream depout(source); + depout << "Artificial dependency for a custom command.\n"; + } + fout << this->ConvertToXMLOutputPath(source); + } + else + { + // Write out the dependencies for the rule. + for(std::vector<std::string>::const_iterator d = + command.GetDepends().begin(); + d != command.GetDepends().end(); + ++d) + { + // Get the real name of the dependency in case it is a CMake target. + std::string dep = this->GetRealDependency(d->c_str(), i->c_str()); + fout << this->ConvertToXMLOutputPath(dep.c_str()) + << ";"; + } + } + fout << "\"\n"; + fout << "\t\t\t\t\tOutputs=\""; + if(command.GetOutputs().empty()) + { + fout << source << "_force"; + } + else + { + // Write a rule for the output generated by this command. + const char* sep = ""; + for(std::vector<std::string>::const_iterator o = + command.GetOutputs().begin(); + o != command.GetOutputs().end(); + ++o) + { + fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str()); + sep = ";"; + } + } + fout << "\"/>\n"; + fout << "\t\t\t\t</FileConfiguration>\n"; + } + else + { cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i]; fout << "\t\t\t\t<FileConfiguration\n"; fout << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n"; @@ -1605,6 +1788,7 @@ WriteCustomRule(std::ostream& fout, fout << "\t\t\t\t</FileConfiguration>\n"; } } +} void cmLocalVisualStudio7Generator::WriteVCProjBeginGroup(std::ostream& fout, @@ -1727,13 +1911,18 @@ cmLocalVisualStudio7Generator } if(projectType) { - fout << "\tProjectType=\"" << projectType << "\"\n"; + fout << "\tProjectType=\"" << projectType << "\">\n"; } fout<< "\tKeyword=\"" << keyword << "\">\n" << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if(PlatformName == "Mobile Platform") + fout << "\t\t<Platform\n\t\t\tName=\"" + << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } @@ -1774,6 +1963,7 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, const char* vsProvider = target.GetProperty("VS_SCC_PROVIDER"); cmGlobalVisualStudio7Generator* gg = static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); + fout << "\tName=\"" << projLabel << "\"\n"; if(this->Version >= 8) { @@ -1788,9 +1978,14 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, << "\tSccProvider=\"" << vsProvider << "\"\n"; } fout << "\tKeyword=\"" << keyword << "\">\n" - << "\t<Platforms>\n" - << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" - << "\t</Platforms>\n"; + << "\t<Platforms>\n"; + + if(PlatformName == "Mobile Platform") + fout << "\t\t<Platform\n\t\t\tName=\"" + << gg->GetPlatformDef().PlatformName << "\"/>\n"; + else + fout << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"; + fout << "\t</Platforms>\n"; } diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 19f7b97..e6d4ef3 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -64,6 +64,8 @@ public: void SetExtraFlagTable(cmVS7FlagTable const* table) { this->ExtraFlagTable = table; } + void SetExtraLinkFlagTable(cmVS7FlagTable const* table) + { this->ExtraLinkFlagTable = table; } virtual std::string GetTargetDirectory(cmTarget const&) const; cmSourceFile* CreateVCProjBuildRule(); void WriteStampFiles(); @@ -88,6 +90,11 @@ private: void CreateSingleVCProj(const char *lname, cmTarget &tgt); void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); + void WritePlatformConfiguration(std::ostream& fout, + const char* configName, + const char *libName, + const char *platformName, + cmTarget &target); void WriteConfigurations(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfiguration(std::ostream& fout, @@ -99,7 +106,7 @@ private: void OutputTargetRules(std::ostream& fout, const char* configName, cmTarget &target, const char *libName); void OutputBuildTool(std::ostream& fout, const char* configName, - cmTarget& t, bool debug); + const char* platformName, cmTarget& t, bool debug); void OutputLibraryDirectories(std::ostream& fout, std::vector<std::string> const& dirs); void WriteProjectStart(std::ostream& fout, const char *libName, @@ -128,6 +135,7 @@ private: friend class EventWriter; cmVS7FlagTable const* ExtraFlagTable; + cmVS7FlagTable const* ExtraLinkFlagTable; std::string ModuleDefinitionFile; int Version; bool FortranProject; diff --git a/Source/cmSDKConfigParser.cxx b/Source/cmSDKConfigParser.cxx new file mode 100644 index 0000000..84d6fdb --- /dev/null +++ b/Source/cmSDKConfigParser.cxx @@ -0,0 +1,205 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: cmGlobalVisualStudio8_WindowsMobile_Generator.cxx,v $ + Language: C++ + Date: $Date: 2008-04-02 13:16:04 $ + Version: $Revision: 1.36.2.1 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include <iomanip> +#include <sstream> +#include "cmSDKConfigParser.h" +#include "cmake.h" + +cmSDKConfigParser::cmSDKConfigParser(std::string const& basePath) +: m_vsBasePath(basePath) +{ + current_platform_valid = false; +} + +void cmSDKConfigParser::StartElement(const char* name, const char** atts) +{ + if ( strcmp(name, "Platform") == 0 ) + { + PlatformDefs nPlatform; + platformVec.push_back(nPlatform); + current_platform_valid = true; + } + if ( strcmp(name, "Directories") == 0 ) + { + const char* includes = this->FindAttribute(atts, "Include"); + if (includes) + { + platformVec.back().IncludePaths = std::string(includes); + } + const char* libs = this->FindAttribute(atts, "Library"); + if (libs) + { + platformVec.back().LibraryPaths = std::string(libs); + } + } + if ( strcmp(name, "Macro") == 0 ) + { + const char* rev = this->FindAttribute(atts, "Name"); + if (rev) + { + if ( strcmp(rev, "PLATFORMDEFINES") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().PlatformDefines = std::string(rev); + } + else if ( strcmp(rev, "CEVER") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().CEver = std::string(rev); + } + else if ( strcmp(rev, "ARCHFAM") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().Archfam = std::string(rev); + } + else if ( strcmp(rev, "_ARCHFAM_") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().Archfam_ = std::string(rev); + } + else if ( strcmp(rev, "INSTRUCTIONSET") == 0 && current_platform_valid) + { + rev = this->FindAttribute(atts, "Value"); + if(rev) + platformVec.back().InstructionSet= std::string(rev); + } + } + } + this->CharacterData.clear(); +} + +void cmSDKConfigParser::EndElement(const char* name) +{ + if ( strcmp(name, "PlatformName") == 0 ) + { + platformVec.back().PlatformName = + std::string(this->CharacterData.begin(),this->CharacterData.end()); + } + else if ( strcmp(name, "OSMinorVersion") == 0 && current_platform_valid) + { + platformVec.back().MinorVer = + atoi(std::string( + this->CharacterData.begin(), + this->CharacterData.end() + ).c_str()); + } + else if ( strcmp(name, "OSMajorVersion") == 0 && current_platform_valid) + { + platformVec.back().MajorVer = + atoi(std::string( + this->CharacterData.begin(),this->CharacterData.end() + ).c_str()); + } + if ( strcmp(name, "Platform") == 0 ) + { + // done with parsing the platform now we set the compiler path + // that can be used by the generators. + if( platformVec.back().Archfam.find("ARM") != std::string::npos || + platformVec.back().Archfam.find("arm") != std::string::npos) + { + platformVec.back().Compiler = + this->m_vsBasePath+"/VC/ce/bin/x86_arm/cl.exe"; + } + else if( platformVec.back().Archfam.find("SH") != std::string::npos || + platformVec.back().Archfam.find("sh") != std::string::npos) + { + platformVec.back().Compiler = + this->m_vsBasePath+"/VC/ce/bin/x86_sh/cl.exe"; + } + else if( platformVec.back().Archfam.find("MIPS") != std::string::npos || + platformVec.back().Archfam.find("mips") != std::string::npos ) + { + platformVec.back().Compiler = + this->m_vsBasePath+"/VC/ce/bin/x86_mips/cl.exe"; + } + // could be a special x86 wince platform - we have to do more parsing if + // wince gets a 64bit version + else + { + platformVec.back().Compiler = this->m_vsBasePath+"/VC/bin/cl.exe"; + } + + std::ostringstream out; + out << platformVec.back().MajorVer << '.' + << std::setw(2)<< std::setfill('0') + << platformVec.back().MinorVer; + platformVec.back().SystemVersion = out.str(); + } + + this->CharacterData.clear(); +} + +void cmSDKConfigParser::CharacterDataHandler(const char* data, int length) +{ + this->CharacterData.insert(this->CharacterData.end(), data, data+length); +} + +const char* cmSDKConfigParser::FindAttribute( + const char** atts, + const char* attribute ) +{ + if ( !atts || !attribute ) + { + return 0; + } + const char **atr = atts; + while ( *atr && **atr && **(atr+1) ) + { + if ( strcmp(*atr, attribute) == 0 ) + { + return *(atr+1); + } + atr+=2; + } + return 0; +} + + +void cmSDKConfigParser::GetSDKsInstalled( + std::string vsVersionString, + std::vector<PlatformDefs> & platformSDKs ) +{ + platformSDKs.clear(); + + std::string regkey( + "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\VisualStudio\\" + ); + regkey += vsVersionString + "\\Setup\\VS;ProductDir"; + + std::string base; + + if (!cmSystemTools::ReadRegistryValue(regkey.c_str(),base)) + { + return; + } + + cmSystemTools::ConvertToUnixSlashes(base); + + // NOW READ THE CONFIG FILE FOR THE SDKs + std::string configFilename = base + "/VC/vcpackages/WCE.VCPlatform.config"; + cmSDKConfigParser parser(base); + if(parser.ParseFile(configFilename.c_str()) == 0) { + return; + } + swap(platformSDKs, parser.getPlatforms()); +} + diff --git a/Source/cmSDKConfigParser.h b/Source/cmSDKConfigParser.h new file mode 100644 index 0000000..0c36c26 --- /dev/null +++ b/Source/cmSDKConfigParser.h @@ -0,0 +1,72 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile: ,v $ + Language: C++ + Date: $Date: 2008-02-15 16:49:58 $ + Version: $Revision: 1.13 $ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmSDKConfigParser_h +#define cmSDKConfigParser_h + +#include "cmXMLParser.h" + +typedef struct { + int MajorVer; + int MinorVer; + std::string PlatformDefines; + std::string SystemVersion; //! CMAKE_SYSTEM_VERSION + std::string CEver; //! == UNDER_CE + std::string Archfam; + std::string Archfam_; + std::string InstructionSet; + std::string PlatformName; + std::string LibraryPaths; + std::string IncludePaths; + std::string Compiler; // cl compiler with absolute path +} PlatformDefs; + + +/*! + * \brief Parser for *.VCPlatform.config xml files. + * + */ +class cmSDKConfigParser : public cmXMLParser +{ +public: + cmSDKConfigParser(std::string const& vsPath); + + std::vector<PlatformDefs> & getPlatforms() {return platformVec;}; + std::vector<PlatformDefs> const& getPlatforms() const {return platformVec;}; + + /*! + \brief Parses the Windows CE SDKs installed for the given visual studio + version. + \param VSversionString visual studio version, i.e. 8.0 or 9.0 + */ + static void GetSDKsInstalled( + std::string VSversionString, + std::vector<PlatformDefs> & platformSDKs + ); +protected: + void StartElement(const char* name, const char** atts); + void EndElement(const char* name); + void CharacterDataHandler(const char* data, int length); + const char* FindAttribute( const char** atts, const char* attribute ); +private: + std::vector<char> CharacterData; + std::vector<PlatformDefs> platformVec; + bool current_platform_valid; + std::string m_vsBasePath; +}; + +#endif + diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 75fd2b2..b7e172f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -60,7 +60,9 @@ # include "cmGlobalVisualStudio7Generator.h" # include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio8Generator.h" +# include "cmGlobalVisualStudio8_SDKGenerator.h" # include "cmGlobalVisualStudio9Generator.h" +# include "cmGlobalVisualStudio9_SDKGenerator.h" # include "cmGlobalVisualStudio9Win64Generator.h" # include "cmGlobalVisualStudio10Generator.h" # include "cmGlobalVisualStudio10Win64Generator.h" @@ -2418,6 +2420,25 @@ void cmake::AddDefaultGenerators() new cmFunctionGeneratorFactory(&cmGlobalVisualStudio8Generator::New); this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Generator::New); + + std::vector<PlatformDefs> vs8Platforms; + cmSDKConfigParser::GetSDKsInstalled("8.0", vs8Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs8Platforms.begin(), + e = vs8Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 8.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio8_SDKGenerator>(*it); + } + + std::vector<PlatformDefs> vs9Platforms; + cmSDKConfigParser::GetSDKsInstalled("9.0", vs9Platforms); + for( std::vector<PlatformDefs>::const_iterator it = vs9Platforms.begin(), + e = vs9Platforms.end(); it != e; ++it) + { + this->Generators["Visual Studio 9.0 " + it->PlatformName] = + new cmSDKGeneratorFactory<cmGlobalVisualStudio9_SDKGenerator>(*it); + } + this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = new cmFunctionGeneratorFactory(&cmGlobalVisualStudio9Win64Generator::New); this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = -- 1.6.5.1.1367.gcd48 0003-applied-wince-cmakefiles-supprt-3.patch.patch [^] (12,533 bytes) 2010-03-09 14:37 [Show Content] [Hide Content] From 0ed294ffa5d0709678221f1d93a70d7843e592ed Mon Sep 17 00:00:00 2001 From: herbst <template.meta.programmer@googlemail.com> Date: Thu, 21 Jan 2010 21:01:58 +0000 Subject: [PATCH 3/3] applied wince-cmakefiles-supprt-3.patch --- Modules/CMakeTestCLMachineType.c | 1 + Modules/Platform/WinCE-cl.cmake | 34 ++++++++ Modules/Platform/WinCE.cmake | 26 ++++++ Modules/Platform/Windows-cl.cmake | 146 ++++++++++++++++++++++++++------- Modules/Platform/Windows-cl.cmake.in | 1 + 5 files changed, 177 insertions(+), 31 deletions(-) create mode 100644 Modules/CMakeTestCLMachineType.c create mode 100644 Modules/Platform/WinCE-cl.cmake create mode 100644 Modules/Platform/WinCE.cmake diff --git a/Modules/CMakeTestCLMachineType.c b/Modules/CMakeTestCLMachineType.c new file mode 100644 index 0000000..0540eda --- /dev/null +++ b/Modules/CMakeTestCLMachineType.c @@ -0,0 +1 @@ +int dummy() { return 0;} diff --git a/Modules/Platform/WinCE-cl.cmake b/Modules/Platform/WinCE-cl.cmake new file mode 100644 index 0000000..f18b109 --- /dev/null +++ b/Modules/Platform/WinCE-cl.cmake @@ -0,0 +1,34 @@ + +IF(NOT CMAKE_WINDOWS_STACKSIZE ) + SET(CMAKE_WINDOWS_STACKSIZE 65536) ## stacksize is set to 65kb +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE ) + +# OLDNAMES.lib is not available for WinCE +SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO /NODEFAULTLIB:\"oldnames.lib\"") + +INCLUDE(Platform/Windows-cl) + +IF(MSVC_VERSION GREATER 1310) + # Windows-cl.cmake sets /RTC1, we remove that here + SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od") + # We deactivate Manifest creation + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO") + SET (CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST:NO") + SET (CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} /MANIFEST:NO") +ENDIF(MSVC_VERSION GREATER 1310) + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +IF(CMAKE_SYSTEM_VERSION) + SET(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWSCE,${CMAKE_SYSTEM_VERSION}") +## TODO: setting the entry point is not always supported, some versions of +## WinCE only support creating a "win32 exe" + SET(CMAKE_CREATE_CONSOLE_EXE "/SUBSYSTEM:WINDOWSCE,${CMAKE_SYSTEM_VERSION} /ENTRY:mainACRTStartup") +ELSE(CMAKE_SYSTEM_VERSION) +# according to msdn version would default to 2.00 + SET(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWSCE") + SET(CMAKE_CREATE_CONSOLE_EXE "/SUBSYSTEMY:WINDOWSCE /ENTRY:mainACRTStartup") +ENDIF(CMAKE_SYSTEM_VERSION) + diff --git a/Modules/Platform/WinCE.cmake b/Modules/Platform/WinCE.cmake new file mode 100644 index 0000000..2b37179 --- /dev/null +++ b/Modules/Platform/WinCE.cmake @@ -0,0 +1,26 @@ +SET(WINCE 1) + +INCLUDE(Platform/Windows) + +IF(CMAKE_SYSTEM_VERSION) + IF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + STRING(REGEX REPLACE "([0-9]*)\\.([0-9]*)" "0x\\1\\2" CMAKE_SYSTEM_VERSION_HEX "${CMAKE_SYSTEM_VERSION}" ) + ELSE(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + MESSAGE(SEND_ERROR "Please set a CMAKE_SYSTEM_VERSION that matches: [0-9]+'.'[0-9][0-9]" ) + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_SYSTEM_VERSION MATCHES "[0-9]+\\.[0-9][0-9]") + +ELSE(CMAKE_SYSTEM_VERSION) + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "$(CEVER)") + ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CMAKE_SYSTEM_VERSION_HEX "0x200") + ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") +ENDIF(CMAKE_SYSTEM_VERSION) + +ADD_DEFINITIONS( + -DUNDER_CE=${CMAKE_SYSTEM_VERSION_HEX} + -D_WIN32_WCE=${CMAKE_SYSTEM_VERSION_HEX} + -DWIN32 + ) + diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 303ef34..2492f42 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -140,37 +140,114 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) + ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + +# Testing the machine type of the generated binaries: +IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) + + ## IF CMAKE_CL_MACHINE_TYPE has been set in the toolchain file, we do not look for dumpbin + IF(NOT CMAKE_CL_MACHINE_TYPE) + FIND_PROGRAM(CMAKE_DUMPBIN + NAMES dumpbin + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir] + "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9.0/VC/bin" + "/Program Files/Microsoft Visual Studio 9.0/VC/bin/" + "/Program Files/Microsoft Visual Studio 8/VC/bin/" + "$ENV{ProgramFiles}/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/VC/bin" + "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio .NET/VC/bin" + "c:/Program Files/Microsoft Visual Studio.NET/VC/bin" + "/Program Files/Microsoft Visual Studio .NET/VC/bin/" + ) + + MESSAGE(STATUS "Check CL platform:") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking CL platform using dumpbin ${CMAKE_DUMPBIN}" ) MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") - MESSAGE(STATUS "Check CL platform") - EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3 - ARGS /nologo - \"${testForFreeVCFile}\" - /link /machine:i386 - OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT - RETURN_VALUE CMAKE_COMPILER_RETURN + IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + GET_FILENAME_COMPONENT(CL_PATH ${CMAKE_C_COMPILER} PATH) + GET_FILENAME_COMPONENT(MAKE_PATH ${CMAKE_MAKE_PROGRAM} PATH) + GET_FILENAME_COMPONENT(DUMPBIN_PATH ${CMAKE_DUMPBIN} PATH) + SET(ENV{PATH} "${MAKE_PATH};${CL_PATH};${DUMPBIN_PATH};$ENV{PATH}") + + # We compile a trivial source file and run dumpbin on the object file + # the headers section should contain the machine type that the selected cl + # produces. + + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Dumpbin found as ${CMAKE_DUMPBIN}\n" ) + SET(testForCLMachineType + "${CMAKE_ROOT}/Modules/CMakeTestCLMachineType.c") + SET(testForCLMachineTypeOutput CMakeTestCLMachineType.obj) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "\n\nRunning cl: ${CMAKE_C_COMPILER} -c \"${testForCLMachineType}\" " ) + EXECUTE_PROCESS(COMMAND "${CMAKE_C_COMPILER}" -c "${testForCLMachineType}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + ERROR_VARIABLE testForCLMachineType_DUMP + OUTPUT_VARIABLE testForCLMachineType_DUMP ) - # if there was an error assume it is a 64bit system - IF(CMAKE_COMPILER_RETURN) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 64 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 64 bit") - SET(CMAKE_CL_64 1) - ELSE(CMAKE_COMPILER_RETURN) FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if this is a 32 bit system passed:\n" - "${CMAKE_COMPILER_OUTPUT}\n\n") - MESSAGE(STATUS "Check CL platform - 32 bit") - SET(CMAKE_CL_64 0) - ENDIF(CMAKE_COMPILER_RETURN) - ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + "${testForCLMachineType_DUMP}\n\nRunning dumpbin: ${CMAKE_DUMPBIN} /HEADERS ${testForCLMachineType}" ) + EXECUTE_PROCESS(COMMAND "${CMAKE_DUMPBIN}" /HEADERS ${testForCLMachineTypeOutput} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3" + OUTPUT_VARIABLE testForCLMachineType_DUMPBIN_OUTPUT + ERROR_VARIABLE testForCLMachineType_DUMP + ) + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${testForCLMachineType_DUMP}\n${testForCLMachineType_DUMPBIN_OUTPUT}" ) + STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" DUMPBIN_REGEX_RESULT ${testForCLMachineType_DUMPBIN_OUTPUT}) + SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1}) + + ELSE(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + MESSAGE(Status "Check CL platform: dumpbin.exe was not found - assuimg i386") + MESSAGE(Status "You can override the setting by clearing the build path and setting CMAKE_CL_MACHINE_TYPE") + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) + ENDIF(NOT CMAKE_CL_MACHINE_TYPE) + +## TODO add further dumpbin machine to visual studio machine type conversion here, +## if required + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + SET(CMAKE_CL_MACHINE_TYPE i386) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x86) + + IF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + IF(NOT CMAKE_FORCE_NON_THUMB) + SET(CMAKE_CL_MACHINE_TYPE THUMB) + ENDIF(NOT CMAKE_FORCE_NON_THUMB) + ENDIF(CMAKE_CL_MACHINE_TYPE MATCHES ARM) + + ## If everything above failed, we default to i386 + IF(NOT CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_CL_MACHINE_TYPE "i386") + ENDIF(NOT CMAKE_CL_MACHINE_TYPE) + + MESSAGE(STATUS "Check CL platform: ${CMAKE_CL_MACHINE_TYPE}" ) IF(CMAKE_FORCE_WIN64) - SET(CMAKE_CL_64 1) + SET(CMAKE_CL_MACHINE_TYPE x64) + MESSAGE(STATUS "CL platform was forced to:${CMAKE_CL_MACHINE_TYPE}" ) ENDIF(CMAKE_FORCE_WIN64) + + ## CMAKE_CL_64 is set for compatibility reasons + IF(CMAKE_CL_MACHINE_TYPE STREQUAL x64) + SET(CMAKE_CL_64 1) + ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL x64) + +ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) IF("${MSVC_VERSION}" GREATER 1599) SET(MSVC_INCREMENTAL_DEFAULT ON) ENDIF() @@ -234,14 +311,21 @@ SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type -IF(CMAKE_CL_64) - SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64") -ELSE(CMAKE_CL_64) + +IF(NOT CMAKE_WINDOWS_STACKSIZE) + SET(CMAKE_WINDOWS_STACKSIZE 10000000) +ENDIF(NOT CMAKE_WINDOWS_STACKSIZE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386") -ENDIF(CMAKE_CL_64) + "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:${CMAKE_WINDOWS_STACKSIZE}" ) + + +SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MACHINE:${CMAKE_CL_MACHINE_TYPE}") + + # append /ARMPADCODE +IF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ARMPADCODE") +ENDIF(CMAKE_CL_MACHINE_TYPE STREQUAL THUMB) # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in index 1a889f2..999d7dd 100644 --- a/Modules/Platform/Windows-cl.cmake.in +++ b/Modules/Platform/Windows-cl.cmake.in @@ -3,6 +3,7 @@ SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@) SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) SET(CMAKE_CL_64 @CMAKE_CL_64@) +SET(CMAKE_CL_MACHINE_TYPE @CMAKE_CL_MACHINE_TYPE@) SET(MSVC60 @MSVC60@) SET(MSVC70 @MSVC70@) SET(MSVC71 @MSVC71@) -- 1.6.5.1.1367.gcd48 0001-Add-WindowsCE-defines-to-Windows-MSVC.cmake.patch [^] (1,418 bytes) 2012-10-25 08:30 [Show Content] [Hide Content] From 937962d666abceb57eeb259fe74a8e73b4774a51 Mon Sep 17 00:00:00 2001 From: Artem Chibeskov <chibeskov@ac-sw.com> Date: Thu, 25 Oct 2012 19:18:52 +0700 Subject: [PATCH 1/3] Add WindowsCE defines to Windows-MSVC.cmake --- Modules/Platform/Windows-MSVC.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 1f28c50..c4e592c 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -41,7 +41,12 @@ set(WIN32 1) if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE") set(CMAKE_CREATE_WIN32_EXE "/subsystem:windowsce /entry:WinMainCRTStartup") set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /entry:mainACRTStartup") + set(CMAKE_PLATFORM_DEFINES "/D_WIN32_WCE=$(CEVER) /D_WINDOWS /DUNDER_CE /D$(ARCHFAM) /D$(_ARCHFAM_) /D$(PLATFORMDEFINES)") + set(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib ") + set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /ENTRY:mainACRTStartup") else() + set(CMAKE_PLATFORM_DEFINES "/DWIN32 /D_WINDOWS") + set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ") set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows") set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console") endif() -- 1.7.12.1 0002-Added-cmGlobalGenerator-AddTryCompileCacheEntries.patch [^] (1,393 bytes) 2012-10-25 08:31 [Show Content] [Hide Content] From 42208fa10dccb83bea56bd5dfda5593b913c9cfd Mon Sep 17 00:00:00 2001 From: Artem Chibeskov <chibeskov@ac-sw.com> Date: Thu, 25 Oct 2012 19:20:43 +0700 Subject: [PATCH 2/3] Added cmGlobalGenerator::AddTryCompileCacheEntries() --- Source/cmGlobalGenerator.h | 3 +++ Source/cmMakefile.cxx | 1 + 2 files changed, 4 insertions(+) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 0aab2d6..13c90c2 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -52,6 +52,9 @@ public: /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; + ///! Add inital cache entries for TryCompile. + virtual void AddTryCompileCacheEntries(cmake& cm) { }; + /** * Create LocalGenerators and process the CMakeLists files. This does not * actually produce any makefiles, DSPs, etc. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index f067da4..2b34345 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2952,6 +2952,7 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir, cm.SetStartOutputDirectory(bindir); cm.SetCMakeCommand(cmakeCommand.c_str()); cm.LoadCache(); + this->LocalGenerator->GetGlobalGenerator()->AddTryCompileCacheEntries(cm); if(!gg->IsMultiConfig()) { if(const char* config = -- 1.7.12.1 0003-Added-logic-for-CMAKE_WINCE_SDK-CacheEntry.patch [^] (9,610 bytes) 2012-10-25 08:31 [Show Content] [Hide Content] From 4f1e3a0bd2d08a7648059f1717174c2ebd904bad Mon Sep 17 00:00:00 2001 From: Artem Chibeskov <chibeskov@ac-sw.com> Date: Thu, 25 Oct 2012 19:23:22 +0700 Subject: [PATCH 3/3] Added logic for CMAKE_WINCE_SDK CacheEntry --- Source/cmGlobalVisualStudio8Generator.cxx | 230 ++++++++++++++++++++++++++++++ Source/cmGlobalVisualStudio8Generator.h | 12 +- Source/cmLocalVisualStudio7Generator.cxx | 6 +- 3 files changed, 246 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index bca1754..49eab8d 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -15,6 +15,168 @@ #include "cmMakefile.h" #include "cmake.h" #include "cmGeneratedFileStream.h" +#include "cmXMLParser.h" + + +// This class is used to parse XML with configuration +// of installed SDKs in system +class cmGlobalVisualStudio8Generator::cmWCEConfigParser : public cmXMLParser +{ +public: + cmWCEConfigParser(const char* name) + : RequiredName(name) + , FoundRequiredName(false) + { + } + + bool Found() const {return this->FoundRequiredName;} + + std::string GetOSVersion() const + { + if (this->OSMinorVersion.empty()) + { + return OSMajorVersion; + } + + return OSMajorVersion + "." + OSMinorVersion; + } + + const char* GetInstructionset() const + { + std::map<std::string, std::string>::const_iterator it = this->Macros.find("INSTRUCTIONSET"); + if (it != this->Macros.end()) + { + return it->second.c_str(); + } + + return 0; + } + + const char* GetArchitectureId() const + { + struct Instructionset2ArchitectureId + { + const char* Instructionset; + const char* ArchitectureId; + }; + + static const Instructionset2ArchitectureId convertInfo[] = + { + {"ARMV4", "ARM" }, + {"ARMV4I", "THUMB"}, + {"MIPSII", "MIPS"}, + {"MIPSII_FP", "MIPSFPU"}, + {"MIPSIV", "MIPS16"}, + {"MIPSIV_FP", "MIPSFPU16"}, + {"SH4", "SH4"}, + {"x86", "X86"} + }; + + const char* instructionset = this->GetInstructionset(); + + if (!instructionset) + { + return 0; + } + + // find corresponding flag value for obtained architecture + for(int i = 0; i < sizeof(convertInfo) / sizeof(convertInfo[0]); ++i) + { + if(strcmp(instructionset, convertInfo[i].Instructionset) == 0) + { + return convertInfo[i].ArchitectureId; + } + } + + return 0; + } + + virtual void StartElement(const char* name, const char** attributes) + { + if(this->FoundRequiredName) + { + return; + } + + this->CharacterData.clear(); + + if(strcmp(name, "PlatformData") == 0) + { + this->PlatformName.clear(); + this->OSMajorVersion.clear(); + this->OSMinorVersion.clear(); + this->Macros.clear(); + } + + if(strcmp(name, "Macro") == 0) + { + std::string name; + std::string value; + + for(const char** attr = attributes; *attr; attr += 2) + { + if(strcmp(attr[0], "Name") == 0) + { + name = attr[1]; + } + else if(strcmp(attr[0], "Value") == 0) + { + value = attr[1]; + } + } + + if(!name.empty()) + { + this->Macros[name] = value; + } + } + } + + void EndElement(const char* name) + { + if(this->FoundRequiredName) + { + return; + } + + if(strcmp(name, "PlatformName") == 0) + { + this->PlatformName = this->CharacterData; + } + else if(strcmp(name, "OSMajorVersion") == 0) + { + this->OSMajorVersion = this->CharacterData; + } + else if(strcmp(name, "OSMinorVersion") == 0) + { + this->OSMinorVersion = this->CharacterData; + } + else if(strcmp(name, "Platform") == 0) + { + if(this->PlatformName == this->RequiredName) + { + this->FoundRequiredName = true; + } + } + } + + void CharacterDataHandler(const char* data, int length) + { + this->CharacterData.append(data, length); + } + +private: + std::string CharacterData; + + std::string PlatformName; + std::string OSMajorVersion; + std::string OSMinorVersion; + std::map<std::string, std::string> Macros; + + bool FoundRequiredName; + const char* RequiredName; +}; + //---------------------------------------------------------------------------- cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() @@ -53,13 +215,81 @@ void cmGlobalVisualStudio8Generator } //---------------------------------------------------------------------------- +void cmGlobalVisualStudio8Generator::AddTryCompileCacheEntries(cmake& cm) +{ + const char* sdk = this->GetCMakeInstance()->GetCacheDefinition("CMAKE_WINCE_SDK"); + this->GetCMakeInstance()->MarkCliAsUsed("CMAKE_WINCE_SDK"); + if(sdk) + { + cm.AddCacheEntry("CMAKE_WINCE_SDK", sdk, "", cmCacheManager::INTERNAL); + } +} + +//---------------------------------------------------------------------------- void cmGlobalVisualStudio8Generator::Configure() { + this->ConfigurePlatform(); this->cmGlobalVisualStudio7Generator::Configure(); this->CreateGUID(CMAKE_CHECK_BUILD_SYSTEM_TARGET); } //---------------------------------------------------------------------------- +void cmGlobalVisualStudio8Generator::ConfigurePlatform() +{ + const char* sdk = this->GetCMakeInstance()->GetCacheDefinition("CMAKE_WINCE_SDK"); + if(sdk) + { + if(this->ConfigurePlatformSDK(sdk)) + { + return; + } + + cmSystemTools::Error("CMAKE_WINCE_SDK must be a valid Windows CE platform SDK!"); + cmSystemTools::SetFatalErrorOccured(); + return; + } + + this->PlatformName = "Win32"; +} + +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio8Generator::ConfigurePlatformSDK(const char* name) +{ + std::string vskey = this->GetRegistryBase(); + vskey += "\\Setup\\VS;ProductDir"; + + std::string vsInstallPath; + if(!cmSystemTools::ReadRegistryValue(vskey.c_str(), vsInstallPath)) + { + return false; + } + cmSystemTools::ConvertToUnixSlashes(vsInstallPath); + + const std::string configFilename = + vsInstallPath + "/VC/vcpackages/WCE.VCPlatform.config"; + + // parse XML containing all information that we need + cmWCEConfigParser parser(name); + parser.ParseFile(configFilename.c_str()); + + if(!parser.Found()) + { + return false; + } + + this->ArchitectureId = parser.GetArchitectureId(); + this->PlatformName = name; + + this->GetCMakeInstance()->AddCacheEntry("CMAKE_SYSTEM_NAME", "WindowsCE", "", cmCacheManager::INTERNAL); + this->GetCMakeInstance()->AddCacheEntry("CMAKE_SYSTEM_VERSION", parser.GetOSVersion().c_str(), "", cmCacheManager::INTERNAL); + this->GetCMakeInstance()->AddCacheEntry("CMAKE_SYSTEM_PROCESSOR", parser.GetInstructionset(), "", cmCacheManager::INTERNAL); + this->GetCMakeInstance()->AddCacheEntry("CMAKE_C_COMPILER", "cl", "", cmCacheManager::INTERNAL); + this->GetCMakeInstance()->AddCacheEntry("CMAKE_CXX_COMPILER", "cl", "", cmCacheManager::INTERNAL); + + return this->ArchitectureId && !this->PlatformName.empty(); +} + +//---------------------------------------------------------------------------- std::string cmGlobalVisualStudio8Generator::GetUserMacrosDirectory() { // Some VS8 sp0 versions cannot run macros. diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 5009f29..aa7a743 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -32,11 +32,14 @@ public: return cmGlobalVisualStudio8Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 8 2005";} - virtual const char* GetPlatformName() const {return "Win32";} + virtual const char* GetPlatformName() const {return this->PlatformName.c_str();} /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; + ///! Add inital cache entries for TryCompile. + virtual void AddTryCompileCacheEntries(cmake& cm); + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); @@ -81,5 +84,12 @@ protected: virtual bool ComputeTargetDepends(); virtual void WriteProjectDepends(std::ostream& fout, const char* name, const char* path, cmTarget &t); + +private: + class cmWCEConfigParser; + + void ConfigurePlatform(); + bool ConfigurePlatformSDK(const char* name); + std::string PlatformName; }; #endif diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index f9a2d32..8dc2874 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1218,7 +1218,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; } - if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) + if ( this->Makefile->GetCMakeInstance()->GetCacheDefinition("CMAKE_WINCE_SDK") ) + { + fout << "\t\t\t\tSubSystem=\"9\"\n"; + } + else if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") ) { fout << "\t\t\t\tSubSystem=\"" << (this->FortranProject? "subSystemWindows" : "2") << "\"\n"; -- 1.7.12.1 | ||||||||
Relationships | |||||||||||||||||||||
|
Relationships |
Notes | |
(0014039) Alex Neundorf (developer) 2008-11-05 17:48 |
Some comments/questions: WinCE.cmake/WinCE-cl.cmake: since CMAKE_SYSTEM_VERSION is used for something real, can you add a check to see it has a valid value ? What does the combination of dumpbin and Modules/CMakeTestCLMachineType.c do ? Why did you remove the 64bit check ? If it was replaced, by what ? It would be nice if Win-cl.cmake would actually get smaller instead of bigger. Can you modularize it in some way to achieve this ? E.g. move settings for WinCE into WinCE-cl.make etc. Alex |
(0014040) Alex Neundorf (developer) 2008-11-05 17:50 |
The message() for the default stacksize shouldn't appear always. Also you could maybe set the default stacksize for WinCE for something smaller ? Alex |
(0014079) Andreas Pokorny (reporter) 2008-11-10 07:21 |
dumpbin prints something like: Microsoft (R) COFF/PE Dumper Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file C:\Programme\Microsoft Platform SDK\test.obj File Type: COFF OBJECT FILE HEADER VALUES 8664 machine (x64) 3 number of sections 4918104B time date stamp Mon Nov 10 11:43:23 2008 138 file pointer to symbol table 8 number of symbols 0 size of optional header 0 characteristics [...] The cmake script searches for the line with machine(?), and uses this value for the linker call within in the /machine parameter. The 64bit check is hence integrated into the check of the dumpbin output. I.e. if cl is a 64bit compiler the resulting machine value will be "x64" instead of "x86". In some cases there is a mismatch between the dumpbin value and the /machine parameter: dumpbin: x86|x64|ARM machine: i386|x64|THUMB I need some more time with the version number check. I will send an update this evening. Regarding stacksize. It seems like that the setting is used to set the maximum stacksize on Windows. Hence the initial stacksize is probably smaller. So 10MB is a "safe" value. Thats why I also removed the message, But I doubt that the WinCE memory management is as good as the one of windows. Is 64kb a reasonable default? |
(0014336) Andreas Pokorny (reporter) 2008-12-15 09:26 |
Any news? |
(0014337) Andreas Pokorny (reporter) 2008-12-15 10:03 |
I just made yet another little patch to the patch |
(0014355) Alex Neundorf (developer) 2008-12-15 17:10 |
I didn't forget you, it's currently just quite busy in KDE4 land (the 4.2 release is coming nearer), so I don't have much time left right now. Nevertheless you're quite high on my TODO. Alex |
(0014524) Alex Neundorf (developer) 2009-01-10 10:01 |
Will check again after cmake 2.6.3 is released. Alex |
(0015324) Andreas Pokorny (reporter) 2009-02-24 09:04 |
*ping*. cmake 2.6.3 was just released if I am not mistaken :). Andreas |
(0016029) Andreas Pokorny (reporter) 2009-04-15 12:41 |
I just uploaded a new version of the patch. Now the changes of Clemens from http://cmake.org/Bug/view.php?id=8102 [^] have been integrated. There are changes to that version of the patch: * The mainCRTStartup functions have been removed - instead the subsystem and EntrPoint is properly set - even for TRY_COMPILE calls. * UNDER_CE is set to $(CEVER) when building for WinCE using a Visual Studio generator. * The respective arch and Instruction set macros are set automatically based on the Visual Studio macros $(INSTRUCTIONSET) $(ARCHFAM) and $(_ARCHFAM_) but only when generating with a Visual Studio Generator. |
(0016030) Andreas Pokorny (reporter) 2009-04-15 12:44 |
PS: just discovered a bug. For some reason INSTURCTIONSET ARCHFAM and _ARCHFAM_ is only set of C++ but not for C projects. |
(0016050) Andreas Pokorny (reporter) 2009-04-17 09:46 |
Fixed the bugs mentioned above. I improved the patch, now you do not need a toolchain file. The SDK Generators do all important settings on their own. Can I delete the old patches? Or mark the most current one? |
(0016053) Alex Neundorf (developer) 2009-04-18 13:18 |
Wow, this is a big patch ! I'll split it into multiple smaller ones. Alex |
(0016054) Alex Neundorf (developer) 2009-04-18 13:44 |
Ok, I've split it into four smaller patches. ---------------------------------- devenv-before-VCExpress.cmake: Andreas: what's the reason for changing the search order of devenv and VCExpress ? Brad, Bill: can you please have a look whether the changed order is ok to commit ? ---------------------------------- wince-cmakefiles-support.patch It seems you removed setting CMAKE_CL_64 ? I think this has to stay for compatibility reasons, somebody may use this in its cmake files. Are the cross compiler also named "cl.exe" or do they have some prefix/suffix ? Are they recognized as the MS compilers at the beginning of the cmake run, i.e. when it tries to determine the compiler id ? This is done by compiling Modules/CMakeCCompilerId.c.in. Is _MSC_VER defined for the cross compilers ? If so, I would suggest to name the file not WinCE-cl.cmake, but use the "compiler id"-style names, i.e. WinCE-MSVC-C.cmake and WinCE-MSVC-CXX.cmake. Why do you have this code: + IF(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") + ELSE(CMAKE_CL_MACHINE_TYPE) + SET (CMAKE_EXE_LINKER_FLAGS_INIT + "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") + ENDIF(CMAKE_CL_MACHINE_TYPE) Can you for that case just set CMAKE_CL_MACHINE_TYPE to "i386" so we don't need this if() here. Beside that I think this part looks good. With this patch it should already be possible to generate a makefile-based project for WinCE ? ----------------------------- wince-generators.patch: can you please split this patch into smaller even smaller ones ? E.g. a first one which introduces the factory, and why introduced this factory. To the coding style: -max line length is 79 characters -there must be no tabs at all in the code (otherwise the commit hook doesn't permit committing) -indentation always using 2 spaces -the curly braces are already indented E.g.: int DoSomething() { if (foo) { printf("hello world\n"); } return 0; } ----------------------------- wince-tests.patch I didn't have a closer look, it seems to be quite comprehensive already. Alex |
(0016055) Andreas Pokorny (reporter) 2009-04-18 15:00 |
---------------------------------- devenv-before-VCExpress.cmake: If both are installed, VCExpress is chosen. Then for example try_compile will fail because vcexpress cannot handle Platform tags in the vcproj files. The change only affects people that have both (me :-) ). Most people wont have both. ---------------------------------- wince-cmakefiles-support.patch > It seems you removed setting CMAKE_CL_64? This happened probably by accident. > Are the cross compiler also named "cl.exe" or do they have some prefix/suffix ? Yes since 2005 they are named cl. Only EVC had an architecture suffix. > Are they recognized as the MS compilers at the beginning of the cmake run, i.e. when it tries to determine the compiler id ? > This is done by compiling Modules/CMakeCCompilerId.c.in. Is _MSC_VER defined for the cross compilers ? > If so, I would suggest to name the file not WinCE-cl.cmake, but use the "compiler id"-style names, i.e. WinCE-MSVC-C.cmake and WinCE-MSVC-CXX.cmake. Yes they behave exactly like the orignial compiler. I think the link.exe is even the same binary. > Why do you have this code: > + IF(CMAKE_CL_MACHINE_TYPE) > + SET (CMAKE_EXE_LINKER_FLAGS_INIT > + "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${CMAKE_CL_MACHINE_TYPE}") > + ELSE(CMAKE_CL_MACHINE_TYPE) > + SET (CMAKE_EXE_LINKER_FLAGS_INIT > + "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:i386") > + ENDIF(CMAKE_CL_MACHINE_TYPE) Initially I thought I would not evaluate the CMAKE_CL_MACHINE_TYPE when we run the Visual Studio generator, so I thought it might be undefined. But I changed that in the last patches. Thanks for cleaning that up. > With this patch it should already be possible to generate a makefile-based project for WinCE ? Yes, with a toolchain file. Similar to the VS SDK Generators, we could also provide a new NMake SDK Generator that even sets the required environment variables for cl and link.exe. The correct contents for the environment can also be found in the WCEplatform.config.xml. ----------------------------- wince-generators.patch: > can you please split this patch into smaller even smaller ones ? > E.g. a first one which introduces the factory, and why introduced this factory. The two new generators required a constructor parameter. It only simpified the init of the Generator. Do you have a tool to enforce the indenting? Or maybe a Vim cinoptions setting? I do not have access to windows / cl during the weekend. |
(0016056) Andreas Pokorny (reporter) 2009-04-18 15:05 |
Regarding NMake Makefiles for WinCE. Is it possible to modify the environment variables within NMake? |
(0016057) Alex Neundorf (developer) 2009-04-18 15:15 |
Is there a shortcut to automatically start a cmd.exe with the env. vars. set up correctly for the intended build ? That's how it is recommended for using nmake for building native targets, if this also exists for cross compiling we should just recommend running cmake and nmake from such a shell. Alex |
(0016084) Andreas Pokorny (reporter) 2009-04-20 12:57 |
Just checked again. No batch file for CE is provided. You have to write your own env batch file, based on the WCE.VCPlatform.config. |
(0016090) Alex Neundorf (developer) 2009-04-20 16:57 |
Could you avoid the problem with VCExpress and devenv by checking which one was found and only generate these tags if it wasn't VCExpress ? Alex |
(0016091) Alex Neundorf (developer) 2009-04-20 16:57 |
Does this mean that VCExpress doesn't support crosscompiling ? Alex |
(0016095) Andreas Pokorny (reporter) 2009-04-21 03:09 |
VCExpress does not support crosscompiling. But you can have both installed and they can have the same $(VSInstalldir), and the user has not means to select which one should be used by CMake. |
(0016100) Andreas Pokorny (reporter) 2009-04-21 05:29 |
Just discovered that the visual studio dlls required to run cl or dumpbin are not part of the PATH, hence the patched version of cmake only works from the developer shell. |
(0016101) Andreas Pokorny (reporter) 2009-04-21 06:03 |
I could fix that by: 1. not executing the CL-Machine Type test unless generating for NMake. 2. setting the CMAKE_CL_MACHINE_TYPE for VS out of the SDK config. 3. If nothing is set CMAKE_CL_MACHINE_TYPE would default to i386, unless forced to 64bit. Or do you have another idea how I could ensure that dumpbin.exe is executeable? |
(0016113) Alex Neundorf (developer) 2009-04-21 09:56 |
> ... hence the patched version of cmake only works from the developer shell. Didn't you say that there is no batch file for WinCE ? In general, there should be no regression compared to the present state. Right now cmake executed not from a developer shell works for the Visual Studio generators, but not for nmake, right ? And this also is able to detect 32 and 64 bit builds, right ? This functionality must be preserved. I think for cross compiling still CMAKE_SYSTEM_NAME should be preset (to "WinCE"). This will cause CMake to "know" that it is cross compiling, and e.g. warn about TRY_RUN()s etc. It will also make the variable CMAKE_CROSSCOMPILING be set to TRUE. So e.g. when you look for devenv and VCExpress, you could do: set(possibleTools devenv) if(NOT CMAKE_CROSSCOMPILING) set(possibleTools ${possibleTools} VCExpress) endif(NOT CMAKE_CROSSCOMPILING) find_program(... ${possibleTools} ... ) etc. Maybe you also only need the dumpbin stuff if CMAKE_CROSSCOMPILING ? At least the 64bit-detection must still work as good as it does today. Another idea: once you found devenv, maybe you can set the env.var. PATH before executing dumpbin so it finds the necessary dlls ? This can be done via set(ENV{PATH} c:/some/location) execute_process( ... dumpbin ...) Alex |
(0016117) Andreas Pokorny (reporter) 2009-04-21 10:34 |
Btw: I did not manage to rename WinCE-cl.cmake to WinCE-MSVC-C.cmake. If I do so I run into a hen-egg problem, because the contents of WinCE-cl.cmake and Windows-cl.cmake were acutally evaluating settings required to build and link a simple c program. So I have to ensure that the cmake files are executed prior to CMakeTestCCompiler.cmake. |
(0016119) Andreas Pokorny (reporter) 2009-04-21 11:43 |
> Another idea: > once you found devenv, maybe you can set the env.var. PATH before executing dumpbin so it finds the necessary dlls ? > This can be done via > set(ENV{PATH} c:/some/location) > execute_process( ... dumpbin ...) Wow - saved my day! I now have nicely indented clean version of CMake. Will create a new patch tomorrow. |
(0016212) Andreas Pokorny (reporter) 2009-04-28 09:27 |
This is the split up version of the patch. I also made some cleanups .. removed uncessary code that showed up in previous versions of the SDK generators. |
(0016266) Alex Neundorf (developer) 2009-04-30 08:32 |
Why do you change the order of the search directories in devenv-before-VCExpress-2.patch ? wince-cmakefiles-support-2.patch: instead of IF(NOT CMAKE_DUMPBIN STREQUAL CMAKE_DUMPBIN-NOTFOUND) you can simply write: IF(NOT CMAKE_DUMPBIN) Beside that, I think we'll put the first two patches to test RSN. We'll deal with the generator patches will come after that. Alex |
(0016269) Andreas Pokorny (reporter) 2009-04-30 10:06 |
I thought it makes more sense that way. The .NET paths are common for Visual Studio 2003, and I assumed the order specifies a preference. |
(0016363) Alex Neundorf (developer) 2009-05-09 18:45 |
I don't have Windows here... Why should the other directories be preferred over the ones from Visual Studio 2003 ? Alex P.S. I already committed the part of the patch which changes the order of devenv and VCExpress. |
(0016364) Alex Neundorf (developer) 2009-05-09 18:55 |
about wince-cmakefiles-support-2.patch : I think setting WIN32 and WINCE in WinCE-cl.cmake is unnecessary, since this is already done in WinCE.cmake. OTOH I think setting CMAKE_WINDOWS_STACKSIZE in WinCE.cmake is unnecessary, since you do this also in WinCE-cl.cmake (where it fits better IMO). In Windows-cl.cmake: when using FIND_PROGRAM() to find dumpbin, would it make sense to somehow use the path from CMAKE_C_COMPILER or CMAKE_CXX_COMPILER as a hint where to find dumpbin ? There is a typo: "assuimg" Can you please check these issues ? I think then we can give it a test drive. Alex |
(0016368) Andreas Pokorny (reporter) 2009-05-11 05:57 |
Agreed. Agreed Regarding dumpbin: I wanted to do that, but had problems getting it done. It would be directoryof(CMAKE_C_COMPILER) or directoryof(CMAKE_C_COMPILER)/../../bin. Shall I send an update? |
(0016369) Alex Neundorf (developer) 2009-05-11 06:02 |
Yes, please :-) And, why should the other directories be preferred over the ones from Visual Studio 2003 ? (I don't have any Windows around) Alex |
(0016370) Andreas Pokorny (reporter) 2009-05-11 08:55 |
Well I think the script shouldnt even look in vs7.1 or vs8.0 directories when actually looking for vs9. Maybe the script is also used in a different context, so I just moved the common vs7.1 and vs8.0 behind the vs9 paths. If the generator produces vs9 project files, but the script searching for devenv finds a vs7 or vs8, compiling will fail. While the other way round should work. I believe vs9 can convert vcproj files of previous versions. |
(0016394) Andreas Pokorny (reporter) 2009-05-12 06:13 |
I just read the doc of find_program paying more attention to the steps of the search algorithm. Now i think the file should look like that: FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES devenv VCExpress HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path] "$ENV{ProgramFiles}/Microsoft Visual Studio 9.0/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio9.0/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio 9/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio9/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9.0/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9.0/Common7/IDE" "/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/" PATHS "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE" ) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC90 1) SET(MSVC_VERSION 1500) The "valid" paths are now in HINTS instead of PATHS, because the installer of visual studio tends to pollute the path environment variable. Since many people have multiple visual studio and or express versions installed the %PATH% variable is very likely to point to the wrong devenv executeable. |
(0016406) Alex Neundorf (developer) 2009-05-12 14:54 |
Could you please attach this as a ready-to-apply patch against HEAD so I can just forward it to the Windows-using cmake developers ? Thanks Alex |
(0016481) Andreas Pokorny (reporter) 2009-05-15 12:43 |
There is the update .. at last. We are in a quite chaotic phase.. |
(0016562) Alex Neundorf (developer) 2009-05-25 18:49 |
I updated the patch to current HEAD. I also kept all paths for VS9 which contain just the "9" and not only the ones containing "9.0". How does it look ? Alex |
(0016563) Andreas Pokorny (reporter) 2009-05-26 03:43 |
Looks fine.. |
(0016768) Alex Neundorf (developer) 2009-06-28 06:09 |
Ok, the devenv-before-VCExpress patch and the devenv.modified_search_order patch have been committed, next is wince-cmakefiles-support. Alex |
(0016775) Brad King (manager) 2009-06-29 10:35 |
The execute_process calls for cl and dumpbin may not be necessary. There is already a framework in place for detecting the target architecture. Currently it is used mostly for detecting sizeof(void*) but on the SGI it also detects o32, n32, and 64-bit ABIs. Look at the CMakeDetermineCompilerABI.cmake module and the CMakeCompilerABI.h header file. They use the C preprocessor to detect information about the target. It should be simple to add "INFO:machine[...]". |
(0016776) Andreas Pokorny (reporter) 2009-06-29 11:58 |
I havent found any preprocessor macros defined by CL yet, that would identify the architecture apart from just x86 vs x86_64. |
(0016777) Brad King (manager) 2009-06-29 12:09 |
http://msdn.microsoft.com/en-us/library/b0084kay(VS.80).aspx [^] _M_IX86 - Defined for x86 processors. _M_X64 - Defined for x64 processors. There also seems to be an undocumented "_M_AMD64". |
(0016781) Andreas Pokorny (reporter) 2009-06-30 03:21 |
If there is also _M_ARM _M_SH and _M_MIPS.. ... just checked .. There is _M_ARM _M_SH and _M_MIPS! Yay! Now that I know the names, google helped to find some docs (not all of them are documented, i.e. there is nothing about _M_MIPS): http://msdn.microsoft.com/en-us/library/aa448763.aspx [^] http://msdn.microsoft.com/en-us/library/ms253537.aspx [^] So we have: _M_IX86 _M_ARM armv4 and higher _M_ARMT armv4 with thumb mode _M_SH any renesas/SH _M_PPC _M_AMD64 _M_X64 _M_SH_REV arch revision of sh _M_MIPS Mips has lots of variants that can be controlled via /QMmipsNN but i could not detect them via the preprocessor yet. There is no _M_MIPS_REV defined. How is the machine string extracted? Do I need to link the header file to an executeable, or is a plain object file enough? |
(0016784) Brad King (manager) 2009-06-30 09:20 |
It's exctracted by file(STRINGS) in the Modules/CMakeDetermineCompilerABI.cmake module. What I'm proposing is to modify that module to also look for INFO:machine and to set a variable like CMAKE_${lang}_COMPILER_ARCHITECTURE. This is not a WinCE-specific solution but a general one. |
(0016785) Andreas Pokorny (reporter) 2009-06-30 10:29 |
Looks simple so far. Then where would I do things like adding /MACHINE:FOOBAR to the linker flags? At the moment I do that inside Windows-cl.cmake. |
(0016786) Brad King (manager) 2009-06-30 11:07 |
Ugh, that makes it not simple. There is a chicken-and-egg problem caused by the low granularity of the CMake platform files. The CMakeDetermineCompilerABI.cmake module gets loaded by CMakeTest(LANG)Compiler.cmake which runs *after* Windows-cl.cmake, so it is too late (the purpose of the CMakeTest(LANG)Compiler.cmake module is to make sure CMake knows how to generate build rules for the target platform, which it doesn't know until after Windows-cl.cmake is loaded). The compiler-specific files like Windows-cl.cmake were originally supposed to only *provide* memorized information, rather than *detect* it. This is the second time recently I've encountered a case where that design is not sufficient, but it cannot be addressed without a major overhaul of the platform configuration rules. Fortunately it may not be necessary to specify /machine at all: http://msdn.microsoft.com/en-us/library/5wy54dk2(VS.71).aspx [^] I think the only reason we started passing /machine is because that's what the VS IDE does. We could probably just take it out. |
(0016787) Andreas Pokorny (reporter) 2009-06-30 11:43 |
I have to check whether I can really skip this flag for ARM/THUMB. I believe that I had to add it for some strange reason. |
(0016955) Andreas Pokorny (reporter) 2009-07-24 03:31 |
Can we somehow avoid the link step in try_compile? And extract the ABI info from the object file? |
(0016982) Alex Neundorf (developer) 2009-07-28 09:46 |
No. try_compile() always creates an executable. So it's actually more a try_compile_and_link(). Maybe something could be added so that it try_compile() tries to build a statis library instead of an executable. Alex |
(0016983) Andreas Pokorny (reporter) 2009-07-28 10:55 |
For the checks that we plan to do, running only the preprocessor would be already sufficient. |
(0016984) Brad King (manager) 2009-07-28 11:06 |
Actually it is possible to build a static library with try_compile if you use the signature that accepts a pre-made source tree. However, it doesn't matter in this case. The Windows-cl.cmake platform file is too early to run try_compile. That file is supposed to provide information that CMake uses to implement try_compile. Until we resolve the chicken-and-egg problem I mention above, I think running the preprocessor with execute_process will be the easiest solution. The main thing I want to avoid is running dumpbin since it needs help to find its DLLs. Using the preprocessor makes this unnecessary. |
(0017405) Alex Neundorf (developer) 2009-09-12 02:18 |
What's the current state here ? Alex |
(0017409) Andreas Pokorny (reporter) 2009-09-12 06:56 |
I am quite busy at work right now, since the solution is already working nobody complained, hence I can only invest free time. Anyhow the last thing I did, was looking for a generic way of executing the preprocessor instead of try_compile. ... |
(0017732) Andreas Pokorny (reporter) 2009-09-23 11:46 |
What do you think about taking this code as-is, and refactoring it later? |
(0019779) Sebastian Herbst (reporter) 2010-03-09 14:39 |
I updated the patches for wince generator support to cmake 2.8.0. and attached the patches 'git format-patch' produced. |
(0022022) David Cole (manager) 2010-08-31 15:26 |
We will not be addressing this for the upcoming CMake 2.8.3 release. The groundwork for this issue is being laid, but it will not be "finished enough" for inclusion in the 2.8.3 release. |
(0024487) David Cole (manager) 2011-01-06 16:35 |
Punting once more into a future release. We are too close to 2.8.4 to even have time to *talk* about this one enough before rc1... Unsetting "target version" field. |
(0026580) Alex Neundorf (developer) 2011-05-25 16:12 |
I can't do more for this one, so I'm un-assigning it. I think Brad wanted to have some things changed, and to actually get it into cmake, it needs somebody who has the SDK actually installed (which is not me). Alex |
(0027053) Andreas Pokorny (reporter) 2011-07-18 08:21 |
I would like to point out that one can easily download a standard wince5 sdk here: http://www.microsoft.com/download/en/details.aspx?id=17310 [^] Furthermore there are WinCE6 SDKs available at chip/board vendors, like FreeScale, Nvidia ... Since 2008 we are using CMake in our company with these patches applied. We also provide source code examples with our software. So we would also like to provide CMake build files as simple solution to our customers... |
(0027854) tomdeblauwe (reporter) 2011-11-23 17:28 |
Is there a chance any of this will make it into the next release? |
(0027857) Brad King (manager) 2011-11-28 11:35 |
Re 0007919:0027854: IIRC there are some implementation problems with the patches that have not been addressed. See 0007919:0016984 and 0007919:0017409. Further progress will require a volunteer to rebase the patches on master and resolve the concerns already discussed. |
(0031258) Artem (reporter) 2012-10-18 07:01 |
Hello, What is the current state for the bug ? Is there another bug according WinCE that will appear in the next release ? I've got task to get cmake support WinCE in stock. And I've found that the bug is the most actual one targeting my task. So, am I right that the bug is the most completed and almost ready for release except some issues mentioned by Brad King ? |
(0031273) Brad King (manager) 2012-10-18 11:41 |
Several separate efforts have been made on this front. Some progress has been made elsewhere but I do not know how much of this issue it addresses. There were some minimal WindowsCE platform files contributed recently: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7cb8055 [^] http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28d744c9 [^] See related discussion threads on the developers list here: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/4328 [^] http://www.cmake.org/pipermail/cmake-developers/2012-September/005168.html [^] It left off with discussion of additional patches to get VS IDE generator support working that have not been finished to the point of acceptance. |
(0031315) Artem (reporter) 2012-10-25 08:49 edited on: 2012-10-25 08:52 |
I've found out that this three patches are enough for my project. It is totally Patrick Gansterer's work from his parogas-cmake/wince project with little modifications during rebasing to the current next. Is it good start point for windows ce support in the cmake ? If so, what is the next step ? Should I become maintainer and add this patches to the windows-ce topic that already exists or create new one ? |
(0031317) Brad King (manager) 2012-10-25 08:53 |
Re 0007919:0031315: Please join the developer's list: http://www.cmake.org/cgi-bin/mailman/listinfo/cmake-developers [^] and post asking about reviving the rest of Patrick's topic. IIRC the main remaining problem was how to tell CMake's VS IDE generators what architecture to use up front so it could locate the appropriate pieces of the toolchain. |
(0031750) Brad King (manager) 2012-11-28 16:10 |
Patrick Gansterer's work has been merged to master: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=581b0c0d [^] It is now possible to use NMake, VS 8, or VS 9 to build for WinCE. |
(0034032) Robert Maynard (manager) 2013-10-07 10:09 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2008-11-03 05:57 | Andreas Pokorny | New Issue | |
2008-11-03 05:57 | Andreas Pokorny | File Added: modules.patch | |
2008-11-05 17:39 | Bill Hoffman | Status | new => assigned |
2008-11-05 17:39 | Bill Hoffman | Assigned To | => Alex Neundorf |
2008-11-05 17:48 | Alex Neundorf | Note Added: 0014039 | |
2008-11-05 17:50 | Alex Neundorf | Note Added: 0014040 | |
2008-11-10 07:21 | Andreas Pokorny | Note Added: 0014079 | |
2008-11-10 10:09 | Andreas Pokorny | File Added: modules_2.patch | |
2008-12-15 09:26 | Andreas Pokorny | Note Added: 0014336 | |
2008-12-15 10:03 | Andreas Pokorny | File Added: modules_3.patch | |
2008-12-15 10:03 | Andreas Pokorny | Note Added: 0014337 | |
2008-12-15 17:10 | Alex Neundorf | Note Added: 0014355 | |
2009-01-10 09:40 | Alex Neundorf | Category | CMake => Modules |
2009-01-10 10:01 | Alex Neundorf | Note Added: 0014524 | |
2009-02-11 12:57 | Brad King | Relationship added | related to 0008486 |
2009-02-24 09:04 | Andreas Pokorny | Note Added: 0015324 | |
2009-04-15 12:37 | Andreas Pokorny | File Added: WinCESupport.patch | |
2009-04-15 12:41 | Andreas Pokorny | Note Added: 0016029 | |
2009-04-15 12:44 | Andreas Pokorny | Note Added: 0016030 | |
2009-04-16 11:52 | Andreas Pokorny | File Added: WinCESupportGeneratorSelection.patch | |
2009-04-17 09:45 | Andreas Pokorny | File Added: WinCENoToolchainFile.patch | |
2009-04-17 09:46 | Andreas Pokorny | Note Added: 0016050 | |
2009-04-18 13:18 | Alex Neundorf | Note Added: 0016053 | |
2009-04-18 13:26 | Alex Neundorf | File Added: devenv-before-VCExpress.patch | |
2009-04-18 13:26 | Alex Neundorf | File Added: wince-cmakefiles-support.patch | |
2009-04-18 13:27 | Alex Neundorf | File Added: wince-generators.patch | |
2009-04-18 13:27 | Alex Neundorf | File Added: wince-tests.patch | |
2009-04-18 13:44 | Alex Neundorf | Note Added: 0016054 | |
2009-04-18 15:00 | Andreas Pokorny | Note Added: 0016055 | |
2009-04-18 15:05 | Andreas Pokorny | Note Added: 0016056 | |
2009-04-18 15:15 | Alex Neundorf | Note Added: 0016057 | |
2009-04-20 12:57 | Andreas Pokorny | Note Added: 0016084 | |
2009-04-20 16:57 | Alex Neundorf | Note Added: 0016090 | |
2009-04-20 16:57 | Alex Neundorf | Note Added: 0016091 | |
2009-04-21 03:09 | Andreas Pokorny | Note Added: 0016095 | |
2009-04-21 05:29 | Andreas Pokorny | Note Added: 0016100 | |
2009-04-21 06:03 | Andreas Pokorny | Note Added: 0016101 | |
2009-04-21 09:56 | Alex Neundorf | Note Added: 0016113 | |
2009-04-21 10:34 | Andreas Pokorny | Note Added: 0016117 | |
2009-04-21 11:43 | Andreas Pokorny | Note Added: 0016119 | |
2009-04-28 09:23 | Andreas Pokorny | File Added: devenv-before-VCExpress-2.patch | |
2009-04-28 09:23 | Andreas Pokorny | File Added: wince-cmakefiles-support-2.patch | |
2009-04-28 09:24 | Andreas Pokorny | File Added: generator-factory.patch | |
2009-04-28 09:24 | Andreas Pokorny | File Added: wince-generators-2.patch | |
2009-04-28 09:24 | Andreas Pokorny | File Added: wince-tests-2.patch | |
2009-04-28 09:27 | Andreas Pokorny | Note Added: 0016212 | |
2009-04-30 08:32 | Alex Neundorf | Note Added: 0016266 | |
2009-04-30 10:06 | Andreas Pokorny | Note Added: 0016269 | |
2009-05-09 18:45 | Alex Neundorf | Note Added: 0016363 | |
2009-05-09 18:55 | Alex Neundorf | Note Added: 0016364 | |
2009-05-11 05:57 | Andreas Pokorny | Note Added: 0016368 | |
2009-05-11 06:02 | Alex Neundorf | Note Added: 0016369 | |
2009-05-11 08:55 | Andreas Pokorny | Note Added: 0016370 | |
2009-05-12 06:13 | Andreas Pokorny | Note Added: 0016394 | |
2009-05-12 14:54 | Alex Neundorf | Note Added: 0016406 | |
2009-05-15 12:42 | Andreas Pokorny | File Added: devenv-before-VCExpress-3.patch | |
2009-05-15 12:43 | Andreas Pokorny | Note Added: 0016481 | |
2009-05-25 18:48 | Alex Neundorf | File Added: devenv.modified_search_order.patch | |
2009-05-25 18:49 | Alex Neundorf | Note Added: 0016562 | |
2009-05-26 03:43 | Andreas Pokorny | Note Added: 0016563 | |
2009-05-26 17:40 | Alex Neundorf | File Added: wince-cmakefiles-supprt-3.patch | |
2009-06-05 13:05 | David Cole | Relationship added | related to 0008102 |
2009-06-28 06:09 | Alex Neundorf | Note Added: 0016768 | |
2009-06-29 10:35 | Brad King | Note Added: 0016775 | |
2009-06-29 11:58 | Andreas Pokorny | Note Added: 0016776 | |
2009-06-29 12:09 | Brad King | Note Added: 0016777 | |
2009-06-30 03:21 | Andreas Pokorny | Note Added: 0016781 | |
2009-06-30 09:20 | Brad King | Note Added: 0016784 | |
2009-06-30 10:29 | Andreas Pokorny | Note Added: 0016785 | |
2009-06-30 11:07 | Brad King | Note Added: 0016786 | |
2009-06-30 11:43 | Andreas Pokorny | Note Added: 0016787 | |
2009-07-24 03:31 | Andreas Pokorny | Note Added: 0016955 | |
2009-07-28 09:46 | Alex Neundorf | Note Added: 0016982 | |
2009-07-28 10:55 | Andreas Pokorny | Note Added: 0016983 | |
2009-07-28 11:06 | Brad King | Note Added: 0016984 | |
2009-09-12 02:18 | Alex Neundorf | Note Added: 0017405 | |
2009-09-12 06:56 | Andreas Pokorny | Note Added: 0017409 | |
2009-09-23 11:46 | Andreas Pokorny | Note Added: 0017732 | |
2010-03-09 14:37 | Sebastian Herbst | File Added: 0001-applied-adapted-generator-factory.patch.patch | |
2010-03-09 14:37 | Sebastian Herbst | File Added: 0002-applied-wince-generators-2.patch.patch | |
2010-03-09 14:37 | Sebastian Herbst | File Added: 0003-applied-wince-cmakefiles-supprt-3.patch.patch | |
2010-03-09 14:39 | Sebastian Herbst | Note Added: 0019779 | |
2010-08-31 15:26 | David Cole | Note Added: 0022022 | |
2010-11-10 13:01 | David Cole | Target Version | => CMake 2.8.4 |
2011-01-06 16:35 | David Cole | Note Added: 0024487 | |
2011-01-06 16:36 | David Cole | Target Version | CMake 2.8.4 => |
2011-05-25 16:12 | Alex Neundorf | Note Added: 0026580 | |
2011-05-25 16:12 | Alex Neundorf | Assigned To | Alex Neundorf => |
2011-05-25 16:12 | Alex Neundorf | Status | assigned => backlog |
2011-07-18 08:21 | Andreas Pokorny | Note Added: 0027053 | |
2011-11-23 17:28 | tomdeblauwe | Note Added: 0027854 | |
2011-11-28 11:35 | Brad King | Note Added: 0027857 | |
2012-10-18 07:01 | Artem | Note Added: 0031258 | |
2012-10-18 11:41 | Brad King | Note Added: 0031273 | |
2012-10-25 08:30 | Artem | File Added: 0001-Add-WindowsCE-defines-to-Windows-MSVC.cmake.patch | |
2012-10-25 08:31 | Artem | File Added: 0002-Added-cmGlobalGenerator-AddTryCompileCacheEntries.patch | |
2012-10-25 08:31 | Artem | File Added: 0003-Added-logic-for-CMAKE_WINCE_SDK-CacheEntry.patch | |
2012-10-25 08:49 | Artem | Note Added: 0031315 | |
2012-10-25 08:52 | Artem | Note Edited: 0031315 | |
2012-10-25 08:53 | Brad King | Note Added: 0031317 | |
2012-11-28 16:10 | Brad King | Note Added: 0031750 | |
2012-11-28 16:10 | Brad King | Assigned To | => Brad King |
2012-11-28 16:10 | Brad King | Status | backlog => resolved |
2012-11-28 16:10 | Brad King | Resolution | open => fixed |
2012-11-28 16:10 | Brad King | Fixed in Version | => CMake 2.8.11 |
2012-11-28 16:10 | Brad King | Target Version | => CMake 2.8.11 |
2012-11-28 16:12 | Brad King | Relationship replaced | has duplicate 0008102 |
2013-04-15 09:49 | Brad King | Relationship added | related to 0014083 |
2013-04-15 10:55 | Brad King | Relationship added | related to 0014088 |
2013-10-07 10:09 | Robert Maynard | Note Added: 0034032 | |
2013-10-07 10:09 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |