<commit_before># # # # sol2
# The MIT License (MIT)
# 
# Copyright (c) 2013-2022 Rapptz, ThePhD, and contributors
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# # # # sol2
# # # Required minimum version statement
cmake_minimum_required(VERSION 3.16.0)
# # # Project Include - file that is included after project declaration is finished
set(CMAKE_PROJECT_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Includes/Project.cmake")

# # # project declaration
project(sol2 VERSION 4.0.0 LANGUAGES CXX C)

if (sol2-is-top-level-project)
	message(STATUS "sol2 is the top-level directory...")
endif()

# Include standard modules
include(CMakePackageConfigHelpers)
include(CheckCXXCompilerFlag)
include(CMakeDependentOption)
include(GNUInstallDirs)
include(FetchContent)

# # # Configuration
# # Cached defines, strings, paths and options
set(SOL2_LUA_VERSION "5.4.4" CACHE STRING "The version of Lua needed. Can be 5.1, 5.2, 5.3, 5.4, LuaJIT, or a more specific 3-part version number for a specifc Lua (e.g., 5.4.4 or luajit-2.0.5)")
set(SOL2_BUILD_LUA TRUE CACHE BOOL "Always build Lua, do not search for it in the system")
set(SOL2_PLATFORM "x64" CACHE STRING "Target platform to compile for when building binaries (x86, x64)")
option(SOL2_CI "Whether or not we are in continguous integration mode" OFF)
option(SOL2_SYSTEM_INCLUDE "Whether or not sol2 should be considered a system include. This helps suppress errors for when the sol2 author is a big derp and doesn't fix every single warning, ever." ON)
option(SOL2_TESTS "Enable build of tests" OFF)
option(SOL2_EXAMPLES "Enable build of examples" OFF)
option(SOL2_INTEROP_EXAMPLES "Enable build of interop examples" OFF)
option(SOL2_DYNAMIC_LOADING_EXAMPLES "Enable build of interop examples" OFF)
option(SOL2_SINGLE "Enable generation and build of single header files" OFF)
option(SOL2_DOCS "Enable build of documentation" OFF)
option(SOL2_ENABLE_INSTALL "Enable installation of Sol2" ON)
# Single tests and examples tests will only be turned on if both SINGLE and TESTS are defined
CMAKE_DEPENDENT_OPTION(SOL2_TESTS_SINGLE "Enable build of tests using the premade single headers" ON
	"SOL2_SINGLE;SOL2_TESTS" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_EXAMPLES_SINGLE "Enable build of examples using the generated single headers" OFF
	"SOL2_SINGLE;SOL2_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_INTEROP_EXAMPLES_SINGLE "Enable build of interop examples using the generated single headers" OFF
	"SOL2_SINGLE;SOL2_INTEROP_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_DYNAMIC_LOADING_EXAMPLES_SINGLE "Enable build of dynamic loading examples using the generated single headers" OFF
	"SOL2_SINGLE;SOL2_DYNAMIC_LOADING_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_TESTS_EXAMPLES "Enable build of examples as tests" ON
	"SOL2_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_TESTS_INTEROP_EXAMPLES "Enable build of interop examples as tests" ON
	"SOL2_INTEROP_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_TESTS_DYNAMIC_LOADING_EXAMPLES "Enable build of dynamic loading examples as tests" ON
	"SOL2_DYNAMIC_LOADING_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_LUA_AS_DLL "Build Lua as a DLL" ON
	"SOL2_BUILD_LUA" OFF)


if (SOL2_SYSTEM_INCLUDE)
	set(sol2-system-include SYSTEM)
endif()

# # # sol2 Source Groups
# # Sources everyone is going to need
# Header files
file(GLOB_RECURSE sol2-headers
	LIST_DIRECTORIES FALSE
	CONFIGURE_DEPENDS
	${CMAKE_CURRENT_SOURCE_DIR}/include/sol*.hpp
)

file(GLOB_RECURSE sol2-sources
	LIST_DIRECTORIES FALSE
	CONFIGURE_DEPENDS
	${CMAKE_CURRENT_SOURCE_DIR}/source/**
)

# # # sol2 Library
# # Add a target for sol2's library to be included by external users
add_library(sol2 INTERFACE)
add_library(sol2::sol2 ALIAS sol2)
target_include_directories(sol2 ${sol2-system-include}
	INTERFACE
	$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
	$<INSTALL_INTERFACE:include>)

# # Version configurations
configure_package_config_file(
	cmake/sol2-config.cmake.in
	"${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config.cmake"
	INSTALL_DESTINATION lib/cmake/sol2
	NO_CHECK_REQUIRED_COMPONENTS_MACRO)

write_basic_package_version_file(
	"${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config-version.cmake"
	COMPATIBILITY AnyNewerVersion)

export(TARGETS sol2
	FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-targets.cmake")

if(SOL2_ENABLE_INSTALL)
	install(TARGETS sol2
		EXPORT sol2)

	install(EXPORT sol2
		FILE sol2-targets.cmake
		DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sol2")

	install(DIRECTORY include/sol
		DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

	install(FILES
		"${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config.cmake"
		"${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config-version.cmake"
		DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sol2")
endif()

# # # sol2 Library - Single header target
if (SOL2_SINGLE)
	message(STATUS "sol2 adding single...")
	add_subdirectory(single)
endif()

# # # documentation
# Generates the docs
if (SOL2_DOCS)
	message(STATUS "sol2 adding docs...")
	add_subdirectory(documentation)
endif()

if(SOL2_ENABLE_INSTALL)
	# pkg-config support, except on Windows
	if(NOT WIN32 OR NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
		set(PKGCONFIG_INSTALL_DIR
			"${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
			CACHE PATH "Path where sol2.pc is installed")

		configure_file("${CMAKE_CURRENT_SOURCE_DIR}/sol2.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/sol2.pc" @ONLY)
		install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sol2.pc" DESTINATION "${PKGCONFIG_INSTALL_DIR}")
	endif()
endif()

if (SOL2_CI)
	message(STATUS "sol2 Contiguous Integration is on")<commit_msg>Install cmake files to share/<commit_after># # # # sol2
# The MIT License (MIT)
# 
# Copyright (c) 2013-2022 Rapptz, ThePhD, and contributors
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# # # # sol2
# # # Required minimum version statement
cmake_minimum_required(VERSION 3.16.0)
# # # Project Include - file that is included after project declaration is finished
set(CMAKE_PROJECT_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Includes/Project.cmake")

# # # project declaration
project(sol2 VERSION 4.0.0 LANGUAGES CXX C)

if (sol2-is-top-level-project)
	message(STATUS "sol2 is the top-level directory...")
endif()

# Include standard modules
include(CMakePackageConfigHelpers)
include(CheckCXXCompilerFlag)
include(CMakeDependentOption)
include(GNUInstallDirs)
include(FetchContent)

# # # Configuration
# # Cached defines, strings, paths and options
set(SOL2_LUA_VERSION "5.4.4" CACHE STRING "The version of Lua needed. Can be 5.1, 5.2, 5.3, 5.4, LuaJIT, or a more specific 3-part version number for a specifc Lua (e.g., 5.4.4 or luajit-2.0.5)")
set(SOL2_BUILD_LUA TRUE CACHE BOOL "Always build Lua, do not search for it in the system")
set(SOL2_PLATFORM "x64" CACHE STRING "Target platform to compile for when building binaries (x86, x64)")
option(SOL2_CI "Whether or not we are in continguous integration mode" OFF)
option(SOL2_SYSTEM_INCLUDE "Whether or not sol2 should be considered a system include. This helps suppress errors for when the sol2 author is a big derp and doesn't fix every single warning, ever." ON)
option(SOL2_TESTS "Enable build of tests" OFF)
option(SOL2_EXAMPLES "Enable build of examples" OFF)
option(SOL2_INTEROP_EXAMPLES "Enable build of interop examples" OFF)
option(SOL2_DYNAMIC_LOADING_EXAMPLES "Enable build of interop examples" OFF)
option(SOL2_SINGLE "Enable generation and build of single header files" OFF)
option(SOL2_DOCS "Enable build of documentation" OFF)
option(SOL2_ENABLE_INSTALL "Enable installation of Sol2" ON)
# Single tests and examples tests will only be turned on if both SINGLE and TESTS are defined
CMAKE_DEPENDENT_OPTION(SOL2_TESTS_SINGLE "Enable build of tests using the premade single headers" ON
	"SOL2_SINGLE;SOL2_TESTS" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_EXAMPLES_SINGLE "Enable build of examples using the generated single headers" OFF
	"SOL2_SINGLE;SOL2_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_INTEROP_EXAMPLES_SINGLE "Enable build of interop examples using the generated single headers" OFF
	"SOL2_SINGLE;SOL2_INTEROP_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_DYNAMIC_LOADING_EXAMPLES_SINGLE "Enable build of dynamic loading examples using the generated single headers" OFF
	"SOL2_SINGLE;SOL2_DYNAMIC_LOADING_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_TESTS_EXAMPLES "Enable build of examples as tests" ON
	"SOL2_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_TESTS_INTEROP_EXAMPLES "Enable build of interop examples as tests" ON
	"SOL2_INTEROP_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(SOL2_TESTS_DYNAMIC_LOADING_EXAMPLES "Enable build of dynamic loading examples as tests" ON
	"SOL2_DYNAMIC_LOADING_EXAMPLES" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_LUA_AS_DLL "Build Lua as a DLL" ON
	"SOL2_BUILD_LUA" OFF)


if (SOL2_SYSTEM_INCLUDE)
	set(sol2-system-include SYSTEM)
endif()

# # # sol2 Source Groups
# # Sources everyone is going to need
# Header files
file(GLOB_RECURSE sol2-headers
	LIST_DIRECTORIES FALSE
	CONFIGURE_DEPENDS
	${CMAKE_CURRENT_SOURCE_DIR}/include/sol*.hpp
)

file(GLOB_RECURSE sol2-sources
	LIST_DIRECTORIES FALSE
	CONFIGURE_DEPENDS
	${CMAKE_CURRENT_SOURCE_DIR}/source/**
)

# # # sol2 Library
# # Add a target for sol2's library to be included by external users
add_library(sol2 INTERFACE)
add_library(sol2::sol2 ALIAS sol2)
target_include_directories(sol2 ${sol2-system-include}
	INTERFACE
	$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
	$<INSTALL_INTERFACE:include>)

# # Version configurations
configure_package_config_file(
	cmake/sol2-config.cmake.in
	"${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config.cmake"
	INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/sol2
	NO_CHECK_REQUIRED_COMPONENTS_MACRO)

write_basic_package_version_file(
	"${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config-version.cmake"
	COMPATIBILITY AnyNewerVersion)

export(TARGETS sol2
	FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-targets.cmake")

if(SOL2_ENABLE_INSTALL)
	install(TARGETS sol2
		EXPORT sol2)

	install(EXPORT sol2
		FILE sol2-targets.cmake
		DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/sol2")

	install(DIRECTORY include/sol
		DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

	install(FILES
		"${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config.cmake"
		"${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config-version.cmake"
		DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/sol2")
endif()

# # # sol2 Library - Single header target
if (SOL2_SINGLE)
	message(STATUS "sol2 adding single...")
	add_subdirectory(single)
endif()

# # # documentation
# Generates the docs
if (SOL2_DOCS)
	message(STATUS "sol2 adding docs...")
	add_subdirectory(documentation)
endif()

if(SOL2_ENABLE_INSTALL)
	# pkg-config support, except on Windows
	if(NOT WIN32 OR NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
		set(PKGCONFIG_INSTALL_DIR
			"${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
			CACHE PATH "Path where sol2.pc is installed")

		configure_file("${CMAKE_CURRENT_SOURCE_DIR}/sol2.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/sol2.pc" @ONLY)
		install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sol2.pc" DESTINATION "${PKGCONFIG_INSTALL_DIR}")
	endif()
endif()

if (SOL2_CI)
	message(STATUS "sol2 Contiguous Integration is on")
{'fraction_non_alphanumeric': 0.0805204745503253, 'fraction_numerical': 0.018369690011481057, 'mean_word_length': 6.1949339207048455, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '6666905', 'n_tokens_mistral': 4625, 'n_tokens_neox': 4342, 'n_words': 1293}