<commit_before># Copyright libCellML Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.cmake_minimum_required (VERSION 3.1)

cmake_minimum_required(VERSION 3.10.2)

set(PROJECT_NAME libCellML)
project(${PROJECT_NAME} VERSION 0.2.0 LANGUAGES CXX)

# Set policies that affect the build.
if(POLICY CMP0078)
  cmake_policy(SET CMP0078 NEW)
endif()
if(POLICY CMP0086)
  cmake_policy(SET CMP0086 NEW)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(common)
include(environmentchecks)

# Make sure that clcache/ccache gets used, if available.
if(WIN32)
  find_program(CLCACHE clcache)

  mark_as_advanced(CLCACHE)

  if(CLCACHE)
    set(CLCACHEWRAPPER ${PROJECT_BUILD_DIR}/clcachewrapper)

    execute_process(COMMAND ${C_COMPILER} /O2 /Fe${CLCACHEWRAPPER} ${PROJECT_SOURCE_DIR}/cmake/clcachewrapper.c
                    RESULT_VARIABLE RESULT OUTPUT_QUIET ERROR_QUIET)

    if(RESULT EQUAL 0)
      set(CMAKE_C_COMPILER_LAUNCHER ${CLCACHEWRAPPER})
      set(CMAKE_CXX_COMPILER_LAUNCHER ${CLCACHEWRAPPER})
    endif()
  endif()
else()
  find_program(CCACHE ccache)

  mark_as_advanced(CCACHE)

  if(CCACHE)
    set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
    set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
  endif()
endif()

# Use the following variables when configuring the build from the command line to
# set the corresponding cache variables.

# COVERAGE ==> LIBCELLML_COVERAGE
set(_PARAM_ANNOTATION "Enable coverage testing.")
if(COVERAGE_TESTING_AVAILABLE)
  set(LIBCELLML_COVERAGE ON CACHE BOOL ${_PARAM_ANNOTATION})
endif()
if(DEFINED COVERAGE AND COVERAGE_TESTING_AVAILABLE)
  set(LIBCELLML_COVERAGE "${COVERAGE}" CACHE BOOL ${_PARAM_ANNOTATION} FORCE)
elseif(COVERAGE)
  message(WARNING "Coverage testing requested but gcov or its requirements not found!")
endif()
unset(COVERAGE CACHE)

# LLVM_COVERAGE ==> LIBCELLML_LLVM_COVERAGE
set(_PARAM_ANNOTATION "Enable LLVM coverage testing.")
if(LLVM_COVERAGE_TESTING_AVAILABLE)<commit_msg>Use clcache/ccache only for the C++ compiler.<commit_after># Copyright libCellML Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.cmake_minimum_required (VERSION 3.1)

cmake_minimum_required(VERSION 3.10.2)

set(PROJECT_NAME libCellML)
project(${PROJECT_NAME} VERSION 0.2.0 LANGUAGES CXX)

# Set policies that affect the build.
if(POLICY CMP0078)
  cmake_policy(SET CMP0078 NEW)
endif()
if(POLICY CMP0086)
  cmake_policy(SET CMP0086 NEW)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(common)
include(environmentchecks)

# Make sure that clcache/ccache gets used, if available.
if(WIN32)
  find_program(CLCACHE clcache)

  mark_as_advanced(CLCACHE)

  if(CLCACHE)
    set(CLCACHEWRAPPER ${PROJECT_BUILD_DIR}/clcachewrapper)

    execute_process(COMMAND ${C_COMPILER} /O2 /Fe${CLCACHEWRAPPER} ${PROJECT_SOURCE_DIR}/cmake/clcachewrapper.c
                    RESULT_VARIABLE RESULT OUTPUT_QUIET ERROR_QUIET)

    if(RESULT EQUAL 0)
      set(CMAKE_CXX_COMPILER_LAUNCHER ${CLCACHEWRAPPER})
    endif()
  endif()
else()
  find_program(CCACHE ccache)

  mark_as_advanced(CCACHE)

  if(CCACHE)
    set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
  endif()
endif()

# Use the following variables when configuring the build from the command line to
# set the corresponding cache variables.

# COVERAGE ==> LIBCELLML_COVERAGE
set(_PARAM_ANNOTATION "Enable coverage testing.")
if(COVERAGE_TESTING_AVAILABLE)
  set(LIBCELLML_COVERAGE ON CACHE BOOL ${_PARAM_ANNOTATION})
endif()
if(DEFINED COVERAGE AND COVERAGE_TESTING_AVAILABLE)
  set(LIBCELLML_COVERAGE "${COVERAGE}" CACHE BOOL ${_PARAM_ANNOTATION} FORCE)
elseif(COVERAGE)
  message(WARNING "Coverage testing requested but gcov or its requirements not found!")
endif()
unset(COVERAGE CACHE)

# LLVM_COVERAGE ==> LIBCELLML_LLVM_COVERAGE
set(_PARAM_ANNOTATION "Enable LLVM coverage testing.")
if(LLVM_COVERAGE_TESTING_AVAILABLE)
{'fraction_non_alphanumeric': 0.08435708435708436, 'fraction_numerical': 0.013513513513513514, 'mean_word_length': 5.592442645074224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2302722', 'n_tokens_mistral': 1723, 'n_tokens_neox': 1669, 'n_words': 449}