cmake: don't install sdlmanpages.cmake

This commit is contained in:
Anonymous Maarten 2023-06-27 19:02:33 +02:00
parent 9ee1200e6f
commit afdd448834
3 changed files with 7 additions and 15 deletions

View File

@ -3537,7 +3537,6 @@ else()
endif()
configure_file("cmake/sdlfind.cmake" "sdlfind.cmake" COPYONLY)
configure_file("cmake/sdlmanpages.cmake" "sdlmanpages.cmake" COPYONLY)
include(CMakePackageConfigHelpers)
configure_package_config_file(cmake/SDL3Config.cmake.in SDL3Config.cmake
@ -3656,8 +3655,6 @@ if(NOT SDL_DISABLE_INSTALL)
${CMAKE_CURRENT_BINARY_DIR}/SDL3Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/SDL3ConfigVersion.cmake
${SDL3_SOURCE_DIR}/cmake/sdlfind.cmake
${SDL3_SOURCE_DIR}/build-scripts/wikiheaders.pl
${SDL3_SOURCE_DIR}/cmake/sdlmanpages.cmake
DESTINATION "${SDL_SDL_INSTALL_REAL_CMAKEDIR}"
)
@ -3690,10 +3687,10 @@ if(NOT SDL_DISABLE_INSTALL)
include(CPack)
endif()
set(WIKIHEADERS_PL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-scripts/wikiheaders.pl")
if(NOT SDL_DISABLE_INSTALL_MAN)
SDL_generate_manpages(
SYMBOL "SDL_Init"
WIKIHEADERS_PL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-scripts/wikiheaders.pl"
)
endif()
endif()

View File

@ -93,8 +93,3 @@ set(SDL3_STATIC_LIBRARIES SDL3::SDL3-static)
set(SDL3_STATIC_PRIVATE_LIBS)
set(SDL3TEST_LIBRARY SDL3::SDL3_test)
if(SDL3_FOUND)
set(WIKIHEADERS_PL_PATH "${CMAKE_CURRENT_LIST_DIR}/wikiheaders.pl")
include("${CMAKE_CURRENT_LIST_DIR}/sdlmanpages.cmake")
endif()

View File

@ -2,7 +2,7 @@ include(CMakeParseArguments)
include(GNUInstallDirs)
function(SDL_generate_manpages)
cmake_parse_arguments(ARG "" "RESULT_VARIABLE;NAME;BUILD_DOCDIR;HEADERS_DIR;SOURCE_DIR;SYMBOL;OPTION_FILE" "" ${ARGN})
cmake_parse_arguments(ARG "" "RESULT_VARIABLE;NAME;BUILD_DOCDIR;HEADERS_DIR;SOURCE_DIR;SYMBOL;OPTION_FILE;WIKIHEADERS_PL_PATH" "" ${ARGN})
if(NOT ARG_NAME)
set(ARG_NAME "${PROJECT_NAME}")
@ -36,17 +36,17 @@ function(SDL_generate_manpages)
set(result FALSE)
if(PERL_FOUND AND EXISTS "${WIKIHEADERS_PL_PATH}")
if(PERL_FOUND AND EXISTS "${ARG_WIKIHEADERS_PL_PATH}")
add_custom_command(
OUTPUT "${BUILD_WIKIDIR}/${ARG_SYMBOL}.md"
COMMAND "${PERL_EXECUTABLE}" "${WIKIHEADERS_PL_PATH}" "${ARG_SOURCE_DIR}" "${BUILD_WIKIDIR}" "--options=${ARG_OPTION_FILE}" --copy-to-wiki
DEPENDS ${HEADER_FILES} "${WIKIHEADERS_PL_PATH}" "${ARG_OPTION_FILE}"
COMMAND "${PERL_EXECUTABLE}" "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_SOURCE_DIR}" "${BUILD_WIKIDIR}" "--options=${ARG_OPTION_FILE}" --copy-to-wiki
DEPENDS ${HEADER_FILES} "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_OPTION_FILE}"
COMMENT "Generating ${ARG_NAME} wiki markdown files"
)
add_custom_command(
OUTPUT "${BUILD_MANDIR}/man3/${ARG_SYMBOL}.3"
COMMAND "${PERL_EXECUTABLE}" "${WIKIHEADERS_PL_PATH}" "${ARG_SOURCE_DIR}" "${BUILD_WIKIDIR}" "--options=${ARG_OPTION_FILE}" "--manpath=${BUILD_MANDIR}" --copy-to-manpages
DEPENDS "${BUILD_WIKIDIR}/${ARG_SYMBOL}.md" "${WIKIHEADERS_PL_PATH}" "${ARG_OPTION_FILE}"
COMMAND "${PERL_EXECUTABLE}" "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_SOURCE_DIR}" "${BUILD_WIKIDIR}" "--options=${ARG_OPTION_FILE}" "--manpath=${BUILD_MANDIR}" --copy-to-manpages
DEPENDS "${BUILD_WIKIDIR}/${ARG_SYMBOL}.md" "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_OPTION_FILE}"
COMMENT "Generating ${ARG_NAME} man pages"
)
add_custom_target(${ARG_NAME}-docs ALL DEPENDS "${BUILD_MANDIR}/man3/${ARG_SYMBOL}.3")