diff options
author | Gilles Khouzam <gillesk@microsoft.com> | 2014-08-28 13:53:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-09-02 14:17:03 (GMT) |
commit | 39fefde25d49b92d8b03eaf13c1b39478e053140 (patch) | |
tree | a1925ec988526102f94e97f5f3aecc1f95530a20 /Tests/VSWinStorePhone/CMakeLists.txt | |
parent | 89da84657a250b1a1510f49180abc886148facd0 (diff) | |
download | CMake-39fefde25d49b92d8b03eaf13c1b39478e053140.zip CMake-39fefde25d49b92d8b03eaf13c1b39478e053140.tar.gz CMake-39fefde25d49b92d8b03eaf13c1b39478e053140.tar.bz2 |
VS: Add test case for Windows Phone and Windows Store
Add tests to build for each version of each system when the
corresponding tools are available.
Diffstat (limited to 'Tests/VSWinStorePhone/CMakeLists.txt')
-rw-r--r-- | Tests/VSWinStorePhone/CMakeLists.txt | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt new file mode 100644 index 0000000..0041c75 --- /dev/null +++ b/Tests/VSWinStorePhone/CMakeLists.txt @@ -0,0 +1,114 @@ +cmake_minimum_required(VERSION 3.0) +project(VSWinStorePhone) + +if(MSVC_VERSION GREATER 1700) + set(COMPILER_VERSION "12") +elseif(MSVC_VERSION GREATER 1600) + set(COMPILER_VERSION "11") +endif() + +set (APP_MANIFEST_NAME Package.appxmanifest) +if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") + set(PLATFORM WP) + add_definitions("-DPHONE") + if("${CMAKE_SYSTEM_VERSION}" STREQUAL "8.0") + set(APP_MANIFEST_NAME WMAppManifest.xml) + set(WINDOWS_PHONE8 1) + endif() +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") + set(PLATFORM STORE) +else() + set(PLATFORM DESKTOP) + message(FATAL_ERROR "This app supports Store / Phone only. Please edit the target platform.") +endif() + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set(EXE_NAME Direct3DApp1) +set(SHORT_NAME ${EXE_NAME}) +set(PACKAGE_GUID "6514377e-dfd4-4cdb-80df-4e0366346efc") + +if (NOT "${PLATFORM}" STREQUAL "DESKTOP") + configure_file( + cmake/Package_vc${COMPILER_VERSION}.${PLATFORM}.appxmanifest.in + ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME} + @ONLY) +endif() + +set(SOURCE_FILES + Direct3DApp1/CubeRenderer.cpp + Direct3DApp1/Direct3DApp1.cpp + Direct3DApp1/Direct3DBase.cpp + Direct3DApp1/pch.cpp + ) + +set(HEADER_FILES + Direct3DApp1/BasicTimer.h + Direct3DApp1/CubeRenderer.h + Direct3DApp1/Direct3DApp1.h + Direct3DApp1/Direct3DBase.h + Direct3DApp1/DirectXHelper.h + Direct3DApp1/pch.h + ) + +set(PIXELSHADER_FILES + Direct3DApp1/SimplePixelShader.hlsl + ) + +set(VERTEXSHADER_FILES + Direct3DApp1/SimpleVertexShader.hlsl + ) + +set(CONTENT_FILES ${PIXELSHADER_FILES} ${VERTEXSHADER_FILES}) + +if (WINDOWS_PHONE8) + set(CONTENT_FILES ${CONTENT_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME} + Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png + Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png + Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png + Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png + Direct3DApp1/Assets/Tiles/IconicTileSmall.png + Direct3DApp1/Assets/ApplicationIcon.png + ) + # Windows Phone 8.0 needs to copy all the images. + # It doesn't know to use relative paths. + file(COPY + Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png + Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png + Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png + Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png + Direct3DApp1/Assets/Tiles/IconicTileSmall.png + Direct3DApp1/Assets/ApplicationIcon.png + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} + ) + +elseif (NOT "${PLATFORM}" STREQUAL "DESKTOP") + set(CONTENT_FILES ${CONTENT_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME} + Direct3DApp1/Assets/Logo.png + Direct3DApp1/Assets/SmallLogo.png + Direct3DApp1/Assets/SplashScreen.png + Direct3DApp1/Assets/StoreLogo.png + ) +endif() + +set(RESOURCE_FILES + ${CONTENT_FILES} ${DEBUG_CONTENT_FILES} ${RELEASE_CONTENT_FILES} + Direct3DApp1/Direct3DApp1_TemporaryKey.pfx) + +set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${DEBUG_CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT $<CONFIG:Debug>) +set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY + VS_DEPLOYMENT_CONTENT $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>) + +set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel) +set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_TYPE Vertex) + +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +source_group("Resource Files" FILES ${RESOURCE_FILES}) + +add_executable(${EXE_NAME} WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES}) +set_property(TARGET ${EXE_NAME} PROPERTY VS_WINRT_COMPONENT TRUE) +target_link_libraries(${EXE_NAME} d3d11) |