Skip to content

Commit

Permalink
Add CMake to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
otreblan committed Apr 15, 2020
1 parent 9b33120 commit add719e
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 55 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target_include_directories(${PROJECT_NAME}

# Sources list
add_subdirectory(src)
#add_subdirectory(doc)
add_subdirectory(doc)

## Libraries
#pkg_check_modules(RAPIDJSON REQUIRED RapidJSON)
Expand Down
1 change: 0 additions & 1 deletion Makefile.am

This file was deleted.

40 changes: 0 additions & 40 deletions configure.ac

This file was deleted.

45 changes: 41 additions & 4 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,44 @@
# You should have received a copy of the GNU General Public License
# along with hello. If not, see <http://www.gnu.org/licenses/>.

#target_sources(doc
#PRIVATE
#hello.adoc
#)
find_program(ASCIIDOCTOR asciidoctor)

if(NOT ASCIIDOCTOR)
message(SEND_ERROR "asciidoctor not found in $PATH")
endif()


add_custom_target(doc
DEPENDS
man1
)

# Man pages that end in *.1
set(MAN1_SOURCES
hello.adoc
)

add_custom_target(man1
SOURCES
${MAN1_SOURCES}
)

foreach(MAN IN LISTS MAN1_SOURCES)

# Deleting the extension
get_filename_component(MAN ${MAN} NAME_WE)

add_custom_command(
TARGET doc
COMMAND asciidoctor --backend manpage --out-file ${MAN}.1
${CMAKE_CURRENT_SOURCE_DIR}/${MAN}.adoc

OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/${MAN}.1
)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${MAN}.1
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1/
)

endforeach()
6 changes: 0 additions & 6 deletions doc/Makefile.am

This file was deleted.

1 change: 1 addition & 0 deletions pkg/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ build() {
..

make
make doc
}

package() {
Expand Down
2 changes: 0 additions & 2 deletions src/Makefile.am

This file was deleted.

2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Display help
void help(char**);

int main(int argc, char *argv[])
int main()
{
std::cout << "Hello\n";
return 0;
Expand Down

0 comments on commit add719e

Please sign in to comment.