From da0f096ba220ec49bafc0743773a46524dd79832 Mon Sep 17 00:00:00 2001 From: franramirez688 Date: Sat, 31 Jan 2015 11:14:59 -0500 Subject: [PATCH] Added biicode support via biicode.conf and CMake/biicode.cmake Change-Id: Id9750cceaa57aad3c969cf12299aa60f21c29074 --- CMake/biicode.cmake | 22 ++++++++++++++++++++++ CMakeLists.txt | 6 ++++++ biicode.conf | 5 +++++ 3 files changed, 33 insertions(+) create mode 100644 CMake/biicode.cmake create mode 100644 biicode.conf diff --git a/CMake/biicode.cmake b/CMake/biicode.cmake new file mode 100644 index 000000000..225b669ac --- /dev/null +++ b/CMake/biicode.cmake @@ -0,0 +1,22 @@ +# Initializes block variables +INIT_BIICODE_BLOCK() + +# Copying data files to project/bin folder +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/samples") + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/samples/monster.fbs" + "${CMAKE_CURRENT_SOURCE_DIR}/samples/monsterdata.json" + DESTINATION + "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/samples") +endif() +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests") + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" + DESTINATION + "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +endif() + +# Actually create targets: EXEcutables and libraries. +ADD_BIICODE_TARGETS() + +string(REPLACE " " ";" REPLACED_FLAGS ${CMAKE_CXX_FLAGS}) +target_compile_options(${BII_BLOCK_TARGET} INTERFACE ${REPLACED_FLAGS}) +target_include_directories(${BII_BLOCK_TARGET} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b22dedfc..823de9c10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,12 @@ if(FLATBUFFERS_CODE_COVERAGE) "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") endif() +if(BIICODE) + # Execute biicode building + include(CMake/biicode.cmake) + return() +endif(BIICODE) + include_directories(include) if(FLATBUFFERS_BUILD_FLATC) diff --git a/biicode.conf b/biicode.conf new file mode 100644 index 000000000..f619c3372 --- /dev/null +++ b/biicode.conf @@ -0,0 +1,5 @@ +# Biicode configuration file + +[paths] + # Local directories to look for headers (within block) + include