CMake: unix2dos, not dos2unix

This commit is contained in:
Vicki Pfau 2018-10-04 12:26:03 -07:00
parent eda2669780
commit 1bf29ae362
1 changed files with 4 additions and 4 deletions

View File

@ -1040,17 +1040,17 @@ endif()
file(GLOB READMES ${CMAKE_CURRENT_SOURCE_DIR}/README*.md) file(GLOB READMES ${CMAKE_CURRENT_SOURCE_DIR}/README*.md)
find_program(DOS2UNIX NAMES dos2unix) find_program(UNIX2DOS NAMES unix2dos)
find_program(MARKDOWN NAMES markdown kramdown pandoc) find_program(MARKDOWN NAMES markdown kramdown pandoc)
if(UNIX OR NOT DOS2UNIX) if(UNIX OR NOT UNIX2DOS)
if(UNIX OR NOT MARKDOWN) if(UNIX OR NOT MARKDOWN)
install(FILES ${READMES} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT ${BINARY_NAME}) install(FILES ${READMES} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT ${BINARY_NAME})
endif() endif()
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/CHANGES" "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT ${BINARY_NAME}) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/CHANGES" "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT ${BINARY_NAME})
else() else()
add_custom_command(OUTPUT CHANGES.txt COMMAND ${DOS2UNIX} -n "${CMAKE_CURRENT_SOURCE_DIR}/CHANGES" "${CMAKE_CURRENT_BINARY_DIR}/CHANGES.txt" MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/CHANGES") add_custom_command(OUTPUT CHANGES.txt COMMAND ${UNIX2DOS} -n "${CMAKE_CURRENT_SOURCE_DIR}/CHANGES" "${CMAKE_CURRENT_BINARY_DIR}/CHANGES.txt" MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/CHANGES")
add_custom_command(OUTPUT LICENSE.txt COMMAND ${DOS2UNIX} -n "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") add_custom_command(OUTPUT LICENSE.txt COMMAND ${UNIX2DOS} -n "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
add_custom_target(CHANGES ALL DEPENDS CHANGES.txt) add_custom_target(CHANGES ALL DEPENDS CHANGES.txt)
add_custom_target(LICENSE ALL DEPENDS LICENSE.txt) add_custom_target(LICENSE ALL DEPENDS LICENSE.txt)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CHANGES.txt ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT ${BINARY_NAME}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CHANGES.txt ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT ${BINARY_NAME})