8b6148cf97
* MacOSX with input events and mfb_set_viewport * Windows with input events and mfb_set_viewport * Minor changes in macosx and windows * X11 with input and mfb_set_viewport * Minor changes on X11 * Fix bug in X11 resize event * Fix bug in windows resize * added scale image to X11 * Added stretch_image with & without bilinear interpolation * moved MiniFB_internal.h * Added wayland events * minor changes * unify a bit the window structs * More work on wayland * Added cmake file * minor fix on windows * modified test * Fix on wayland. Unset wayland as default for linux * Use stdbool instead of our own macro eBool Remove prefix e from all enums * Remove _ex sufix in common files * merge X11MiniFB_ex.c into X11MiniFB.c * Merge WaylandMiniFB_ex.c into WaylandMiniFB.c * Add user_data to callbacks * Merge WinMiniFB_ex.c into WinMiniFB.c * Some minor changes on Windows * Fix bug on Wayland * Added mfb_get_key_name * keyboard_default on all platforms
76 lines
2.1 KiB
CMake
76 lines
2.1 KiB
CMake
cmake_minimum_required(VERSION 2.8.9)
|
|
project (noise)
|
|
|
|
include_directories(include src)
|
|
|
|
file(GLOB SrcLib "src/*.c"
|
|
"src/*.cpp"
|
|
"include/*.h")
|
|
file(GLOB SrcWindows "src/windows/*.c"
|
|
"src/windows/*.h")
|
|
file(GLOB SrcMacOSX "src/macosx/*.c"
|
|
"src/macosx/*.cpp"
|
|
"src/macosx/*.m"
|
|
"src/macosx/*.mm"
|
|
"src/macosx/*.h")
|
|
file(GLOB SrcWayland "src/wayland/*.c")
|
|
file(GLOB SrcX11 "src/x11/*.c")
|
|
|
|
if (NOT MSVC)
|
|
set (CMAKE_C_FLAGS "-g -Wall -Wextra -Wno-switch -Wno-unused-function")
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11")
|
|
set (CMAKE_OBJC_FLAGS "${CMAKE_C_FLAGS}")
|
|
set (CMAKE_OBJCXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
endif()
|
|
|
|
if (APPLE)
|
|
OPTION(USE_METAL_API "Build the project using metal API code" ON)
|
|
elseif (UNIX)
|
|
OPTION(USE_WAYLAND_API "Build the project using wayland API code" OFF)
|
|
endif()
|
|
|
|
if (MSVC)
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
add_definitions(-D_WIN32_WINNT=0x0600)
|
|
list (APPEND SrcLib ${SrcWindows})
|
|
elseif (MINGW)
|
|
add_definitions(-D_WIN32_WINNT=0x0600)
|
|
list(APPEND SrcLib ${SrcWindows})
|
|
elseif (APPLE)
|
|
if(USE_METAL_API)
|
|
add_definitions(-DUSE_METAL_API)
|
|
endif()
|
|
list(APPEND SrcLib ${SrcMacOSX})
|
|
elseif (UNIX)
|
|
if(USE_WAYLAND_API)
|
|
list(APPEND SrcLib ${SrcWayland})
|
|
else()
|
|
list(APPEND SrcLib ${SrcX11})
|
|
endif()
|
|
endif()
|
|
|
|
add_library(minifb STATIC
|
|
${SrcLib}
|
|
)
|
|
|
|
add_executable(noise
|
|
tests/noise.c
|
|
)
|
|
|
|
target_link_libraries(noise minifb)
|
|
|
|
if (MSVC)
|
|
elseif (MINGW)
|
|
elseif (APPLE)
|
|
target_link_libraries(noise "-framework Cocoa")
|
|
target_link_libraries(noise "-framework QuartzCore")
|
|
target_link_libraries(noise "-framework Metal")
|
|
target_link_libraries(noise "-framework MetalKit")
|
|
elseif (UNIX)
|
|
if(USE_WAYLAND_API)
|
|
target_link_libraries(noise -lwayland-client -lwayland-cursor)
|
|
else()
|
|
target_link_libraries(noise -lX11)
|
|
endif()
|
|
endif()
|