<commit_before>CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
PROJECT( RiftSkeleton )

INCLUDE(cmake_modules/InvokePython.cmake)
INVOKEPYTHON( "tools/hardcode_shaders.py" )
# Python script will dump generated headers to autogen/
INCLUDE_DIRECTORIES("autogen/")

# GLFW, SDL, SFML
SET( GL_FRAMEWORK "GLFW" CACHE STRING "Which OpenGL windowing framework to use" )

# Control linking to AntTweakBar and Sixense libraries by toggling a config flag.
# @todo Write or find a "FindXXX.cmake" script to search typical install locations
# on the build machine and link the libraries in.
SET( USE_ANTTWEAKBAR TRUE CACHE BOOL "Use AntTweakBar" )
SET( USE_SIXENSE TRUE CACHE BOOL "Use Sixense" )

SET( USE_OCULUSSDK TRUE CACHE BOOL "Use Oculus SDK" )
SET( USE_OSVR FALSE CACHE BOOL "Use OSVR SDK" )

SET( OVRSDK_VERSION "05" CACHE STRING "Which version of the OVR SDK to use - 05, 06, 07, or 08" )

SET( USE_CORE_CONTEXT TRUE CACHE BOOL "Use Core Context" )
IF( USE_CORE_CONTEXT )
    ADD_DEFINITIONS(-DUSE_CORE_CONTEXT)
ENDIF()

ADD_DEFINITIONS( -DPROJECT_NAME="${PROJECT_NAME}" )

MESSAGE( "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}" )

