<commit_before>cmake_minimum_required(VERSION 2.8.12)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})

include(CMakeSofaCreateTarget)

set(SOLUTION_NAME "SofaFramework")
project(${SOLUTION_NAME})

# Temporary variable until we move the sub projects
set(SofaFramework_ACTUAL_SOURCE_DIR ${SofaFramework_SOURCE_DIR}/../framework)

##
## SofaFramework options
##
option(SOFAFRAMEWORK_DETECTIONOUTPUT_FREEMOTION "Compile SofaCore library with DETECTIONOUTPUT_FREEMOTION preprocessor definition" OFF)
option(SOFAFRAMEWORK_DETECTIONOUTPUT_BARYCENTRICINFO "Compile SofaCore library with DETECTIONOUTPUT_BARYCENTRICINFO preprocessor definition" OFF)
option(SOFA_NO_OPENGL "Compile SofaFramework libraries without OpenGL dependencies" OFF)

set(SOFA_FLOATING_POINT_TYPE double CACHE STRING
"Type used for floating point values in SOFA. It actually determines:
 - what template instanciations will be compiled (via the definition of the
   SOFA_FLOAT and SOFA_DOUBLE macros)
 - what is the type behind the 'SReal' typedef used throughout SOFA. (If 'both'
   is selected, SReal defaults to double.)")
set_property(CACHE SOFA_FLOATING_POINT_TYPE PROPERTY STRINGS float double both)

if(${SOFA_FLOATING_POINT_TYPE} STREQUAL double)
    set(SOFA_DOUBLE 1)
elseif(${SOFA_FLOATING_POINT_TYPE} STREQUAL float)
    set(SOFA_FLOAT 1)
endif()

set(DETECTIONOUTPUT_FREEMOTION ${SOFAFRAMEWORK_DETECTIONOUTPUT_FREEMOTION})
set(DETECTIONOUTPUT_BARYCENTRICINFO ${SOFAFRAMEWORK_DETECTIONOUTPUT_BARYCENTRICINFO})


set(SOFAFRAMEWORK_EXTLIBS_DIR "${SofaFramework_ACTUAL_SOURCE_DIR}/../extlibs")

set(SOFAFRAMEWORK_BUILD_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(SOFAFRAMEWORK_BUILD_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(SOFAFRAMEWORK_BUILD_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(SOFAFRAMEWORK_BUILD_CMAKE_DIR ${CMAKE_BINARY_DIR}/SofaFramework)

# Offer the user the choice of overriding the installation directories
set(SOFAFRAMEWORK_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries relative to CMAKE_INSTALL_PREFIX variable")
set(SOFAFRAMEWORK_INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables relative to CMAKE_INSTALL_PREFIX variable")
set(SOFAFRAMEWORK_INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files relative to CMAKE_INSTALL_PREFIX variable")
set(SOFAFRAMEWORK_INSTALL_CMAKE_DIR ${SOFAFRAMEWORK_INSTALL_LIB_DIR}/cmake/SofaFramework)

set(SOFAFRAMEWORK_DEPENDENCY_LINK)
set(SOFAFRAMEWORK_DEPENDENCY_INCLUDE_DIRECTORIES)

##
## Dependencies lookup
##

find_package(GTest CONFIG QUIET)
if(GTest_FOUND)
    set(SOFA_HAVE_GTEST ${GTest_FOUND})
else()
    set(SOFA_HAVE_GTEST ${GTest_FOUND})
endif()

if(NOT SOFA_NO_OPENGL)

    # OpenGL (glu)
    find_package(OpenGL REQUIRED)
    # no target support for OpenGL on windows yet see https://github.com/Kitware/CMake/commit/02e34de2b6c27ee5d367be4fa280ffd3ad1965ba
    # it is not too harmful since this particular library gives symbolic names that can be consumed upon install on the target system.
    list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${OPENGL_LIBRARIES})
    list(APPEND SOFAFRAMEWORK_DEPENDENCY_INCLUDE_DIRECTORIES ${OPENGL_INCLUDE_DIR})

    # GLEW
    find_package(GLEW)
    if(GLEW_FOUND)
        sofa_create_target(GLEW SofaFramework "${GLEW_LIBRARIES}" "${GLEW_INCLUDE_DIRS}")
        list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${GLEW_Target})
    endif()
    set(SOFA_HAVE_GLEW ${GLEW_FOUND})

    # GLUT
    find_package(GLUT)
    if(GLUT_FOUND)
        if(NOT APPLE)
            sofa_create_target(GLUT SofaFramework "${GLUT_glut_LIBRARY}" "${GLUT_INCLUDE_DIR}")
            list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${GLUT_Target})
        else()
            # Workaround: on OS X, "${GLUT_glut_LIBRARY}" is not a target (it is
            # actually "-framework GLUT"), so we use find_library to find
            # something better (like /System/Library/Frameworks/GLUT.framework.)
            # (Fun fact: FindGLUT.cmake litterally reads "These values for Apple
            # could probably do with improvement.)"
            find_library(ACTUAL_GLUT_LIBRARIES "GLUT")
            list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK "${ACTUAL_GLUT_LIBRARIES}")
        endif()
    endif()<commit_msg>cmake: fix missing includes in transitive dependencies<commit_after>cmake_minimum_required(VERSION 2.8.12)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})

include(CMakeSofaCreateTarget)

set(SOLUTION_NAME "SofaFramework")
project(${SOLUTION_NAME})

# Temporary variable until we move the sub projects
set(SofaFramework_ACTUAL_SOURCE_DIR ${SofaFramework_SOURCE_DIR}/../framework)

##
## SofaFramework options
##
option(SOFAFRAMEWORK_DETECTIONOUTPUT_FREEMOTION "Compile SofaCore library with DETECTIONOUTPUT_FREEMOTION preprocessor definition" OFF)
option(SOFAFRAMEWORK_DETECTIONOUTPUT_BARYCENTRICINFO "Compile SofaCore library with DETECTIONOUTPUT_BARYCENTRICINFO preprocessor definition" OFF)
option(SOFA_NO_OPENGL "Compile SofaFramework libraries without OpenGL dependencies" OFF)

set(SOFA_FLOATING_POINT_TYPE double CACHE STRING
"Type used for floating point values in SOFA. It actually determines:
 - what template instanciations will be compiled (via the definition of the
   SOFA_FLOAT and SOFA_DOUBLE macros)
 - what is the type behind the 'SReal' typedef used throughout SOFA. (If 'both'
   is selected, SReal defaults to double.)")
set_property(CACHE SOFA_FLOATING_POINT_TYPE PROPERTY STRINGS float double both)

if(${SOFA_FLOATING_POINT_TYPE} STREQUAL double)
    set(SOFA_DOUBLE 1)
elseif(${SOFA_FLOATING_POINT_TYPE} STREQUAL float)
    set(SOFA_FLOAT 1)
endif()

set(DETECTIONOUTPUT_FREEMOTION ${SOFAFRAMEWORK_DETECTIONOUTPUT_FREEMOTION})
set(DETECTIONOUTPUT_BARYCENTRICINFO ${SOFAFRAMEWORK_DETECTIONOUTPUT_BARYCENTRICINFO})


set(SOFAFRAMEWORK_EXTLIBS_DIR "${SofaFramework_ACTUAL_SOURCE_DIR}/../extlibs")

set(SOFAFRAMEWORK_BUILD_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(SOFAFRAMEWORK_BUILD_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(SOFAFRAMEWORK_BUILD_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(SOFAFRAMEWORK_BUILD_CMAKE_DIR ${CMAKE_BINARY_DIR}/SofaFramework)

# Offer the user the choice of overriding the installation directories
set(SOFAFRAMEWORK_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries relative to CMAKE_INSTALL_PREFIX variable")
set(SOFAFRAMEWORK_INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables relative to CMAKE_INSTALL_PREFIX variable")
set(SOFAFRAMEWORK_INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files relative to CMAKE_INSTALL_PREFIX variable")
set(SOFAFRAMEWORK_INSTALL_CMAKE_DIR ${SOFAFRAMEWORK_INSTALL_LIB_DIR}/cmake/SofaFramework)

set(SOFAFRAMEWORK_DEPENDENCY_LINK)
set(SOFAFRAMEWORK_DEPENDENCY_INCLUDE_DIRECTORIES)

##
## Dependencies lookup
##

find_package(GTest CONFIG QUIET)
if(GTest_FOUND)
    set(SOFA_HAVE_GTEST ${GTest_FOUND})
else()
    set(SOFA_HAVE_GTEST ${GTest_FOUND})
endif()

if(NOT SOFA_NO_OPENGL)

    # OpenGL (glu)
    find_package(OpenGL REQUIRED)
    # no target support for OpenGL on windows yet see https://github.com/Kitware/CMake/commit/02e34de2b6c27ee5d367be4fa280ffd3ad1965ba
    # it is not too harmful since this particular library gives symbolic names that can be consumed upon install on the target system.
    list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${OPENGL_LIBRARIES})
    list(APPEND SOFAFRAMEWORK_DEPENDENCY_INCLUDE_DIRECTORIES ${OPENGL_INCLUDE_DIR})

    # GLEW
    find_package(GLEW)
    if(GLEW_FOUND)
        sofa_create_target(GLEW SofaFramework "${GLEW_LIBRARIES}" "${GLEW_INCLUDE_DIRS}")
        list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${GLEW_Target})
        list(APPEND SOFAFRAMEWORK_DEPENDENCY_INCLUDE_DIRECTORIES ${GLEW_INCLUDE_DIRS})
    endif()
    set(SOFA_HAVE_GLEW ${GLEW_FOUND})

    # GLUT
    find_package(GLUT)
    if(GLUT_FOUND)
        if(NOT APPLE)
            sofa_create_target(GLUT SofaFramework "${GLUT_glut_LIBRARY}" "${GLUT_INCLUDE_DIR}")
            list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${GLUT_Target})
        else()
            # Workaround: on OS X, "${GLUT_glut_LIBRARY}" is not a target (it is
            # actually "-framework GLUT"), so we use find_library to find
            # something better (like /System/Library/Frameworks/GLUT.framework.)
            # (Fun fact: FindGLUT.cmake litterally reads "These values for Apple
            # could probably do with improvement.)"
            find_library(ACTUAL_GLUT_LIBRARIES "GLUT")
            list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK "${ACTUAL_GLUT_LIBRARIES}")
        endif()
    endif()
{'fraction_non_alphanumeric': 0.07307423784035373, 'fraction_numerical': 0.006283453572259716, 'mean_word_length': 5.909163987138264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6786890', 'n_tokens_mistral': 2997, 'n_tokens_neox': 2817, 'n_words': 620}