From 893c672b0113c0e2ebfb140f46eae120f205d05f Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Mon, 13 Feb 2017 16:54:47 -0800 Subject: [PATCH] Add install rule to cmake build. Installs includes, libs, and executables. Based on https://github.com/google/draco/pull/21 --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc334a3..5c50118 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ()