Skip to content

Commit

Permalink
🛠 Prepare for the a sol4 release...
Browse files Browse the repository at this point in the history
- 🎨 Refactor the CMake a whle bunch
  • Loading branch information
ThePhD committed Mar 6, 2021
1 parent d4b13ff commit 8618e39
Show file tree
Hide file tree
Showing 558 changed files with 4,994 additions and 1,981 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
22 changes: 10 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand All @@ -22,10 +22,10 @@

# # # # sol3
# # # Required minimum version statement
cmake_minimum_required(VERSION 3.5.0)
cmake_minimum_required(VERSION 3.15.0)

# # # project declaration
project(sol2 VERSION 3.2.3 LANGUAGES CXX C)
project(sol2 VERSION 3.2.5 LANGUAGES CXX C)

include(GNUInstallDirs)

Expand All @@ -36,13 +36,15 @@ include(GNUInstallDirs)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" "${CMAKE_MODULE_PATH}")

# Include standard modules
include(CMakeDependentOption)
include(CMakePackageConfigHelpers)

include(CheckCXXCompilerFlag)
include(CMakeDependentOption)
include(GNUInstallDirs)
include(FetchContent)

# # # Configuration
# # Cached defines, strings, paths and options
set(SOL2_LUA_VERSION "5.3.5" 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.3.4 or luajit-2.0.5)")
set(SOL2_LUA_VERSION "5.3.5" 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.3.5 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)
Expand Down Expand Up @@ -161,7 +163,7 @@ endif()
# Generates the docs
if (SOL2_DOCS)
message(STATUS "sol2 adding docs...")
add_subdirectory(docs)
add_subdirectory(documentation)
endif()

