From 89a77a94bbc3faf7a93733f42e07f51d06605deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 7 Oct 2016 22:24:34 +0200 Subject: [PATCH 1/6] Also install the brotli headers when building the shared libraries. #326 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35137c3..5f142d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,7 @@ if(NOT BROTLI_BUNDLED_MODE) install (TARGETS bro RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if(BUILD_SHARED_LIBS) + install(DIRECTORY include/brotli DESTINATION include) if(WIN32) install(TARGETS ${BROTLI_LIBRARIES_CORE} RUNTIME DESTINATION bin) else() From 93933405d35fdc8efbad4c7331b37505f947d430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Fri, 7 Oct 2016 22:50:47 +0200 Subject: [PATCH 2/6] Actually use BROTLI_INCLUDE_DIRS to get the path to headers. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f142d6..a05b7d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,7 +181,7 @@ if(NOT BROTLI_BUNDLED_MODE) install (TARGETS bro RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if(BUILD_SHARED_LIBS) - install(DIRECTORY include/brotli DESTINATION include) + install(DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION include) if(WIN32) install(TARGETS ${BROTLI_LIBRARIES_CORE} RUNTIME DESTINATION bin) else() From cd8153a1ed221565584a9d181c2896228beb3c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Wed, 12 Oct 2016 14:32:36 +0200 Subject: [PATCH 3/6] Do not install the public headers on WIN32. #326 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a05b7d1..6680e8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,11 +181,11 @@ if(NOT BROTLI_BUNDLED_MODE) install (TARGETS bro RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if(BUILD_SHARED_LIBS) - install(DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION include) if(WIN32) install(TARGETS ${BROTLI_LIBRARIES_CORE} RUNTIME DESTINATION bin) else() install(TARGETS ${BROTLI_LIBRARIES_CORE} LIBRARY DESTINATION lib) + install(DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION include) endif() endif() From 82536d2bae85084c8707bb16f6e81236d6fbb5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Wed, 12 Oct 2016 14:53:02 +0200 Subject: [PATCH 4/6] Also install the libraries and headers when building static libraries. --- CMakeLists.txt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6680e8f..e32fa33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,13 +180,11 @@ if(NOT BROTLI_BUNDLED_MODE) install (TARGETS bro RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - if(BUILD_SHARED_LIBS) - if(WIN32) - install(TARGETS ${BROTLI_LIBRARIES_CORE} RUNTIME DESTINATION bin) - else() - install(TARGETS ${BROTLI_LIBRARIES_CORE} LIBRARY DESTINATION lib) - install(DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION include) - endif() + if(WIN32) + install(TARGETS ${BROTLI_LIBRARIES_CORE} RUNTIME DESTINATION bin) + else() + install(TARGETS ${BROTLI_LIBRARIES_CORE} LIBRARY DESTINATION lib) + install(DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION include) endif() endif() From c41962f0ae5bccb3ac4ddc86cfa2a0ef4bdd684c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Wed, 12 Oct 2016 16:11:51 +0200 Subject: [PATCH 5/6] Use install directories provided by GNUInstallDirs. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e32fa33..c791b7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,10 +181,10 @@ if(NOT BROTLI_BUNDLED_MODE) install (TARGETS bro RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if(WIN32) - install(TARGETS ${BROTLI_LIBRARIES_CORE} RUNTIME DESTINATION bin) + install(TARGETS ${BROTLI_LIBRARIES_CORE} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") else() - install(TARGETS ${BROTLI_LIBRARIES_CORE} LIBRARY DESTINATION lib) - install(DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION include) + install(TARGETS ${BROTLI_LIBRARIES_CORE} LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") endif() endif() From 9389876ee9f47ec6ff9046296cae04103ee2d913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Wed, 12 Oct 2016 16:58:03 +0200 Subject: [PATCH 6/6] Add ARCHIVE destination for Windows. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c791b7e..ec41b08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,7 +181,11 @@ if(NOT BROTLI_BUNDLED_MODE) install (TARGETS bro RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if(WIN32) - install(TARGETS ${BROTLI_LIBRARIES_CORE} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + install( + TARGETS ${BROTLI_LIBRARIES_CORE} + LIBRARY DESTINATION "${CMAKE_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) else() install(TARGETS ${BROTLI_LIBRARIES_CORE} LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") install(DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")