diff options
author | Leander Bessa Beernaert <leanderbb@gmail.com> | 2015-01-02 13:51:31 +0100 |
---|---|---|
committer | Wouter van Oortmerssen <wvo@google.com> | 2015-01-07 15:41:59 -0800 |
commit | 3ec8d7f598b0319dc845830116252f051b45b2bc (patch) | |
tree | 343036fd3b14089dd529d8f8b625cfa2c1a17780 /CMakeLists.txt | |
parent | 352b743c710367e496113ab1d8d76984f181a3eb (diff) | |
download | flatbuffers-3ec8d7f598b0319dc845830116252f051b45b2bc.tar.gz flatbuffers-3ec8d7f598b0319dc845830116252f051b45b2bc.tar.bz2 flatbuffers-3ec8d7f598b0319dc845830116252f051b45b2bc.zip |
Added option FLATBUFFERS_BUILD_FLATC
When FLATBUFFERS_BUILD_FLATC is set to OFF, the flatbuffer compiler
and tests will not be build.
Change-Id: I42b87b71daab4cb9c06605c813e7e4b62d6bf67a
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 811e6f2f..9b22dedf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,13 @@ project(FlatBuffers) option(FLATBUFFERS_CODE_COVERAGE "Enable the code coverage build option." OFF) option(FLATBUFFERS_BUILD_TESTS "Enable the build of tests and samples." ON) option(FLATBUFFERS_INSTALL "Enable the installation of targets." ON) +option(FLATBUFFERS_BUILD_FLATC "Enable the build of the flatbuffers compiler" ON) + +if(NOT FLATBUFFERS_BUILD_FLATC AND FLATBUFFERS_BUILD_TESTS) + message(WARNING + "Cannot build tests without building the compiler. Tests will be disabled.") + set(FLATBUFFERS_BUILD_TESTS OFF) +endif() set(FlatBuffers_Compiler_SRCS include/flatbuffers/flatbuffers.h @@ -69,7 +76,9 @@ endif() include_directories(include) +if(FLATBUFFERS_BUILD_FLATC) add_executable(flatc ${FlatBuffers_Compiler_SRCS}) +endif() function(compile_flatbuffers_schema_to_cpp SRC_FBS) get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH) @@ -93,7 +102,9 @@ endif() if(FLATBUFFERS_INSTALL) install(DIRECTORY include/flatbuffers DESTINATION include) - install(TARGETS flatc DESTINATION bin) + if(FLATBUFFERS_BUILD_FLATC) + install(TARGETS flatc DESTINATION bin) + endif() endif() if(FLATBUFFERS_BUILD_TESTS) |