tests: Cmake changes for building on Windows

This commit is contained in:
Tony Barbour 2015-05-21 11:07:47 -06:00
parent 8b8671260e
commit c5e962974f
2 changed files with 31 additions and 27 deletions

View File

@ -23,31 +23,33 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
endif()
if (NOT WIN32)
# Hard code our LunarGLASS and glslang paths for now
get_filename_component(GLSLANG_PREFIX ../glslang ABSOLUTE)
get_filename_component(LUNARGLASS_PREFIX ../LunarGLASS ABSOLUTE)
# Hard code our LunarGLASS and glslang paths for now
get_filename_component(GLSLANG_PREFIX ../glslang ABSOLUTE)
get_filename_component(LUNARGLASS_PREFIX ../LunarGLASS ABSOLUTE)
if(NOT EXISTS ${GLSLANG_PREFIX})
message(FATAL_ERROR "Necessary glslang components do not exist: " ${GLSLANG_PREFIX})
endif()
if(NOT EXISTS ${GLSLANG_PREFIX})
message(FATAL_ERROR "Necessary glslang components do not exist: " ${GLSLANG_PREFIX})
endif()
if(NOT WIN32)
if(NOT EXISTS ${LUNARGLASS_PREFIX})
message(FATAL_ERROR "Necessary LunarGLASS components do not exist: " ${GLSLANG_PREFIX})
message(FATAL_ERROR "Necessary LunarGLASS components do not exist: " ${LUNARGLASS_PREFIX})
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(PYTHON_CMD "python3")
endif()
else()
set(PYTHON_CMD "py")
set(PYTHON_CMD "py")
endif()
option(BUILD_TESTS "Build tests" ON)
# loader: Generic VULKAN ICD loader
# icd: Device dependent (DD) VULKAN components
# tests: VULKAN tests
add_subdirectory(loader)
add_subdirectory(icd)
if (NOT WIN32)
if(BUILD_TESTS)
add_subdirectory(tests)
endif()
add_subdirectory(layers)

View File

@ -1,3 +1,4 @@
cmake_minimum_required(VERSION 2.8.11)
include (FindPkgConfig)
if(NOT WIN32)
@ -5,18 +6,19 @@ if(NOT WIN32)
endif()
find_package(ImageMagick COMPONENTS MagickWand)
if(NOT EXISTS /usr/include/glm/glm.hpp)
message(FATAL_ERROR "Necessary libglm-dev headers cannot be found: sudo apt-get install libglm-dev")
endif()
if(NOT ImageMagick_FOUND)
message(FATAL_ERROR "Missing ImageMagick library: sudo apt-get install libmagickwand-dev")
message(FATAL_ERROR "Missing ImageMagick library: sudo apt-get install libmagickwand-dev\nor http://www.imagemagick.org/script/binary-releases.php for Windows")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES -Wno-sign-compare")
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DVK_PROTOTYPES /wd4267")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES -Wno-sign-compare")
endif()
SET(COMMON_CPP
set (LIBGLM_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/libs)
set(COMMON_CPP
vkrenderframework.cpp
vktestbinding.cpp
vktestframework.cpp
@ -36,15 +38,14 @@ link_directories(
"${GLSLANG_BUILD}/install/lib"
)
set(TEST_LIBRARIES
glslang
OGLCompiler
OSDependent
SPIRV
${XCB_LIBRARIES}
${ImageMagick_LIBRARIES}
)
glslang
OGLCompiler
OSDependent
SPIRV
${XCB_LIBRARIES}
${ImageMagick_LIBRARIES}
)
include_directories(
"${PROJECT_SOURCE_DIR}/tests/gtest-1.7.0/include"
@ -54,6 +55,7 @@ include_directories(
"${GLSLANG_PREFIX}/glslang/Public"
"${GLSLANG_PREFIX}/SPIRV"
${XCB_INCLUDE_DIRS}
${LIBGLM_INCLUDE_DIR}
${ImageMagick_INCLUDE_DIRS}
)