#
# Platform-dependent section
#
IF( WIN32 )
    MESSAGE(STATUS "MSVC_VERSION=${MSVC_VERSION}")
    # 1600 = VS 10.0
    # 1700 = VS 11.0
    # 1800 = VS 12.0

    #
    # Custom Windows include and link dirs for my machine:
    #
    SET( LIBS_HOME "C:/lib" CACHE STRING "Location of support libraries Glut, Glew and others"  )

    SET( GLM_ROOT "${LIBS_HOME}/glm-0.9.5.4/glm" CACHE STRING "glm root" )
    INCLUDE_DIRECTORIES( "${GLM_ROOT}" )
    ADD_DEFINITIONS( -DGLM_FORCE_RADIANS )

    IF( GL_FRAMEWORK STREQUAL "GLFW" )
        MESSAGE("Using GLFW Framework.")
        IF( MSVC_VERSION STREQUAL "1600" ) # VS 2010
            SET( GLFW3_ROOT "${LIBS_HOME}/glfw-3.1.bin.WIN32" CACHE STRING "glfw root" )
            LINK_DIRECTORIES( "${GLFW3_ROOT}/lib-vc2010" )
        ELSEIF( MSVC_VERSION STREQUAL "1700" )
            SET( GLFW3_ROOT "${LIBS_HOME}/glfw-3.1.bin.WIN32" CACHE STRING "glfw root" )
            LINK_DIRECTORIES( "${GLFW3_ROOT}/lib-vc2012" )
        ELSEIF( MSVC_VERSION STREQUAL "1800" )
            SET( GLFW3_ROOT "${LIBS_HOME}/glfw-3.1.bin.WIN32" CACHE STRING "glfw root" )
            LINK_DIRECTORIES( "${GLFW3_ROOT}/lib-vc2013" )
        ENDIF()
        INCLUDE_DIRECTORIES( "${GLFW3_ROOT}/include" )
        SET( FRAMEWORK_LIBS glfw3.lib )
    ELSEIF( GL_FRAMEWORK STREQUAL "SDL" )
        MESSAGE("Using SDL2 Framework.")
        SET( SDL2_ROOT "${LIBS_HOME}/SDL2-2.0.3" CACHE STRING "SDL2 root" )
        INCLUDE_DIRECTORIES( "${SDL2_ROOT}/include" )
        LINK_DIRECTORIES   ( "${SDL2_ROOT}/lib/x86" )
        SET( FRAMEWORK_LIBS SDL2.lib )
    ELSEIF( GL_FRAMEWORK STREQUAL "SFML" )
        SET( SFML_ROOT "${LIBS_HOME}/SFML-2.2" CACHE STRING "SFML root" )
        INCLUDE_DIRECTORIES( "${SFML_ROOT}/include" )
        LINK_DIRECTORIES   ( "${SFML_ROOT}/lib" )
        SET( FRAMEWORK_LIBS sfml-main.lib sfml-system.lib sfml-window.lib )
    ELSE()
        MESSAGE("Unknown GL_FRAMEWORK: choose GLFW, SDL or SFML.")
    ENDIF()

    SET( GLEW_ROOT "${LIBS_HOME}/glew-1.12.0" CACHE STRING "glew root" )
    INCLUDE_DIRECTORIES( "${GLEW_ROOT}/include" )
    LINK_DIRECTORIES   ( "${GLEW_ROOT}/lib/Release/Win32" )
    ADD_DEFINITIONS( -DGLEW_STATIC )

    IF( USE_OCULUSSDK )
        # TODO: the logic here needs work, OVR SDK dir is kept in cache until manually changed
        IF( OVRSDK_VERSION STREQUAL "05" )
            SET( OCULUSSDK_ROOT "${LIBS_HOME}/OculusSDK-0.5.0.1" CACHE STRING "OculusSDK root" )
            ADD_DEFINITIONS( -DOVRSDK05 )
        ELSEIF( OVRSDK_VERSION STREQUAL "06" )
            SET( OCULUSSDK_ROOT "${LIBS_HOME}/OculusSDK-0.6.0.0" CACHE STRING "OculusSDK root" )
            ADD_DEFINITIONS( -DOVRSDK06 )
        ELSEIF( OVRSDK_VERSION STREQUAL "07" )
            SET( OCULUSSDK_ROOT "${LIBS_HOME}/OculusSDK-0.7.0.0" CACHE STRING "OculusSDK root" )
            ADD_DEFINITIONS( -DOVRSDK07 )
        ELSEIF( OVRSDK_VERSION STREQUAL "08" )
            SET( OCULUSSDK_ROOT "${LIBS_HOME}/OculusSDK" CACHE STRING "OculusSDK root" )
            ADD_DEFINITIONS( -DOVRSDK08 )
        ELSE()
            MESSAGE("Unknown OVR SDK version.")
        ENDIF()

        INCLUDE_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Include" )
        INCLUDE_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Src" )
        INCLUDE_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVRKernel/Src" )
        IF( MSVC_VERSION STREQUAL "1600" )
            IF( DEBUG )
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Debug/VS2010" )
            ELSE()
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Release/VS2010" )
            ENDIF()
        ELSEIF( MSVC_VERSION STREQUAL "1700" )
            IF( DEBUG )
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Debug/VS2012" )
            ELSE()
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Release/VS2012" )
            ENDIF()
        ELSEIF( MSVC_VERSION STREQUAL "1800" )
            IF( DEBUG )
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Debug/VS2013" )
            ELSE()
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Release/VS2013" )
            ENDIF()
        ENDIF()
        SET( OVR_LIBS LibOVR.lib )
        ADD_DEFINITIONS( -DUSE_OCULUSSDK )
    ENDIF( USE_OCULUSSDK )

    IF( USE_OSVR )
        SET( OSVR_ROOT "${LIBS_HOME}/OSVR-Core-Snapshot-v0.2-338-ga848a4c-build122-vs12-32bit" CACHE STRING "OSVR root" )
        INCLUDE_DIRECTORIES( "${OSVR_ROOT}/include" )
        LINK_DIRECTORIES   ( "${OSVR_ROOT}/lib" )
        SET( OSVR_LIBS osvrClientKit.lib )
        INCLUDE_DIRECTORIES( "${LIBS_HOME}/boost_1_58_0" )
        ADD_DEFINITIONS( -DUSE_OSVR )
    ENDIF( USE_OSVR )

    IF( USE_SIXENSE )
        MESSAGE("Using Sixense SDK.")
        SET( SIXENSE_ROOT "${LIBS_HOME}/SixenseSDK" CACHE STRING "SixenseSDK root" )
        INCLUDE_DIRECTORIES( "${SIXENSE_ROOT}/include" )
        #LINK_DIRECTORIES   ( "${SIXENSE_ROOT}/lib/win32/debug_static" )
        LINK_DIRECTORIES   ( "${SIXENSE_ROOT}/lib/win32/debug_dll"
                             "${SIXENSE_ROOT}/lib/win32/release_dll" )<commit_msg>Update CMakeLists.txt for glfw and VS1900.<commit_after>CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
PROJECT( RiftSkeleton )

INCLUDE(cmake_modules/InvokePython.cmake)
INVOKEPYTHON( "tools/hardcode_shaders.py" )
# Python script will dump generated headers to autogen/
INCLUDE_DIRECTORIES("autogen/")