if(SOL2_ENABLE_INSTALL)
Expand Down Expand Up @@ -277,13 +279,9 @@ if (SOL2_IS_TOP_LEVEL AND (SOL2_DO_TESTS OR SOL2_DO_EXAMPLES))
set_target_properties(${lualib}
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${LUA_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES ${LUA_SEARCH_DEPENDENCY_LIBS}
INTERFACE_LINK_LIBRARIES ${LUA_SEARCH_DEPENDENCY_LIBS} ${CMAKE_DL_LIBS}
IMPORTED_LINK_INTERFACE_LANGUAGES C
IMPORTED_LOCATION ${lualiblocation})
if (CMAKE_DL_LIBS)
set_property(TARGET ${lualib}
APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
endif()
set(LUA_LIBRARIES ${lualib})
endif()

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
Copyright (c) 2013-2021 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
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/Common/Core.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
84 changes: 0 additions & 84 deletions cmake/Modules/FindCatch.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/Modules/FindKaguyaBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLua/set_version_vars.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLuaBridgeBuild.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLuaBuild.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
8 changes: 3 additions & 5 deletions cmake/Modules/FindLuaBuild/LuaJIT.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down Expand Up @@ -415,6 +415,8 @@ add_library(${lualib} INTERFACE)
add_dependencies(${lualib} LUA_JIT-move)
target_include_directories(${lualib}
INTERFACE "${LUA_JIT_SOURCE_DIR}")
target_link_libraries(${lualib}
INTERFACE ${CMAKE_DL_LIBS})
if (BUILD_LUA_AS_DLL)
if (MSVC)
target_link_libraries(${lualib}
Expand All @@ -428,10 +430,6 @@ else()
INTERFACE "${LUA_JIT_DESTINATION_LUA_LIB}")
endif()

if (CMAKE_DL_LIBS)
target_link_libraries(${lualib}
INTERFACE ${CMAKE_DL_LIBS})
endif()
if (XCODE)
target_compile_options(${lualib}
INTERFACE -pagezero_size 10000 -image_base 100000000)
Expand Down
16 changes: 4 additions & 12 deletions cmake/Modules/FindLuaBuild/LuaVanilla.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down Expand Up @@ -360,9 +360,7 @@ endif()
target_compile_options(${liblua}
PRIVATE ${LUA_VANILLA_LUALIB_COMPILER_OPTIONS})
add_dependencies(${liblua} LUA_VANILLA)
if (CMAKE_DL_LIBS)
target_link_libraries(${liblua} PRIVATE ${CMAKE_DL_LIBS})
endif()
target_link_libraries(${liblua} PRIVATE ${CMAKE_DL_LIBS})
if (UNIX)
target_link_libraries(${liblua} PRIVATE m)
endif()
Expand Down Expand Up @@ -399,10 +397,7 @@ if (LUA_BUILD_LUA_INTERPRETER)
target_compile_definitions(${luainterpreter}
PRIVATE LUA_USE_LINUX)
endif()
target_link_libraries(${luainterpreter} PRIVATE ${liblua})
if (CMAKE_DL_LIBS)
target_link_libraries(${luainterpreter} PRIVATE ${CMAKE_DL_LIBS})
endif()
target_link_libraries(${luainterpreter} PRIVATE ${liblua} ${CMAKE_DL_LIBS})
if (UNIX)
target_link_libraries(${luainterpreter} PRIVATE m readline)
endif()
Expand Down Expand Up @@ -437,10 +432,7 @@ if (LUA_BUILD_LUA_COMPILER)
target_compile_definitions(${luacompiler}
PRIVATE LUA_USE_LINUX)
endif()
target_link_libraries(${luacompiler} PRIVATE ${liblua})
if (CMAKE_DL_LIBS)
target_link_libraries(${luacompiler} PRIVATE ${CMAKE_DL_LIBS})
endif()
target_link_libraries(${luacompiler} PRIVATE ${liblua} ${CMAKE_DL_LIBS})
if (UNIX)
# TODO: make readline optional?
target_link_libraries(${luacompiler} PRIVATE m readline)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLuwraBuild.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2020 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2021 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
Expand Down
68 changes: 68 additions & 0 deletions cmake/Modules/FindSphinx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2021 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.

include(FindPackageHandleStandardArgs)
include(FeatureSummary)

find_program(Sphinx_Build_EXECUTABLE NAMES sphinx-build DOC "Path to sphinx-build executable")

if (Sphinx_Build_EXECUTABLE)
set(Sphinx_Build_FOUND YES)
endif()

if (Sphinx_Build_FOUND)
execute_process(
COMMAND ${Sphinx_Build_EXECUTABLE} --version
OUTPUT_VARIABLE Sphinx_Build_VERSION_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
ENCODING UTF-8)
if (Sphinx_Build_VERSION_OUTPUT)
string(REGEX
MATCH "[^0-9]*([0-9]+)[.]([0-9]+)?[.]?([0-9]+)?[.]?([0-9]+)?.*"
Sphinx_Build_VERSION_CHECK ${Sphinx_Build_VERSION_OUTPUT})
endif()
if (Sphinx_Build_VERSION_CHECK)
string(JOIN "." Sphinx_Build_VERSION
${CMAKE_MATCH_1}
${CMAKE_MATCH_2}
${CMAKE_MATCH_3}
${CMAKE_MATCH_4})
set(Sphinx_Build_VERSION "${Sphinx_Build_VERSION}" CACHE STRING "sphinx-build version" FORCE)
endif()
endif()

find_package_handle_standard_args(Sphinx
REQUIRED_VARS Sphinx_Build_EXECUTABLE
VERSION_VAR Sphinx_Build_VERSION
HANDLE_COMPONENTS)

set_package_properties(Sphinx
PROPERTIES
DESCRIPTION "Sphinx Documentation Generator"
URL "https://sphinx-doc.org")

if (Sphinx_Build_FOUND AND NOT TARGET Sphinx::Build)
add_executable(Sphinx::Build IMPORTED)
set_property(TARGET Sphinx::Build PROPERTY IMPORTED_LOCATION ${Sphinx_Build_EXECUTABLE})
set_property(TARGET Sphinx::Build PROPERTY VERSION ${Sphinx_Build_VERSION})
mark_as_advanced(Sphinx_Build_EXECUTABLE Sphinx_Build_VERSION)
endif()
Loading

0 comments on commit 8618e39

Please sign in to comment.