Skip to content

Commit

Permalink
man: Simplify call to make_man.sh
Browse files Browse the repository at this point in the history
There is no need to execute make_man.sh through a shell with a shell
redirection, CMake can redirect the output to a file for us, and the
make_man.sh script should be executable already.

Also move the generated libiio.3.in to the "man" build dir for
consistency.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed May 11, 2023
1 parent 9f4949f commit d8d66ef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions man/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# worry about that.

if (WITH_MAN)
find_program(BASH_EXECUTABLE bash)
find_program(DATE_EXECUTABLE date)
if (DEFINED ENV{SOURCE_DATE_EPOCH})
execute_process(
Expand All @@ -17,10 +16,12 @@ if (WITH_MAN)
${CMAKE_CURRENT_SOURCE_DIR}/make_man.sh.in
${CMAKE_CURRENT_BINARY_DIR}/make_man.sh @ONLY)
execute_process(
COMMAND ${BASH_EXECUTABLE} "-c" "${CMAKE_CURRENT_BINARY_DIR}/make_man.sh > ${CMAKE_BINARY_DIR}/libiio.3.in"
)
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/make_man.sh
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/libiio.3.in
)

configure_file(
${CMAKE_BINARY_DIR}/libiio.3.in
${CMAKE_CURRENT_BINARY_DIR}/libiio.3.in
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/libiio.3 @ONLY)

if (WITH_DOC)
Expand Down

0 comments on commit d8d66ef

Please sign in to comment.