summaryrefslogtreecommitdiffhomepage
path: root/proto-vjoy/CMakeLists.txt
blob: 50b23e47d9f35dcc255ee080496642a4a4f88676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
if(WIN32)
    set(SDK_VJOY "" CACHE PATH "VJoy SDK path")
    if(SDK_VJOY)
        if(opentrack-64bit)
            set(arch 64)
        else()
            set(arch 32)
        endif()
        set(lib ${SDK_VJOY}/VJoy${arch}.dll)
        if (MSVC)
            set(implib "${SDK_VJOY}/VJoy${arch}.lib")
        else()
            set(implib "${lib}")
        endif()
        if(CMAKE_COMPILER_IS_GNUCXX)
            set(link "-Wl,--enable-stdcall-fixup")
        endif()
        opentrack_boilerplate(opentrack-proto-vjoy LINK "${link}")
        target_link_libraries(opentrack-proto-vjoy "${implib}")
        target_include_directories(opentrack-proto-vjoy SYSTEM PUBLIC ${SDK_VJOY})
        install(FILES "${lib}" DESTINATION ${opentrack-hier-pfx} RENAME "VJoy.dll")
    endif()
endif()