2015-08-18 18:00:24 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(libBoo)
|
|
|
|
|
2015-08-18 23:32:19 +00:00
|
|
|
if (NOT MSVC)
|
2015-10-20 02:23:55 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
2015-08-18 23:32:19 +00:00
|
|
|
endif()
|
|
|
|
|
2015-10-30 06:26:02 +00:00
|
|
|
if (NOT TARGET LogVisor)
|
|
|
|
add_subdirectory(LogVisor)
|
|
|
|
set(LOG_VISOR_INCLUDE_DIR LogVisor/include)
|
|
|
|
endif()
|
|
|
|
include_directories(include ${LOG_VISOR_INCLUDE_DIR})
|
|
|
|
|
2015-08-18 18:00:24 +00:00
|
|
|
if(WIN32)
|
|
|
|
list(APPEND PLAT_SRCS
|
2015-08-18 19:40:26 +00:00
|
|
|
lib/win/ApplicationWin32.cpp
|
|
|
|
lib/win/WindowWin32.cpp
|
2015-08-18 18:00:24 +00:00
|
|
|
lib/inputdev/HIDListenerWinUSB.cpp
|
2015-10-29 04:44:38 +00:00
|
|
|
lib/inputdev/HIDDeviceWinUSB.cpp
|
|
|
|
lib/graphicsdev/D3D11.cpp
|
|
|
|
lib/graphicsdev/D3D12.cpp
|
2015-10-31 04:28:21 +00:00
|
|
|
lib/graphicsdev/GL.cpp
|
|
|
|
lib/graphicsdev/glew.c)
|
2015-08-31 03:40:58 +00:00
|
|
|
list(APPEND _BOO_SYS_LIBS Winusb)
|
2015-08-18 18:00:24 +00:00
|
|
|
elseif(APPLE)
|
|
|
|
list(APPEND PLAT_SRCS
|
2015-08-18 19:40:26 +00:00
|
|
|
lib/mac/ApplicationCocoa.mm
|
|
|
|
lib/mac/WindowCocoa.mm
|
|
|
|
lib/mac/GLViewCocoa.mm
|
2015-08-18 18:00:24 +00:00
|
|
|
lib/inputdev/HIDListenerIOKit.cpp
|
2015-10-29 04:44:38 +00:00
|
|
|
lib/inputdev/HIDDeviceIOKit.cpp
|
2015-10-31 04:28:21 +00:00
|
|
|
lib/graphicsdev/GL.cpp
|
|
|
|
lib/graphicsdev/glew.c)
|
2015-09-02 19:09:13 +00:00
|
|
|
find_library(APPKIT_LIBRARY AppKit)
|
|
|
|
find_library(IOKIT_LIBRARY IOKit)
|
|
|
|
find_library(OPENGL_LIBRARY OpenGL)
|
|
|
|
list(APPEND _BOO_SYS_LIBS ${APPKIT_LIBRARY} ${IOKIT_LIBRARY} ${OPENGL_LIBRARY})
|
2015-08-18 18:00:24 +00:00
|
|
|
else()
|
|
|
|
list(APPEND PLAT_SRCS
|
2015-08-18 19:40:26 +00:00
|
|
|
lib/x11/ApplicationUnix.cpp
|
|
|
|
lib/x11/ApplicationXCB.hpp
|
|
|
|
lib/x11/ApplicationWayland.hpp
|
|
|
|
lib/x11/WindowXCB.cpp
|
|
|
|
lib/x11/WindowWayland.cpp
|
2015-08-18 18:00:24 +00:00
|
|
|
lib/inputdev/HIDListenerUdev.cpp
|
2015-10-29 04:44:38 +00:00
|
|
|
lib/inputdev/HIDDeviceUdev.cpp
|
2015-10-31 04:28:21 +00:00
|
|
|
lib/graphicsdev/GL.cpp
|
|
|
|
lib/graphicsdev/GLX.cpp
|
|
|
|
lib/graphicsdev/glew.c)
|
2015-08-18 19:40:26 +00:00
|
|
|
|
|
|
|
find_package(PkgConfig)
|
|
|
|
if(PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(dbus_pkg QUIET libdbus dbus-1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_path(DBUS_INCLUDE_DIR
|
|
|
|
NAMES
|
|
|
|
dbus/dbus.h
|
|
|
|
HINTS
|
|
|
|
${dbus_pkg_INCLUDE_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
include/
|
|
|
|
include/dbus-1.0/
|
|
|
|
dbus-1.0/)
|
|
|
|
|
|
|
|
find_path(DBUS_ARCH_INCLUDE_DIR
|
|
|
|
NAMES
|
|
|
|
dbus/dbus-arch-deps.h
|
|
|
|
HINTS
|
|
|
|
${dbus_pkg_INCLUDE_DIRS}
|
|
|
|
PATHS
|
|
|
|
# TODO use CMAKE_SYSTEM_PROCESSOR or similar?
|
|
|
|
/usr/lib/dbus-1.0/include
|
|
|
|
PATH_SUFFIXES
|
|
|
|
dbus-1.0/include/)
|
|
|
|
|
|
|
|
find_library(DBUS_LIBRARY
|
|
|
|
NAMES
|
|
|
|
dbus dbus-1
|
|
|
|
HINTS
|
|
|
|
${dbus_pkg_LIBRARY_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib
|
|
|
|
lib32
|
|
|
|
lib64)
|
|
|
|
|
|
|
|
if(DBUS_INCLUDE_DIR-NOTFOUND)
|
|
|
|
message(FATAL_ERROR "Unix build of libBoo requires dbus")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
|
2015-10-31 04:28:21 +00:00
|
|
|
list(APPEND _BOO_SYS_LIBS X11 Xi xkbcommon xkbcommon-x11 GL ${DBUS_LIBRARY} udev pthread)
|
2015-08-18 19:40:26 +00:00
|
|
|
|
2015-08-18 18:00:24 +00:00
|
|
|
endif()
|
|
|
|
|
2015-10-31 04:28:21 +00:00
|
|
|
# For some reason, clang takes forever if glew.c is not built with -Os
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
|
|
set_source_files_properties(lib/graphicsdev/glew.c PROPERTIES COMPILE_FLAGS -Os)
|
|
|
|
endif()
|
|
|
|
|
2015-08-25 07:04:37 +00:00
|
|
|
set(BOO_SYS_LIBS ${_BOO_SYS_LIBS} CACHE PATH "Boo System Libraries" FORCE)
|
2015-08-18 22:43:30 +00:00
|
|
|
|
2015-08-18 18:00:24 +00:00
|
|
|
include_directories(include)
|
|
|
|
|
|
|
|
add_library(Boo
|
2015-08-18 22:43:30 +00:00
|
|
|
lib/inputdev/CafeProPad.cpp include/boo/inputdev/CafeProPad.hpp
|
|
|
|
lib/inputdev/RevolutionPad.cpp include/boo/inputdev/RevolutionPad.hpp
|
|
|
|
lib/inputdev/DolphinSmashAdapter.cpp include/boo/inputdev/DolphinSmashAdapter.hpp
|
|
|
|
lib/inputdev/DualshockPad.cpp include/boo/inputdev/DualshockPad.hpp
|
|
|
|
lib/inputdev/GenericPad.cpp include/boo/inputdev/GenericPad.hpp
|
|
|
|
lib/inputdev/DeviceBase.cpp include/boo/inputdev/DeviceBase.hpp
|
|
|
|
lib/inputdev/DeviceSignature.cpp include/boo/inputdev/DeviceSignature.hpp
|
|
|
|
include/boo/inputdev/IHIDListener.hpp
|
2015-08-18 18:00:24 +00:00
|
|
|
lib/inputdev/IHIDDevice.hpp
|
2015-08-18 22:43:30 +00:00
|
|
|
include/boo/IGraphicsContext.hpp
|
2015-10-29 04:44:38 +00:00
|
|
|
include/boo/graphicsdev/IGraphicsDataFactory.hpp
|
|
|
|
include/boo/graphicsdev/IGraphicsCommandQueue.hpp
|
2015-10-31 04:28:21 +00:00
|
|
|
include/boo/graphicsdev/GL.hpp
|
2015-10-29 04:44:38 +00:00
|
|
|
include/boo/graphicsdev/D3D11.hpp
|
|
|
|
include/boo/graphicsdev/D3D12.hpp
|
|
|
|
include/boo/graphicsdev/Metal.hpp
|
2015-08-18 22:43:30 +00:00
|
|
|
include/boo/IWindow.hpp
|
|
|
|
include/boo/IApplication.hpp
|
2015-08-31 03:40:58 +00:00
|
|
|
include/boo/System.hpp
|
2015-08-18 22:43:30 +00:00
|
|
|
include/boo/boo.hpp
|
|
|
|
InputDeviceClasses.cpp
|
2015-08-18 19:40:26 +00:00
|
|
|
${PLAT_SRCS})
|
|
|
|
|
|
|
|
add_subdirectory(test)
|