# GLFW, SDL, SFML
SET( GL_FRAMEWORK "GLFW" CACHE STRING "Which OpenGL windowing framework to use" )

# Control linking to AntTweakBar and Sixense libraries by toggling a config flag.
# @todo Write or find a "FindXXX.cmake" script to search typical install locations
# on the build machine and link the libraries in.
SET( USE_ANTTWEAKBAR TRUE CACHE BOOL "Use AntTweakBar" )
SET( USE_SIXENSE TRUE CACHE BOOL "Use Sixense" )

SET( USE_OCULUSSDK TRUE CACHE BOOL "Use Oculus SDK" )
SET( USE_OSVR FALSE CACHE BOOL "Use OSVR SDK" )

SET( OVRSDK_VERSION "05" CACHE STRING "Which version of the OVR SDK to use - 05, 06, 07, or 08" )

SET( USE_CORE_CONTEXT TRUE CACHE BOOL "Use Core Context" )
IF( USE_CORE_CONTEXT )
    ADD_DEFINITIONS(-DUSE_CORE_CONTEXT)
ENDIF()

ADD_DEFINITIONS( -DPROJECT_NAME="${PROJECT_NAME}" )

MESSAGE( "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}" )

#
# Platform-dependent section
#
IF( WIN32 )
    MESSAGE(STATUS "MSVC_VERSION=${MSVC_VERSION}")
    # 1600 = VS 10.0
    # 1700 = VS 11.0
    # 1800 = VS 12.0

    #
    # Custom Windows include and link dirs for my machine:
    #
    SET( LIBS_HOME "C:/lib" CACHE STRING "Location of support libraries Glut, Glew and others"  )

    SET( GLM_ROOT "${LIBS_HOME}/glm-0.9.5.4/glm" CACHE STRING "glm root" )
    INCLUDE_DIRECTORIES( "${GLM_ROOT}" )
    ADD_DEFINITIONS( -DGLM_FORCE_RADIANS )

    IF( GL_FRAMEWORK STREQUAL "GLFW" )
        MESSAGE("Using GLFW Framework.")
        SET( GLFW3_ROOT "${LIBS_HOME}/glfw-3.1.2.bin.WIN32" CACHE STRING "glfw root" )
        IF( MSVC_VERSION STREQUAL "1600" ) # VS 2010
            LINK_DIRECTORIES( "${GLFW3_ROOT}/lib-vc2010" )
        ELSEIF( MSVC_VERSION STREQUAL "1700" )
            LINK_DIRECTORIES( "${GLFW3_ROOT}/lib-vc2012" )
        ELSEIF( MSVC_VERSION STREQUAL "1800" )
            LINK_DIRECTORIES( "${GLFW3_ROOT}/lib-vc2013" )
        ELSEIF( MSVC_VERSION STREQUAL "1900" )
            LINK_DIRECTORIES( "${GLFW3_ROOT}/lib-vc2015" )
        ENDIF()
        INCLUDE_DIRECTORIES( "${GLFW3_ROOT}/include" )
        SET( FRAMEWORK_LIBS glfw3.lib )
    ELSEIF( GL_FRAMEWORK STREQUAL "SDL" )
        MESSAGE("Using SDL2 Framework.")
        SET( SDL2_ROOT "${LIBS_HOME}/SDL2-2.0.3" CACHE STRING "SDL2 root" )
        INCLUDE_DIRECTORIES( "${SDL2_ROOT}/include" )
        LINK_DIRECTORIES   ( "${SDL2_ROOT}/lib/x86" )
        SET( FRAMEWORK_LIBS SDL2.lib )
    ELSEIF( GL_FRAMEWORK STREQUAL "SFML" )
        SET( SFML_ROOT "${LIBS_HOME}/SFML-2.2" CACHE STRING "SFML root" )
        INCLUDE_DIRECTORIES( "${SFML_ROOT}/include" )
        LINK_DIRECTORIES   ( "${SFML_ROOT}/lib" )
        SET( FRAMEWORK_LIBS sfml-main.lib sfml-system.lib sfml-window.lib )
    ELSE()
        MESSAGE("Unknown GL_FRAMEWORK: choose GLFW, SDL or SFML.")
    ENDIF()

    SET( GLEW_ROOT "${LIBS_HOME}/glew-1.12.0" CACHE STRING "glew root" )
    INCLUDE_DIRECTORIES( "${GLEW_ROOT}/include" )
    LINK_DIRECTORIES   ( "${GLEW_ROOT}/lib/Release/Win32" )
    ADD_DEFINITIONS( -DGLEW_STATIC )

    IF( USE_OCULUSSDK )
        # TODO: the logic here needs work, OVR SDK dir is kept in cache until manually changed
        IF( OVRSDK_VERSION STREQUAL "05" )
            SET( OCULUSSDK_ROOT "${LIBS_HOME}/OculusSDK-0.5.0.1" CACHE STRING "OculusSDK root" )
            ADD_DEFINITIONS( -DOVRSDK05 )
        ELSEIF( OVRSDK_VERSION STREQUAL "06" )
            SET( OCULUSSDK_ROOT "${LIBS_HOME}/OculusSDK-0.6.0.0" CACHE STRING "OculusSDK root" )
            ADD_DEFINITIONS( -DOVRSDK06 )
        ELSEIF( OVRSDK_VERSION STREQUAL "07" )
            SET( OCULUSSDK_ROOT "${LIBS_HOME}/OculusSDK-0.7.0.0" CACHE STRING "OculusSDK root" )
            ADD_DEFINITIONS( -DOVRSDK07 )
        ELSEIF( OVRSDK_VERSION STREQUAL "08" )
            SET( OCULUSSDK_ROOT "${LIBS_HOME}/OculusSDK" CACHE STRING "OculusSDK root" )
            ADD_DEFINITIONS( -DOVRSDK08 )
        ELSE()
            MESSAGE("Unknown OVR SDK version.")
        ENDIF()

        INCLUDE_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Include" )
        INCLUDE_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Src" )
        INCLUDE_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVRKernel/Src" )
        IF( MSVC_VERSION STREQUAL "1600" )
            IF( DEBUG )
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Debug/VS2010" )
            ELSE()
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Release/VS2010" )
            ENDIF()
        ELSEIF( MSVC_VERSION STREQUAL "1700" )
            IF( DEBUG )
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Debug/VS2012" )
            ELSE()
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Release/VS2012" )
            ENDIF()
        ELSEIF( MSVC_VERSION STREQUAL "1800" )
            IF( DEBUG )
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Debug/VS2013" )
            ELSE()
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Release/VS2013" )
            ENDIF()
        ELSEIF( MSVC_VERSION STREQUAL "1900" )
            IF( DEBUG )
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Debug/VS2015" )
            ELSE()
                LINK_DIRECTORIES( "${OCULUSSDK_ROOT}/LibOVR/Lib/Windows/Win32/Release/VS2015" )
            ENDIF()
        ENDIF()
        SET( OVR_LIBS LibOVR.lib )
        ADD_DEFINITIONS( -DUSE_OCULUSSDK )
    ENDIF( USE_OCULUSSDK )

    IF( USE_OSVR )
        SET( OSVR_ROOT "${LIBS_HOME}/OSVR-Core-Snapshot-v0.2-338-ga848a4c-build122-vs12-32bit" CACHE STRING "OSVR root" )
        INCLUDE_DIRECTORIES( "${OSVR_ROOT}/include" )
        LINK_DIRECTORIES   ( "${OSVR_ROOT}/lib" )
        SET( OSVR_LIBS osvrClientKit.lib )
        INCLUDE_DIRECTORIES( "${LIBS_HOME}/boost_1_58_0" )
        ADD_DEFINITIONS( -DUSE_OSVR )
    ENDIF( USE_OSVR )

    IF( USE_SIXENSE )
        MESSAGE("Using Sixense SDK.")
        SET( SIXENSE_ROOT "${LIBS_HOME}/SixenseSDK" CACHE STRING "SixenseSDK root" )
        INCLUDE_DIRECTORIES( "${SIXENSE_ROOT}/include" )
        #LINK_DIRECTORIES   ( "${SIXENSE_ROOT}/lib/win32/debug_static" )
        LINK_DIRECTORIES   ( "${SIXENSE_ROOT}/lib/win32/debug_dll"
                             "${SIXENSE_ROOT}/lib/win32/release_dll" )
{'fraction_non_alphanumeric': 0.1165821303160359, 'fraction_numerical': 0.034178696839641046, 'mean_word_length': 2.7950843944329287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '53979', 'n_tokens_mistral': 5257, 'n_tokens_neox': 4600, 'n_words': 931}