set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

set(CMAKE_C_COMPILER           /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-posix )
set(CMAKE_C_COMPILER_AR        /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-ar-posix )
set(CMAKE_C_COMPILER_RANLIB    /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-ranlib-posix )
set(CMAKE_CXX_COMPILER         /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-g++-posix )
set(CMAKE_CXX_COMPILER_AR      /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-ar-posix )
set(CMAKE_CXX_COMPILER_RANLIB  /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-ranlib-posix )
set(CMAKE_ASM_NASM_COMPILER    /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-as )
set(CMAKE_RC_COMPILER          /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-windres)
set(CMAKE_OBJDUMP              /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-objdump)
add_definitions(-D_WIN32_WINNT=0x0A00 -D_GNU_SOURCE=1 -DNOWERROR=1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all")

list(APPEND CMAKE_PREFIX_PATH "/soft/windows")
SET(CMAKE_FIND_ROOT_PATH  /usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32 ${CMAKE_PREFIX_PATH}/lib)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY FIRST)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE FIRST)
include_directories(${CMAKE_PREFIX_PATH}/include)
set(OpenCL_INCLUDE_DIR ${CMAKE_PREFIX_PATH}/include)
set(OpenCL_LIBRARY ${CMAKE_PREFIX_PATH}/lib/opencl.lib)
