Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 2.8) |
| 2 | |
| 3 | project(FlatBuffers) |
| 4 | |
| 5 | # NOTE: Code coverage only works on Linux & OSX. |
| 6 | option(FLATBUFFERS_CODE_COVERAGE "Enable the code coverage build option." OFF) |
Stewart Miles | 3f85183 | 2014-09-10 16:01:13 -0700 | [diff] [blame] | 7 | option(FLATBUFFERS_BUILD_TESTS "Enable the build of tests and samples." ON) |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 8 | option(FLATBUFFERS_INSTALL "Enable the installation of targets." ON) |
Wouter van Oortmerssen | 3101e32 | 2016-07-01 18:08:51 -0700 | [diff] [blame] | 9 | option(FLATBUFFERS_BUILD_FLATLIB "Enable the build of the flatbuffers library" |
| 10 | ON) |
| 11 | option(FLATBUFFERS_BUILD_FLATC "Enable the build of the flatbuffers compiler" |
| 12 | ON) |
Alex Ames | d575321 | 2015-02-13 15:58:29 -0800 | [diff] [blame] | 13 | option(FLATBUFFERS_BUILD_FLATHASH "Enable the build of flathash" ON) |
Wouter van Oortmerssen | 48f37f9 | 2016-04-13 18:16:05 -0700 | [diff] [blame] | 14 | option(FLATBUFFERS_BUILD_GRPCTEST "Enable the build of grpctest" OFF) |
changnet | a15659e | 2016-09-07 01:12:04 +0800 | [diff] [blame] | 15 | option(FLATBUFFERS_BUILD_SHAREDLIB |
| 16 | "Enable the build of the flatbuffers shared library" |
| 17 | OFF) |
Leander Bessa Beernaert | 3ec8d7f | 2015-01-02 13:51:31 +0100 | [diff] [blame] | 18 | |
| 19 | if(NOT FLATBUFFERS_BUILD_FLATC AND FLATBUFFERS_BUILD_TESTS) |
| 20 | message(WARNING |
| 21 | "Cannot build tests without building the compiler. Tests will be disabled.") |
| 22 | set(FLATBUFFERS_BUILD_TESTS OFF) |
| 23 | endif() |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 24 | |
Martell Malone | 79d3cb6 | 2015-07-22 13:18:59 +0100 | [diff] [blame] | 25 | set(FlatBuffers_Library_SRCS |
Lakedaemon | 8a64afa | 2016-04-13 23:21:18 +0200 | [diff] [blame] | 26 | include/flatbuffers/code_generators.h |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 27 | include/flatbuffers/flatbuffers.h |
Alex Ames | d575321 | 2015-02-13 15:58:29 -0800 | [diff] [blame] | 28 | include/flatbuffers/hash.h |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 29 | include/flatbuffers/idl.h |
| 30 | include/flatbuffers/util.h |
Wouter van Oortmerssen | 81312c2 | 2015-05-21 16:33:29 -0700 | [diff] [blame] | 31 | include/flatbuffers/reflection.h |
| 32 | include/flatbuffers/reflection_generated.h |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 33 | src/idl_parser.cpp |
Martell Malone | 79d3cb6 | 2015-07-22 13:18:59 +0100 | [diff] [blame] | 34 | src/idl_gen_text.cpp |
Wouter van Oortmerssen | 7101224 | 2015-07-31 13:55:53 -0700 | [diff] [blame] | 35 | src/reflection.cpp |
Wouter van Oortmerssen | e98b191 | 2016-03-30 17:34:52 -0700 | [diff] [blame] | 36 | src/util.cpp |
Martell Malone | 79d3cb6 | 2015-07-22 13:18:59 +0100 | [diff] [blame] | 37 | ) |
| 38 | |
| 39 | set(FlatBuffers_Compiler_SRCS |
| 40 | ${FlatBuffers_Library_SRCS} |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 41 | src/idl_gen_cpp.cpp |
Wouter van Oortmerssen | 557c88c | 2014-09-16 17:37:17 -0700 | [diff] [blame] | 42 | src/idl_gen_general.cpp |
rw | 74d5f37 | 2014-07-11 16:12:35 -0700 | [diff] [blame] | 43 | src/idl_gen_go.cpp |
Evan Wallace | 224e33e | 2015-08-17 00:56:54 -0700 | [diff] [blame] | 44 | src/idl_gen_js.cpp |
Shuhei Taunma | 5ce8682 | 2015-11-05 16:19:28 +0900 | [diff] [blame] | 45 | src/idl_gen_php.cpp |
rw | 48dfc69 | 2014-12-16 00:32:11 -0800 | [diff] [blame] | 46 | src/idl_gen_python.cpp |
Wouter van Oortmerssen | d38b9af | 2014-09-26 16:46:30 -0700 | [diff] [blame] | 47 | src/idl_gen_fbs.cpp |
Wouter van Oortmerssen | 48f37f9 | 2016-04-13 18:16:05 -0700 | [diff] [blame] | 48 | src/idl_gen_grpc.cpp |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 49 | src/flatc.cpp |
Harsh Vardhan | 2e7806e | 2016-08-19 10:41:11 +0530 | [diff] [blame] | 50 | grpc/src/compiler/schema_interface.h |
Wouter van Oortmerssen | 48f37f9 | 2016-04-13 18:16:05 -0700 | [diff] [blame] | 51 | grpc/src/compiler/cpp_generator.h |
| 52 | grpc/src/compiler/cpp_generator.cc |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 53 | ) |
| 54 | |
Alex Ames | d575321 | 2015-02-13 15:58:29 -0800 | [diff] [blame] | 55 | set(FlatHash_SRCS |
| 56 | include/flatbuffers/hash.h |
| 57 | src/flathash.cpp |
| 58 | ) |
| 59 | |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 60 | set(FlatBuffers_Tests_SRCS |
Wouter van Oortmerssen | 7101224 | 2015-07-31 13:55:53 -0700 | [diff] [blame] | 61 | ${FlatBuffers_Library_SRCS} |
Wouter van Oortmerssen | d38b9af | 2014-09-26 16:46:30 -0700 | [diff] [blame] | 62 | src/idl_gen_fbs.cpp |
Wouter van Oortmerssen | 7101224 | 2015-07-31 13:55:53 -0700 | [diff] [blame] | 63 | src/idl_gen_general.cpp |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 64 | tests/test.cpp |
| 65 | # file generate by running compiler on tests/monster_test.fbs |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 66 | ${CMAKE_CURRENT_BINARY_DIR}/tests/monster_test_generated.h |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 67 | ) |
| 68 | |
| 69 | set(FlatBuffers_Sample_Binary_SRCS |
| 70 | include/flatbuffers/flatbuffers.h |
| 71 | samples/sample_binary.cpp |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 72 | # file generated by running compiler on samples/monster.fbs |
| 73 | ${CMAKE_CURRENT_BINARY_DIR}/samples/monster_generated.h |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 74 | ) |
| 75 | |
| 76 | set(FlatBuffers_Sample_Text_SRCS |
| 77 | include/flatbuffers/flatbuffers.h |
Alex Ames | d575321 | 2015-02-13 15:58:29 -0800 | [diff] [blame] | 78 | include/flatbuffers/hash.h |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 79 | include/flatbuffers/idl.h |
| 80 | include/flatbuffers/util.h |
| 81 | src/idl_parser.cpp |
| 82 | src/idl_gen_text.cpp |
Wouter van Oortmerssen | e98b191 | 2016-03-30 17:34:52 -0700 | [diff] [blame] | 83 | src/util.cpp |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 84 | samples/sample_text.cpp |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 85 | # file generated by running compiler on samples/monster.fbs |
| 86 | ${CMAKE_CURRENT_BINARY_DIR}/samples/monster_generated.h |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 87 | ) |
| 88 | |
Wouter van Oortmerssen | 48f37f9 | 2016-04-13 18:16:05 -0700 | [diff] [blame] | 89 | set(FlatBuffers_GRPCTest_SRCS |
| 90 | include/flatbuffers/flatbuffers.h |
| 91 | include/flatbuffers/grpc.h |
| 92 | tests/monster_test.grpc.fb.h |
| 93 | tests/monster_test.grpc.fb.cc |
| 94 | grpc/tests/grpctest.cpp |
| 95 | # file generated by running compiler on samples/monster.fbs |
| 96 | ${CMAKE_CURRENT_BINARY_DIR}/samples/monster_generated.h |
| 97 | ) |
| 98 | |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 99 | # source_group(Compiler FILES ${FlatBuffers_Compiler_SRCS}) |
| 100 | # source_group(Tests FILES ${FlatBuffers_Tests_SRCS}) |
| 101 | |
Andrew Hundt | 520d684 | 2016-10-05 16:20:30 -0400 | [diff] [blame^] | 102 | if(EXISTS "${CMAKE_TOOLCHAIN_FILE}") |
| 103 | # do not apply any global settings if the toolchain |
| 104 | # is being configured externally |
| 105 | elseif(APPLE) |
Jason Sanmiya | 30c07f4 | 2016-07-22 19:04:23 -0700 | [diff] [blame] | 106 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") |
| 107 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra") |
Wouter van Oortmerssen | 932b22f | 2015-05-27 16:57:21 -0700 | [diff] [blame] | 108 | elseif(CMAKE_COMPILER_IS_GNUCXX) |
Tony Kelman | 4c16038 | 2016-04-01 21:42:23 -0700 | [diff] [blame] | 109 | if(CYGWIN) |
| 110 | set(CMAKE_CXX_FLAGS |
| 111 | "${CMAKE_CXX_FLAGS} -std=gnu++11") |
| 112 | else(CYGWIN) |
| 113 | set(CMAKE_CXX_FLAGS |
| 114 | "${CMAKE_CXX_FLAGS} -std=c++0x") |
| 115 | endif(CYGWIN) |
Wouter van Oortmerssen | bc5fa9d | 2014-08-25 10:42:38 -0700 | [diff] [blame] | 116 | set(CMAKE_CXX_FLAGS |
Tony Kelman | 4c16038 | 2016-04-01 21:42:23 -0700 | [diff] [blame] | 117 | "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow") |
maurice barnum | 697cad7 | 2016-02-11 00:03:53 +0000 | [diff] [blame] | 118 | if (GCC_VERSION VERSION_GREATER 4.4) |
| 119 | set(CMAKE_CXX_FLAGS |
| 120 | "${CMAKE_CXX_FLAGS} -Wunused-result -Werror=unused-result") |
| 121 | endif() |
Will Gardner | ce4d331 | 2016-02-29 17:28:40 +0000 | [diff] [blame] | 122 | |
| 123 | # Certain platforms such as ARM do not use signed chars by default |
| 124 | # which causes issues with certain bounds checks. |
| 125 | set(CMAKE_CXX_FLAGS |
| 126 | "${CMAKE_CXX_FLAGS} -fsigned-char") |
| 127 | |
Wouter van Oortmerssen | 932b22f | 2015-05-27 16:57:21 -0700 | [diff] [blame] | 128 | elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") |
| 129 | set(CMAKE_CXX_FLAGS |
Wouter van Oortmerssen | 42e0b02 | 2016-07-22 15:46:26 -0700 | [diff] [blame] | 130 | "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++ -Wall -pedantic -Werror \ |
Wouter van Oortmerssen | 3101e32 | 2016-07-01 18:08:51 -0700 | [diff] [blame] | 131 | -Wextra") |
Yuri | 26f15bc | 2016-03-02 17:15:42 -0800 | [diff] [blame] | 132 | if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD") |
| 133 | set(CMAKE_EXE_LINKER_FLAGS |
| 134 | "${CMAKE_EXE_LINKER_FLAGS} -lc++abi") |
| 135 | endif() |
Will Gardner | ce4d331 | 2016-02-29 17:28:40 +0000 | [diff] [blame] | 136 | |
| 137 | # Certain platforms such as ARM do not use signed chars by default |
| 138 | # which causes issues with certain bounds checks. |
| 139 | set(CMAKE_CXX_FLAGS |
| 140 | "${CMAKE_CXX_FLAGS} -fsigned-char") |
| 141 | |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 142 | endif() |
| 143 | |
| 144 | if(FLATBUFFERS_CODE_COVERAGE) |
Stefan Eilemann | 52f4f45 | 2014-07-26 13:12:56 +0200 | [diff] [blame] | 145 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fprofile-arcs -ftest-coverage") |
Wouter van Oortmerssen | 8f80fec | 2014-07-29 10:29:38 -0700 | [diff] [blame] | 146 | set(CMAKE_EXE_LINKER_FLAGS |
| 147 | "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 148 | endif() |
| 149 | |
franramirez688 | da0f096 | 2015-01-31 11:14:59 -0500 | [diff] [blame] | 150 | if(BIICODE) |
franchuti688 | 23f75f5 | 2015-04-01 12:35:37 +0200 | [diff] [blame] | 151 | include(biicode/cmake/biicode.cmake) |
franramirez688 | da0f096 | 2015-01-31 11:14:59 -0500 | [diff] [blame] | 152 | return() |
franchuti688 | 23f75f5 | 2015-04-01 12:35:37 +0200 | [diff] [blame] | 153 | endif() |
franramirez688 | da0f096 | 2015-01-31 11:14:59 -0500 | [diff] [blame] | 154 | |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 155 | include_directories(include) |
Wouter van Oortmerssen | 48f37f9 | 2016-04-13 18:16:05 -0700 | [diff] [blame] | 156 | include_directories(grpc) |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 157 | |
Martell Malone | 79d3cb6 | 2015-07-22 13:18:59 +0100 | [diff] [blame] | 158 | if(FLATBUFFERS_BUILD_FLATLIB) |
| 159 | add_library(flatbuffers STATIC ${FlatBuffers_Library_SRCS}) |
| 160 | endif() |
| 161 | |
Leander Bessa Beernaert | 3ec8d7f | 2015-01-02 13:51:31 +0100 | [diff] [blame] | 162 | if(FLATBUFFERS_BUILD_FLATC) |
Alex Ames | d575321 | 2015-02-13 15:58:29 -0800 | [diff] [blame] | 163 | add_executable(flatc ${FlatBuffers_Compiler_SRCS}) |
Xiaolei Yu | 3a8bc30 | 2016-05-01 11:15:53 +0800 | [diff] [blame] | 164 | if(NOT FLATBUFFERS_FLATC_EXECUTABLE) |
| 165 | set(FLATBUFFERS_FLATC_EXECUTABLE $<TARGET_FILE:flatc>) |
| 166 | endif() |
Alex Ames | d575321 | 2015-02-13 15:58:29 -0800 | [diff] [blame] | 167 | endif() |
| 168 | |
Jason Sanmiya | f47660f | 2015-04-28 15:44:10 -0700 | [diff] [blame] | 169 | if(FLATBUFFERS_BUILD_FLATHASH) |
Alex Ames | d575321 | 2015-02-13 15:58:29 -0800 | [diff] [blame] | 170 | add_executable(flathash ${FlatHash_SRCS}) |
Leander Bessa Beernaert | 3ec8d7f | 2015-01-02 13:51:31 +0100 | [diff] [blame] | 171 | endif() |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 172 | |
changnet | a15659e | 2016-09-07 01:12:04 +0800 | [diff] [blame] | 173 | if(FLATBUFFERS_BUILD_SHAREDLIB) |
| 174 | add_library(flatbuffers_shared SHARED ${FlatBuffers_Library_SRCS}) |
| 175 | set_target_properties(flatbuffers_shared PROPERTIES OUTPUT_NAME flatbuffers) |
| 176 | endif() |
| 177 | |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 178 | function(compile_flatbuffers_schema_to_cpp SRC_FBS) |
Wouter van Oortmerssen | 4cdf3eb | 2014-10-24 14:26:29 -0700 | [diff] [blame] | 179 | get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH) |
Wouter van Oortmerssen | 7b80535 | 2014-09-23 11:55:42 -0700 | [diff] [blame] | 180 | string(REGEX REPLACE "\\.fbs$" "_generated.h" GEN_HEADER ${SRC_FBS}) |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 181 | add_custom_command( |
| 182 | OUTPUT ${GEN_HEADER} |
Wouter van Oortmerssen | 3101e32 | 2016-07-01 18:08:51 -0700 | [diff] [blame] | 183 | COMMAND "${FLATBUFFERS_FLATC_EXECUTABLE}" -c --no-includes --gen-mutable |
| 184 | --gen-object-api -o "${SRC_FBS_DIR}" |
| 185 | "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FBS}" |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 186 | DEPENDS flatc) |
| 187 | endfunction() |
| 188 | |
Wouter van Oortmerssen | 81312c2 | 2015-05-21 16:33:29 -0700 | [diff] [blame] | 189 | function(compile_flatbuffers_schema_to_binary SRC_FBS) |
| 190 | get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH) |
| 191 | string(REGEX REPLACE "\\.fbs$" ".bfbs" GEN_BINARY_SCHEMA ${SRC_FBS}) |
| 192 | add_custom_command( |
| 193 | OUTPUT ${GEN_BINARY_SCHEMA} |
Wouter van Oortmerssen | 3101e32 | 2016-07-01 18:08:51 -0700 | [diff] [blame] | 194 | COMMAND "${FLATBUFFERS_FLATC_EXECUTABLE}" -b --schema -o "${SRC_FBS_DIR}" |
| 195 | "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FBS}" |
Wouter van Oortmerssen | 81312c2 | 2015-05-21 16:33:29 -0700 | [diff] [blame] | 196 | DEPENDS flatc) |
| 197 | endfunction() |
| 198 | |
Stewart Miles | 3f85183 | 2014-09-10 16:01:13 -0700 | [diff] [blame] | 199 | if(FLATBUFFERS_BUILD_TESTS) |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 200 | compile_flatbuffers_schema_to_cpp(tests/monster_test.fbs) |
| 201 | include_directories(${CMAKE_CURRENT_BINARY_DIR}/tests) |
Stewart Miles | 3f85183 | 2014-09-10 16:01:13 -0700 | [diff] [blame] | 202 | add_executable(flattests ${FlatBuffers_Tests_SRCS}) |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 203 | |
| 204 | compile_flatbuffers_schema_to_cpp(samples/monster.fbs) |
| 205 | include_directories(${CMAKE_CURRENT_BINARY_DIR}/samples) |
Stewart Miles | 3f85183 | 2014-09-10 16:01:13 -0700 | [diff] [blame] | 206 | add_executable(flatsamplebinary ${FlatBuffers_Sample_Binary_SRCS}) |
| 207 | add_executable(flatsampletext ${FlatBuffers_Sample_Text_SRCS}) |
| 208 | endif() |
Wouter van Oortmerssen | 26a3073 | 2014-01-27 16:52:49 -0800 | [diff] [blame] | 209 | |
Wouter van Oortmerssen | 48f37f9 | 2016-04-13 18:16:05 -0700 | [diff] [blame] | 210 | if(FLATBUFFERS_BUILD_GRPCTEST) |
| 211 | if(CMAKE_COMPILER_IS_GNUCXX) |
| 212 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") |
| 213 | endif() |
| 214 | add_executable(grpctest ${FlatBuffers_GRPCTest_SRCS}) |
| 215 | target_link_libraries(grpctest grpc++_unsecure grpc pthread dl) |
| 216 | endif() |
| 217 | |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 218 | if(FLATBUFFERS_INSTALL) |
| 219 | install(DIRECTORY include/flatbuffers DESTINATION include) |
Martell Malone | 79d3cb6 | 2015-07-22 13:18:59 +0100 | [diff] [blame] | 220 | if(FLATBUFFERS_BUILD_FLATLIB) |
| 221 | install(TARGETS flatbuffers DESTINATION lib) |
| 222 | endif() |
Leander Bessa Beernaert | 3ec8d7f | 2015-01-02 13:51:31 +0100 | [diff] [blame] | 223 | if(FLATBUFFERS_BUILD_FLATC) |
| 224 | install(TARGETS flatc DESTINATION bin) |
| 225 | endif() |
changnet | a15659e | 2016-09-07 01:12:04 +0800 | [diff] [blame] | 226 | if(FLATBUFFERS_BUILD_SHAREDLIB) |
| 227 | install(TARGETS flatbuffers_shared DESTINATION lib) |
| 228 | endif() |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 229 | endif() |
Daniel Nachbaur | 7a99b3c | 2014-07-15 15:09:36 +0200 | [diff] [blame] | 230 | |
Stewart Miles | 3f85183 | 2014-09-10 16:01:13 -0700 | [diff] [blame] | 231 | if(FLATBUFFERS_BUILD_TESTS) |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 232 | enable_testing() |
| 233 | |
Wouter van Oortmerssen | 7b80535 | 2014-09-23 11:55:42 -0700 | [diff] [blame] | 234 | file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" DESTINATION |
| 235 | "${CMAKE_CURRENT_BINARY_DIR}") |
Zbigniew Mandziejewicz | 3f8700b | 2014-09-16 00:50:23 +0800 | [diff] [blame] | 236 | add_test(NAME flattests COMMAND flattests) |
Stewart Miles | 3f85183 | 2014-09-10 16:01:13 -0700 | [diff] [blame] | 237 | endif() |
Johan Euphrosine | 331d2d8 | 2015-11-17 13:39:37 -0800 | [diff] [blame] | 238 | |
| 239 | include(CMake/BuildFlatBuffers.cmake) |
Vitaly Isaev | 928effd | 2015-05-13 15:15:59 +0300 | [diff] [blame] | 240 | |
| 241 | if(FLATBUFFERS_PACKAGE_DEBIAN) |
| 242 | include(CMake/PackageDebian.cmake) |
| 243 | endif() |