File: GamepadSupport.cmake

package info (click to toggle)
cloudcompare 2.11.3-7.1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 58,224 kB
  • sloc: cpp: 229,982; ansic: 30,723; makefile: 84; sh: 20
file content (25 lines) | stat: -rw-r--r-- 788 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# ------------------------------------------------------------------------------
# Gamepad support for CloudCompare
# ------------------------------------------------------------------------------

OPTION( OPTION_SUPPORT_GAMEPADS "Build with gamepad support (requires Qt 5.7+)" OFF )
if( ${OPTION_SUPPORT_GAMEPADS} )

	#TODO: make sure that Qt version is at least 5.7 ;)
	find_package(Qt5Gamepad REQUIRED)
	
	include_directories( ${Qt5Gamepad_INCLUDE_DIRS} )

endif()

# link project with GAMEPADS libraries (support actually ;)
function( target_link_GAMEPADS ) # 1 argument: ARGV0 = project name

	if( ${OPTION_SUPPORT_GAMEPADS} )
	
		target_link_libraries(${PROJECT_NAME} Qt5::Gamepad)
		target_compile_definitions( ${PROJECT_NAME} PUBLIC CC_GAMEPADS_SUPPORT )

	endif()

endfunction()