Skip to content

Commit

Permalink
🛠 Reference the new ztd.idk library
Browse files Browse the repository at this point in the history
- 🔨💚 ReadTheDocs was busted because it's project include behavior degraded?
  • Loading branch information
ThePhD committed Jul 3, 2021
1 parent 00ef86b commit 2fde34d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 98 deletions.
36 changes: 29 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ project(ztd.text
HOMEPAGE_URL "https://ztdtext.readthedocs.io/en/latest/"
LANGUAGES C CXX)

if (ZTD_TEXT_READTHEDOCS)
# ReadTheDocs seems unable to handle the include at the project level: something must be going wrong?
include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)
include(CheckIPOSupported)
include(CMakePackageConfigHelpers)
include(CMakeDependentOption)
include(CMakePrintHelpers)
include(GNUInstallDirs)
include(FeatureSummary)
include(FetchContent)
include(CTest)
# ztd
include(CheckCompilerDiagnostic)
include(CheckCompilerFlag)
include(FindVersion)
endif()

# # # Top-Level Directories
# Check if this is the top-level project or not
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
Expand Down Expand Up @@ -111,15 +129,19 @@ include(FeatureSummary)
include(FetchContent)
include(CTest)

# ztd.version
FetchContent_Declare(ztd.version
GIT_REPOSITORY https://github.com/soasis/version
# ztd.idk
FetchContent_Declare(ztd.idk
GIT_REPOSITORY https://github.com/soasis/idk.git
GIT_TAG main)
FetchContent_MakeAvailable(ztd.version)
FetchContent_MakeAvailable(ztd.idk)

# ztd.cuneicode
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/vendor/cuneicode)
if (ZTD_TEXT_USE_CUNEICODE)
FetchContent_Declare(ztd.cuneicode
GIT_REPOSITORY https://github.com/soasis/cuneicode.git
GIT_TAG main)
FetchContent_MakeAvailable(ztd.cuneicode)
set(ztd_text_has_cuneicode ON)
add_subdirectory(vendor/cuneicode)
else()
set(ztd_text_has_cuneicode OFF)
endif()
Expand All @@ -138,7 +160,7 @@ target_include_directories(ztd.text
target_sources(ztd.text INTERFACE ${ztd.text.includes})
target_link_libraries(ztd.text
INTERFACE
ztd::version
ztd::idk
${ztd-use-cuneicode}
)
install(DIRECTORY include/
Expand Down
50 changes: 0 additions & 50 deletions documentation/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions documentation/make.bat

This file was deleted.

11 changes: 5 additions & 6 deletions documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# C++ Index Configuration
#
cpp_index_common_prefix = [
'ztd::text::__impl::', 'ztd::text::__detail::', 'ztd::text::', 'ztd::'
'ztd::text::__impl::', 'ztd::text::__txt_detail::', 'ztd::text::', 'ztd::'
]

# Breathe Configuration
Expand All @@ -92,10 +92,9 @@
#
autosectionlabel_prefix_document = True


# ReadTheDocs Build Help
#


def run_cmake_doxygen():
"""Run the cmake command to get the doxygen sources"""

Expand All @@ -104,12 +103,12 @@ def run_cmake_doxygen():
xml_dir = os.path.join(cmake_dir, 'documentation/doxygen/xml')
os.makedirs(cmake_dir, exist_ok=True)
os.makedirs(xml_dir, exist_ok=True)
print("[conf.py] CMake Directory: %s" % cmake_dir)
print("[conf.py] XML Directory: %s" % xml_dir)
print("[ztd.text/documentation/conf.py] CMake Directory: %s" % cmake_dir)
print("[ztd.text/documentation/conf.py] XML Directory: %s" % xml_dir)

try:
retcode = subprocess.call(
"cmake -DZTD_TEXT_DOCUMENTATION:BOOL=TRUE -DZTD_TEXT_DOCUMENTATION_NO_SPHINX:BOOL=TRUE ../../../..",
"cmake -DZTD_TEXT_READTHEDOCS:BOOL=TRUE -DZTD_TEXT_DOCUMENTATION:BOOL=TRUE -DZTD_TEXT_DOCUMENTATION_NO_SPHINX:BOOL=TRUE ../../../..",
shell=True,
cwd=cmake_dir)
except OSError as e:
Expand Down

0 comments on commit 2fde34d

Please sign in to comment.