include("${CMAKE_CURRENT_LIST_DIR}/LagomTargets.cmake") if (@ENABLE_JAKT@) # FIXME: corrosion does not support corrosion_install(TARGETS ... EXPORT ) # Instead, hack up the magic sauce using the imported location of IPCCompiler # Create imported target Lagom::jakt add_executable(Lagom::jakt IMPORTED) # Figure out where the binary directory of the install tree is get_property(_IMPORTED_BINDIR TARGET Lagom::IPCCompiler PROPERTY LOCATION ) get_filename_component(_IMPORTED_BINDIR "${_IMPORTED_BINDIR}" DIRECTORY) get_filename_component(_IMPORTED_INCLUDEDIR "${_IMPORTED_BINDIR}" DIRECTORY) set(_IMPORTED_INCLUDEDIR "${_IMPORTED_INCLUDEDIR}/include") # Set the imported location of the tool set_target_properties(Lagom::jakt PROPERTIES IMPORTED_LOCATION "${_IMPORTED_BINDIR}/jakt" IMPORTED_INCLUDE_DIRECTORIES "${_IMPORTED_INCLUDEDIR}/jakt" ) if (NOT EXISTS "${_IMPORTED_BINDIR}/jakt") message(FATAL_ERROR "The imported target \"jakt\" references the file \"${_IMPORTED_BINDIR}/jakt\" but this file does not exist.") endif() unset(_IMPORTED_BINDIR) unset(_IMPORTED_INCLUDEDIR) endif()