diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 518368524..c8924b514 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -4,8 +4,11 @@ if (WITH_MAN) execute_process( COMMAND ${DATE_EXECUTABLE} "+%d %B %Y" OUTPUT_VARIABLE CMAKE_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/make_man.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/make_man.sh @ONLY) execute_process( - COMMAND ${BASH_EXECUTABLE} "-c" "${CMAKE_CURRENT_SOURCE_DIR}/make_man.sh > ${CMAKE_BINARY_DIR}/libiio.3.in" + COMMAND ${BASH_EXECUTABLE} "-c" "${CMAKE_CURRENT_BINARY_DIR}/make_man.sh > ${CMAKE_BINARY_DIR}/libiio.3.in" ) configure_file( ${CMAKE_BINARY_DIR}/libiio.3.in diff --git a/man/make_man.sh b/man/make_man.sh.in similarity index 97% rename from man/make_man.sh rename to man/make_man.sh.in index 57e3e5cfb..bdc5b2d39 100755 --- a/man/make_man.sh +++ b/man/make_man.sh.in @@ -1,9 +1,10 @@ #!/bin/bash -e -if [ -z "$TRAVIS_BUILD_DIR" ] ; then - header="../iio.h" -else - header="$TRAVIS_BUILD_DIR/iio.h" +header="@CMAKE_SOURCE_DIR@/iio.h" + +if [ ! -f "${header}" ] ; then + echo "Can not find iio.h at ${header}" + exit fi cat <