Update build files.

Don't include install targets when this is built with FetchContent.
This commit is contained in:
Kyle Isom 2023-10-10 22:17:22 -07:00
parent 7cb39680c1
commit b28199553f
3 changed files with 5 additions and 1 deletions

View File

@ -14,3 +14,4 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc/klib)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man DESTINATION share) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man DESTINATION share)
endif () endif ()

View File

@ -83,6 +83,7 @@ write_basic_package_version_file(
COMPATIBILITY AnyNewerVersion COMPATIBILITY AnyNewerVersion
) )
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(cloc add_custom_target(cloc
COMMAND cloc ${SOURCE_FILES} ${HEADER_FILES} COMMAND cloc ${SOURCE_FILES} ${HEADER_FILES}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
@ -96,3 +97,4 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/klib.pc DESTINATION lib/pkgconfig)
include(CMakePack.txt) include(CMakePack.txt)
include(CMakeDocs.txt) include(CMakeDocs.txt)
endif()

View File

@ -32,4 +32,5 @@ set(CPACK_SOURCE_IGNORE_FILES
/.*build.*) /.*build.*)
include (CPack) include (CPack)
add_custom_target(package_docs DEPENDS klib_docs package package_source) add_custom_target(package_docs DEPENDS klib_docs package package_source)