cmake: use an external antlr2 if available

Look for an installed antlr v2, and if available use it instead of its
embedded copy.
This commit is contained in:
Pino Toscano
2015-05-03 15:44:42 +02:00
parent dbad366d96
commit ae08f772a2
3 changed files with 89 additions and 8 deletions
+11 -3
View File
@@ -5,7 +5,7 @@ else()
add_definitions(${QT_DEFINITIONS})
endif()
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${ANTLR_DIR}" ..)
include_directories("${CMAKE_CURRENT_BINARY_DIR}" ..)
# test-sqlobjects
@@ -58,8 +58,16 @@ if(USE_QT5)
set(QT_LIBRARIES "")
endif()
add_dependencies(test-sqlobjects antlr)
target_link_libraries(test-sqlobjects antlr ${QT_LIBRARIES} ${LIBSQLITE})
if(ANTLR2_FOUND)
else()
add_dependencies(test-sqlobjects antlr)
endif()
target_link_libraries(test-sqlobjects ${QT_LIBRARIES} ${LIBSQLITE})
if(ANTLR2_FOUND)
target_link_libraries(test-sqlobjects ${ANTLR2_LIBRARIES})
else()
target_link_libraries(test-sqlobjects antlr)
endif()
add_test(test-sqlobjects test-sqlobjects)
# test-import