summaryrefslogtreecommitdiffhomepage
path: root/proto-vjoy/CMakeLists.txt
blob: 1c4f7fb973b4eb53a8203ed792931f794743a396 (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 . RENAME "VJoy.dll")
    endif()
endif()