diff --git a/CMakeLists.txt b/CMakeLists.txt index a6f21cb93..811e6f2fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,7 +72,7 @@ include_directories(include) add_executable(flatc ${FlatBuffers_Compiler_SRCS}) function(compile_flatbuffers_schema_to_cpp SRC_FBS) - get_filename_component(SRC_FBS_DIR ${SRC_FBS} DIRECTORY) + get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH) string(REGEX REPLACE "\\.fbs$" "_generated.h" GEN_HEADER ${SRC_FBS}) add_custom_command( OUTPUT ${GEN_HEADER}