InputCommon/CMakeLists: Migrate off add_dolphin_library

Continues the migration work started in 3a4c3bbe01e7a44ec997f4fbf0b678fba6f2d46c
This commit is contained in:
Lioncash 2018-03-24 14:13:48 -04:00
parent 304aeaa922
commit 01308330d9
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7

View File

@ -1,4 +1,5 @@
set(SRCS InputConfig.cpp add_library(inputcommon
InputConfig.cpp
ControllerEmu/ControllerEmu.cpp ControllerEmu/ControllerEmu.cpp
ControllerEmu/Control/Control.cpp ControllerEmu/Control/Control.cpp
ControllerEmu/Control/Input.cpp ControllerEmu/Control/Input.cpp
@ -21,10 +22,13 @@ set(SRCS InputConfig.cpp
ControlReference/ControlReference.cpp ControlReference/ControlReference.cpp
ControlReference/ExpressionParser.cpp ControlReference/ExpressionParser.cpp
) )
set(LIBS common)
target_link_libraries(inputcommon PUBLIC
common
)
if(WIN32) if(WIN32)
set(SRCS ${SRCS} target_sources(inputcommon PRIVATE
ControllerInterface/DInput/DInput.cpp ControllerInterface/DInput/DInput.cpp
ControllerInterface/DInput/DInputJoystick.cpp ControllerInterface/DInput/DInputJoystick.cpp
ControllerInterface/DInput/DInputKeyboardMouse.cpp ControllerInterface/DInput/DInputKeyboardMouse.cpp
@ -36,40 +40,54 @@ elseif(APPLE)
find_library(COREFOUNDATION_LIBRARY CoreFoundation) find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(CARBON_LIBRARY Carbon) find_library(CARBON_LIBRARY Carbon)
find_library(COCOA_LIBRARY Cocoa) find_library(COCOA_LIBRARY Cocoa)
set(SRCS ${SRCS} target_sources(inputcommon PRIVATE
ControllerInterface/OSX/OSX.mm ControllerInterface/OSX/OSX.mm
ControllerInterface/OSX/OSXJoystick.mm ControllerInterface/OSX/OSXJoystick.mm
ControllerInterface/Quartz/Quartz.mm ControllerInterface/Quartz/Quartz.mm
ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp
) )
set(LIBS ${LIBS} ${COREFOUNDATION_LIBRARY} ${CARBON_LIBRARY} ${COCOA_LIBRARY}) target_link_libraries(inputcommon PUBLIC
${COREFOUNDATION_LIBRARY}
${CARBON_LIBRARY}
${COCOA_LIBRARY}
)
elseif(X11_FOUND) elseif(X11_FOUND)
set(SRCS ${SRCS} target_sources(inputcommon PRIVATE
ControllerInterface/Xlib/XInput2.cpp ControllerInterface/Xlib/XInput2.cpp
) )
set(LIBS ${LIBS} ${X11_LIBRARIES} ${X11_INPUT_LIBRARIES}) target_link_libraries(inputcommon PUBLIC
${X11_LIBRARIES}
${X11_INPUT_LIBRARIES}
)
elseif(ANDROID) elseif(ANDROID)
add_definitions(-DCIFACE_USE_ANDROID) target_compile_definitions(inputcommon PRIVATE -DCIFACE_USE_ANDROID)
set(SRCS ${SRCS} target_sources(inputcommon PRIVATE
ControllerInterface/Android/Android.cpp ControllerInterface/Android/Android.cpp
) )
endif() endif()
if(ANDROID) if(ANDROID)
set(SRCS ${SRCS} GCAdapter_Android.cpp) target_sources(inputcommon PRIVATE GCAdapter_Android.cpp)
else() else()
set(SRCS ${SRCS} GCAdapter.cpp) target_sources(inputcommon PRIVATE GCAdapter.cpp)
set(LIBS ${LIBS} ${LIBUSB_LIBRARIES}) target_link_libraries(inputcommon PUBLIC ${LIBUSB_LIBRARIES})
endif() endif()
if(LIBEVDEV_FOUND AND LIBUDEV_FOUND) if(LIBEVDEV_FOUND AND LIBUDEV_FOUND)
set(SRCS ${SRCS} ControllerInterface/evdev/evdev.cpp) target_sources(inputcommon PRIVATE
set(LIBS ${LIBS} ${LIBEVDEV_LIBRARY} ${LIBUDEV_LIBRARY}) ControllerInterface/evdev/evdev.cpp
)
target_link_libraries(inputcommon PUBLIC
${LIBEVDEV_LIBRARY}
${LIBUDEV_LIBRARY}
)
endif() endif()
if(UNIX) if(UNIX)
set(SRCS ${SRCS} ControllerInterface/Pipes/Pipes.cpp) target_sources(inputcommon PRIVATE
ControllerInterface/Pipes/Pipes.cpp
)
endif() endif()
if(ENABLE_SDL) if(ENABLE_SDL)
@ -89,12 +107,10 @@ if(ENABLE_SDL)
endif() endif()
endif() endif()
if(SDL_TARGET AND TARGET ${SDL_TARGET}) if(SDL_TARGET AND TARGET ${SDL_TARGET})
set(SRCS ${SRCS} ControllerInterface/SDL/SDL.cpp) target_sources(inputcommon PRIVATE ControllerInterface/SDL/SDL.cpp)
set(LIBS ${LIBS} ${SDL_TARGET}) target_link_libraries(inputcommon PUBLIC ${SDL_TARGET})
add_definitions(-DHAVE_SDL=1) target_compile_definitions(inputcommon PRIVATE -DHAVE_SDL=1)
else() else()
message(STATUS "SDL NOT found, disabling SDL input") message(STATUS "SDL NOT found, disabling SDL input")
endif() endif()
endif() endif()
add_dolphin_library(inputcommon "${SRCS}" "${LIBS}")