Add install rule to cmake build.

Installs includes, libs, and executables.

Based on https://github.com/google/draco/pull/21
This commit is contained in:
Tom Finegan 2017-02-13 16:54:47 -08:00
parent 8374e14042
commit 893c672b01

View File

@ -532,4 +532,18 @@ else ()
"${GTEST_SOURCE_DIR}/googletest/include")
target_link_libraries(draco_tests draco gtest)
endif ()
# Collect all of the header files in the tree, and add an install rule for
# each.
file(GLOB_RECURSE draco_headers RELATIVE ${draco_root} "*.h")
foreach (filename ${draco_headers})
get_filename_component(file_directory ${filename} DIRECTORY)
install(FILES ${filename} DESTINATION
"${CMAKE_INSTALL_PREFIX}/include/draco/${file_directory}")
endforeach()
# Add install rules for lib and executable targets.
install(TARGETS dracodec draco DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")
install(TARGETS draco_decoder draco_encoder DESTINATION
"${CMAKE_INSTALL_PREFIX}/bin")
endif ()