diff --git a/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake b/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake index 12fd9f4d9bd..7b8e79621f6 100644 --- a/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake +++ b/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.7) if(POLICY CMP0114) - cmake_policy(SET CMP0114 NEW) + cmake_policy(SET CMP0114 NEW) endif() include(ExternalProject) @@ -139,6 +139,10 @@ add_library(antlr4_static STATIC IMPORTED) add_dependencies(antlr4_static antlr4_runtime-build_static) set_target_properties(antlr4_static PROPERTIES IMPORTED_LOCATION ${ANTLR4_STATIC_LIBRARIES}) +target_link_libraries(antlr4_static + INTERFACE + ${ANTLR4_INCLUDE_DIRS} +) ExternalProject_Add_Step( antlr4_runtime @@ -156,6 +160,11 @@ add_library(antlr4_shared SHARED IMPORTED) add_dependencies(antlr4_shared antlr4_runtime-build_shared) set_target_properties(antlr4_shared PROPERTIES IMPORTED_LOCATION ${ANTLR4_RUNTIME_LIBRARIES}) +target_link_libraries(antlr4_shared + INTERFACE + ${ANTLR4_INCLUDE_DIRS} +) + if(ANTLR4_SHARED_LIBRARIES) set_target_properties(antlr4_shared PROPERTIES IMPORTED_IMPLIB ${ANTLR4_SHARED_LIBRARIES})