Is there a way to find a package only once an external project is compiled, since the package to find is created once this external project compiled ?
For now, I have:
include(ExternalProject)
externalproject_add(
libantlr3c
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/libantlr3c-3.1.3
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/libantlr3c-3.1.3/configure -prefix=${CMAKE_CURRENT_SOURCE_DIR}/lib/libantlr3c-3.1.3
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/lib/libantlr3c-3.1.3
BUILD_COMMAND make
BUILD_IN_SOURCE 1
)
find_library(
antlr3c
libantlr3c.a
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libantlr3c-3.1.3
)
That fails, of course.
Thank you.
Since you control where the libraries are created, there’s no need to use
find_library. You can uselink_directoriesdirectly. You’ll probably want the same for the include directories to add the include paths to the compile line. Something like this ought to do it: