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