summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBastien Brunnenstein <Meoo@users.noreply.github.com>2017-11-30 17:45:58 +0100
committerWouter van Oortmerssen <aardappel@gmail.com>2017-11-30 08:45:58 -0800
commitba08b0ec0266f505bfe06e49e993091157e19c93 (patch)
tree1da97715243a059a8259559f2e48b9ca75f47ad1 /CMakeLists.txt
parent34aea4361f829d3e4f1e4d50324e155ad4adec67 (diff)
downloadflatbuffers-ba08b0ec0266f505bfe06e49e993091157e19c93.tar.gz
flatbuffers-ba08b0ec0266f505bfe06e49e993091157e19c93.tar.bz2
flatbuffers-ba08b0ec0266f505bfe06e49e993091157e19c93.zip
Add include directory to CMake install targets (#4510)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt38
1 files changed, 28 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5599fda2..c3974b3d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -260,10 +260,18 @@ if(FLATBUFFERS_INSTALL)
)
if(FLATBUFFERS_BUILD_FLATLIB)
- install(
- TARGETS flatbuffers EXPORT FlatbuffersTargets
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- )
+ if(CMAKE_VERSION VERSION_LESS 3.0)
+ install(
+ TARGETS flatbuffers EXPORT FlatbuffersTargets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+ else()
+ install(
+ TARGETS flatbuffers EXPORT FlatbuffersTargets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+ endif()
install(EXPORT FlatbuffersTargets
FILE FlatbuffersTargets.cmake
@@ -289,12 +297,22 @@ if(FLATBUFFERS_INSTALL)
endif()
if(FLATBUFFERS_BUILD_SHAREDLIB)
- install(
- TARGETS flatbuffers_shared EXPORT FlatbuffersSharedTargets
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- )
+ if(CMAKE_VERSION VERSION_LESS 3.0)
+ install(
+ TARGETS flatbuffers_shared EXPORT FlatbuffersSharedTargets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+ else()
+ install(
+ TARGETS flatbuffers_shared EXPORT FlatbuffersSharedTargets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+ endif()
install(
EXPORT FlatbuffersSharedTargets