<commit_before>cmake_minimum_required(VERSION 3.6.3)


project(Annwvyn)

set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) 
if(WIN32)
    #Annwvyn SDK check
    if(NOT DEFINED ENV{AnnwvynSDK64})
        message(FATAL_ERROR "You need to install the Annwvyn SDK. RUNME.bat will set the AnnwvynSDK64 env var that will stop this error!")
    else()
        message("Annwvyn SDK installed at " $ENV{AnnwvynSDK64})
    endif()

    if(NOT MSVC)
        #TODO The SDK only support MSVC binaries right now due to the format of the VR SDK for rift and vive
        message(FATAL_ERROR "You should only try to generate a VS solution")
    else()
        message("Check for MSVC : passed!!")
        #This configure the Annwvyn's header to EXPORT symbols to DLL
        add_definitions(-DDLLDIR_EX)
        #compiler configuration
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /W4 /fp:fast /bigobj /Gy /D \"_UNICODE\" /D \"UNICODE\" /D \"NOMINMAX\"")
        string(REPLACE "/O2" "/Ox" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /Ot /Oi")
        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
    endif()

    #Where to find additional modules
    set(CMAKE_MODULE_PATH 
        $ENV{AnnwvynSDK64}/CMakeModules
        $ENV{AnnwvynSDK64}/Ogre21SDK/CMake
        $ENV{AnnwvynSDK64}/BtOgre21/CMake
        )

    #Set path required for CMake modules
    set(OGRE_HOME $ENV{AnnwvynSDK64}/Ogre21SDK)
    set(BULLET_ROOT $ENV{AnnwvynSDK64}/bullet3)
    set(BtOgre21_ROOT $ENV{AnnwvynSDK64}/BtOgre21/build/bin/)
    set(OIS_ROOT $ENV{AnnwvynSDK64}/OIS)
    set(ENV{OPENALDIR} $ENV{AnnwvynSDK64}/AL/openal-soft/build/install)
else(UNIX) 
    set(CMAKE_MODULE_PATH /usr/lib/OGRE/cmake /usr/local/lib/OGRE/cmake /usr/lib/BtOgre21/CMake /usr/local/lib/BtOgre21/CMake)
endif(WIN32)

#Find findable packages
find_package(OpenGL REQUIRED)
find_package(OGRE COMPONENTS Overlay HlmsPbs HlmsUnlit REQUIRED)
find_package(Bullet REQUIRED)
find_package(BtOgre21 REQUIRED)
find_package(OIS REQUIRED)
find_package(OpenAL REQUIRED)
find_package(GLFW REQUIRED)

#finding GLEW on windows require the prefix and library path to be modified
if(WIN32)
    set(CMAKE_PREFIX_PATH $ENV{AnnwvynSDK64}/glew)
    set(CMAKE_LIBRARY_PATH $ENV{AnnwvynSDK64}/glew/lib/Release/x64)
endif(WIN32)

find_package(GLEW REQUIRED)
#includes from old visual studio solution
#

include_directories(
    ##VR SDKs
    $ENV{AnnwvynSDK64}/OculusSDK/LibOVR/Src
    $ENV{AnnwvynSDK64}/OculusSDK/3rdParty/glext/GL
    $ENV{AnnwvynSDK64}/OculusSDK/3rdParty/glext
    $ENV{AnnwvynSDK64}/OculusSDK/LibOVRKernel/Src
    $ENV{AnnwvynSDK64}/OculusSDK/LibOVR/Include
    $ENV{AnnwvynSDK64}/openvr/headers

    ##Engine dependencies
    #Graphics
    ${OGRE_INCLUDE_DIRS}
    ${OGRE_HlmsPbs_INCLUDE_DIRS}
    ${OGRE_HlmsUnlit_INCLUDE_DIRS}
    #Physics
    ${BULLET_INCLUDE_DIRS}
    ${BtOgre21_INCLUDE_DIRS}
    #Input 
    ${OIS_INCLUDE_DIRS}
    #OpengL Support
    ${GLEW_INCLUDE_DIRS}
    ${GLFW_INCLUDE_DIR}
    #Audio 
    ${OPENAL_INCLUDE_DIR}
    $ENV{AnnwvynSDK64}/libsndfile/include
    #Scripting
    $ENV{AnnwvynSDK64}/chaiscript #!This is an header only library!
    $ENV{AnnwvynSDK64}/tinyxml2/
    #Project own include
    ${PROJECT_SOURCE_DIR}/pch
    ${PROJECT_SOURCE_DIR}/include
    )

#link directory form old VS solution
link_directories(
    #VR SDKs
    $ENV{AnnwvynSDK64}/OculusSDK/LibOVR/Lib/Windows/x64/Release/VS2015/
    $ENV{AnnwvynSDK64}/openvr/lib/win64
    
    ##Other
    $ENV{AnnwvynSDK64}/libsndfile/lib
    $ENV{AnnwvynSDK64}/tinyxml2/tinyxml2/bin/tinyxml2/x64-Release-Lib/
    )

#List the complete source code
file(GLOB AnnwvynSources src/*.cpp)
file(GLOB AnnwvynHeaders include/*.hpp include/*.h)
file(GLOB AnnwvynPCH pch/*)
set(AnnwvynCode ${AnnwvynSources} ${AnnwvynHeaders} ${AnnwvynPCH})

#Set target for project
add_library(Annwvyn SHARED ${AnnwvynCode} )

#linker input from old VS solution
target_link_libraries( Annwvyn
    ##VR SDKS (manually added)
    LibOVR.lib          #TODO WIN32 specific
    openvr_api.lib      #TODO WIN32 specific
    ##Engine dependencies
    ${OGRE_LIBRARIES}
    ${OGRE_HlmsPbs_LIBRARIES}
    ${OGRE_HlmsUnlit_LIBRARIES}
    ${OGRE_Overlay_LIBRARIES}
    ${BULLET_LIBRARIES}
    ${BtOgre21_LIBRARIES}
    ${OIS_LIBRARIES}
    ${GLEW_LIBRARIES}
    ${GLFW_LIBRARIES}
    ${OPENGL_LIBRARIES}
    ${OPENAL_LIBRARY}

    #Additional libraries (not using cmake find mechanism)
    libsndfile-1.lib
    tinyxml2.lib

    ##Windows own libraries
    ws2_32.lib      #TODO WIN32 specific
    Setupapi.lib    #TODO WIN32 specific
    Winmm.lib       #TODO WIN32 specific
    )

#MSVC specific configuration
if(MSVC)
    set_target_properties(Annwvyn PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
    set_target_properties(Annwvyn PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS")
    set_target_properties(Annwvyn PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS")
    set_target_properties(Annwvyn PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:WINDOWS")
    set_target_properties(Annwvyn PROPERTIES COMPILE_FLAGS "/Yustdafx.h")
    set_source_files_properties(pch/stdafx.cpp PROPERTIES COMPILE_FLAGS "/Ycstdafx.h")
endif()<commit_msg>Wirte every usefull variable in the CMake cache. Every lib are from CMake<commit_after>cmake_minimum_required(VERSION 3.6.3)


project(Annwvyn)

set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) 
if(WIN32)
    #Annwvyn SDK check
    if(NOT DEFINED ENV{AnnwvynSDK64})
        message(FATAL_ERROR "You need to install the Annwvyn SDK. RUNME.bat will set the AnnwvynSDK64 env var that will stop this error!")
    else()
        message("Annwvyn SDK installed at " $ENV{AnnwvynSDK64})
    endif()

    if(NOT MSVC)
        #TODO The SDK only support MSVC binaries right now due to the format of the VR SDK for rift and vive
        message(FATAL_ERROR "You should only try to generate a VS solution")
    else()
        message("Check for MSVC : passed!!")
        #This configure the Annwvyn's header to EXPORT symbols to DLL
        add_definitions(-DDLLDIR_EX)
        #compiler configuration
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /W4 /fp:fast /bigobj /Gy /D \"_UNICODE\" /D \"UNICODE\" /D \"NOMINMAX\"")
        string(REPLACE "/O2" "/Ox" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /Ot /Oi")
        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
    endif()

    #Where to find additional modules
    set(CMAKE_MODULE_PATH 
        $ENV{AnnwvynSDK64}/CMakeModules
        $ENV{AnnwvynSDK64}/Ogre21SDK/CMake
        $ENV{AnnwvynSDK64}/BtOgre21/CMake
        )

    #Set path required for CMake modules
    set(OGRE_HOME $ENV{AnnwvynSDK64}/Ogre21SDK CACHE PATH "Ogre install")
    set(BULLET_ROOT $ENV{AnnwvynSDK64}/bullet3 CACHE PATH "Bullet install")
    set(BtOgre21_ROOT $ENV{AnnwvynSDK64}/BtOgre21/build/bin/ CACHE PATH "BtOgre21 install")
    set(OIS_ROOT $ENV{AnnwvynSDK64}/OIS CACHE PATH "OIS install")
    set(ENV{OPENALDIR} $ENV{AnnwvynSDK64}/AL/openal-soft/build/install CACHE PATH "OpenAL install")
    set(ENV{GLFW_LOCATION} $ENV{AnnwvynSDK64}/glfw-3.2.1.bin.WIN64/ CACHE PATH "GLFW install") 
    set(TinyXML2_ROOT $ENV{AnnwvynSDK64}/tinyxml2 CACHE PATH "TinyXML install")
    set(SNDFILE_WINDOWS_INSTALL $ENV{AnnwvynSDK64}/libsndfile CACHE PATH "TinyXml2 install")

else(UNIX) 
    set(CMAKE_MODULE_PATH /usr/lib/OGRE/cmake /usr/local/lib/OGRE/cmake /usr/lib/BtOgre21/CMake /usr/local/lib/BtOgre21/CMake)
endif(WIN32)

#Find findable packages
find_package(OpenGL REQUIRED)
find_package(OGRE COMPONENTS Overlay HlmsPbs HlmsUnlit REQUIRED)
find_package(Bullet REQUIRED)
find_package(BtOgre21 REQUIRED)
find_package(OIS REQUIRED)
find_package(OpenAL REQUIRED)
find_package(GLFW REQUIRED)
find_package(TinyXML2 REQUIRED)
find_package(SNDFILE REQUIRED)

#finding GLEW on windows require the prefix and library path to be modified
if(WIN32)
    set(CMAKE_PREFIX_PATH $ENV{AnnwvynSDK64}/glew)
    set(CMAKE_LIBRARY_PATH $ENV{AnnwvynSDK64}/glew/lib/Release/x64)
endif(WIN32)

find_package(GLEW REQUIRED)
#includes from old visual studio solution
#

include_directories(
    ##VR SDKs
    $ENV{AnnwvynSDK64}/OculusSDK/LibOVR/Src
    $ENV{AnnwvynSDK64}/OculusSDK/3rdParty/glext/GL
    $ENV{AnnwvynSDK64}/OculusSDK/3rdParty/glext
    $ENV{AnnwvynSDK64}/OculusSDK/LibOVRKernel/Src
    $ENV{AnnwvynSDK64}/OculusSDK/LibOVR/Include
    $ENV{AnnwvynSDK64}/openvr/headers

    ##Engine dependencies
    #Graphics
    ${OGRE_INCLUDE_DIRS}
    ${OGRE_HlmsPbs_INCLUDE_DIRS}
    ${OGRE_HlmsUnlit_INCLUDE_DIRS}
    #Physics
    ${BULLET_INCLUDE_DIRS}
    ${BtOgre21_INCLUDE_DIRS}
    #Input 
    ${OIS_INCLUDE_DIRS}
    #OpengL Support
    ${GLEW_INCLUDE_DIRS}
    ${GLFW_INCLUDE_DIR}
    #Audio 
    ${OPENAL_INCLUDE_DIR}
    ${SNDFILE_INCLUDE_DIRS}
    #Scripting
    $ENV{AnnwvynSDK64}/chaiscript #!This is an header only library!
    ${TinyXML2_INCLUDE_DIRS}
    #Project own include
    ${PROJECT_SOURCE_DIR}/pch
    ${PROJECT_SOURCE_DIR}/include
    )

#link directory form old VS solution
link_directories(
    #VR SDKs
    $ENV{AnnwvynSDK64}/OculusSDK/LibOVR/Lib/Windows/x64/Release/VS2015/
    $ENV{AnnwvynSDK64}/openvr/lib/win64
    )

#List the complete source code
file(GLOB AnnwvynSources src/*.cpp)
file(GLOB AnnwvynHeaders include/*.hpp include/*.h)
file(GLOB AnnwvynPCH pch/*)
set(AnnwvynCode ${AnnwvynSources} ${AnnwvynHeaders} ${AnnwvynPCH})

#Set target for project
add_library(Annwvyn SHARED ${AnnwvynCode} )

#linker input from old VS solution
target_link_libraries( Annwvyn
    ##VR SDKS (manually added)
    LibOVR.lib          #TODO WIN32 specific
    openvr_api.lib      #TODO WIN32 specific
    ##Engine dependencies
    ${OGRE_LIBRARIES}
    ${OGRE_HlmsPbs_LIBRARIES}
    ${OGRE_HlmsUnlit_LIBRARIES}
    ${OGRE_Overlay_LIBRARIES}
    ${BULLET_LIBRARIES}
    ${BtOgre21_LIBRARIES}
    ${OIS_LIBRARIES}
    ${GLEW_LIBRARIES}
    ${GLFW_LIBRARIES}
    ${OPENGL_LIBRARIES}
    ${OPENAL_LIBRARY}
    ${TinyXML2_LIBRARIES}
    ${SNDFILE_LIBRARIES}

    ##Windows own libraries
    ws2_32.lib      #TODO WIN32 specific
    Setupapi.lib    #TODO WIN32 specific
    Winmm.lib       #TODO WIN32 specific
    )

#MSVC specific configuration
if(MSVC)
    set_target_properties(Annwvyn PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
    set_target_properties(Annwvyn PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS")
    set_target_properties(Annwvyn PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS")
    set_target_properties(Annwvyn PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:WINDOWS")
    set_target_properties(Annwvyn PROPERTIES COMPILE_FLAGS "/Yustdafx.h")
    set_source_files_properties(pch/stdafx.cpp PROPERTIES COMPILE_FLAGS "/Ycstdafx.h")
endif()

#Installation
if(WIN32)
    file(GLOB Annwvyn_ARTIFACTS ${CMAKE_BINARY_DIR}/Release/* ${CMAKE_BINARY_DIR}/Debug/*)
    install(FILES ${Annwvyn_ARTIFACTS} DESTINATION ${CMAKE_SOURCE_DIR}/lib)
endif()
{'fraction_non_alphanumeric': 0.0991414369633981, 'fraction_numerical': 0.021961138725711704, 'mean_word_length': 4.227208313651394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, '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': '175295', 'n_tokens_mistral': 4633, 'n_tokens_neox': 4240, 'n_words': 788}