CMake Internal Error during exporting target that comes from ExternalProject_Add function.
I noticed a problem with exporting target that comes from ExternalProject_Add function.
Is there better way to do this?
i am using CMake 3.13
[user@localhost b2]$ cmake -G"Unix Makefiles" -DCMAKE_PREFIX_PATH="/home/user/repo" .. && cmake --build .
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- Check for working C compiler: /opt/rh/devtoolset-7/root/usr/bin/cc
-- Check for working C compiler: /opt/rh/devtoolset-7/root/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/rh/devtoolset-7/root/usr/bin/c++
-- Check for working CXX compiler: /opt/rh/devtoolset-7/root/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Internal Error (please report a bug) in CMakeLists.txt:
GetLibraryNames called on imported target: libonigmo
Note: The stack trace will not use advanced capabilities because this is a release build.
0xc4ba49 : cmsys::SystemInformationImplementation::GetProgramStack(int, int) [(cmake) ???:-1]
0xc46f58 : cmsys::SystemInformation::GetProgramStack(int, int) [(cmake) ???:-1]
0xb7b8c2 : displayMessage(cmake::MessageType, std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >&) [(cmake) ???:-1]
0xb7bbfa : cmMessenger::DisplayMessage(cmake::MessageType, std::string const&, cmListFileBacktrace const&) const [(cmake) ???:-1]
0xb7bb32 : cmMessenger::IssueMessage(cmake::MessageType, std::string const&, cmListFileBacktrace const&) const [(cmake) ???:-1]
0x94627b : cmake::IssueMessage(cmake::MessageType, std::string const&, cmListFileBacktrace const&) const [(cmake) ???:-1]
0x85a41c : cmLocalGenerator::IssueMessage(cmake::MessageType, std::string const&) const [(cmake) ???:-1]
0xacb70d : cmGeneratorTarget::GetLibraryNames(std::string&, std::string&, std::string&, std::string&, std::string&, std::string const&) const [(cmake) ???:-1]
0xb450bd : cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream&, std::string const&, cmScriptGeneratorIndent) [(cmake) ???:-1]
0x8e8d7d : cmScriptGenerator::GenerateScriptActions(std::ostream&, cmScriptGeneratorIndent) [(cmake) ???:-1]
0x8e8ef4 : cmScriptGenerator::GenerateScriptActionsOnce(std::ostream&, cmScriptGeneratorIndent) [(cmake) ???:-1]
0x8e902c : cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream&, cmScriptGeneratorIndent) [(cmake) ???:-1]
0x8e8d1b : cmScriptGenerator::GenerateScriptConfigs(std::ostream&, cmScriptGeneratorIndent) [(cmake) ???:-1]
0xb3ef43 : cmInstallGenerator::GenerateScript(std::ostream&) [(cmake) ???:-1]
0xb44756 : cmInstallTargetGenerator::GenerateScript(std::ostream&) [(cmake) ???:-1]
0x8e8925 : cmScriptGenerator::Generate(std::ostream&, std::string const&, std::vector<std::string, std::allocator<std::string> > const&) [(cmake) ???:-1]
0x85c307 : cmLocalGenerator::GenerateInstallRules() [(cmake) ???:-1]
0xb098d0 : cmGlobalGenerator::Generate() [(cmake) ???:-1]
0xb29e7c : cmGlobalUnixMakefileGenerator3::Generate() [(cmake) ???:-1]
0x942b1d : cmake::Generate() [(cmake) ???:-1]
0x9429cc : cmake::Run(std::vector<std::string, std::allocator<std::string> > const&, bool) [(cmake) ???:-1]
0x82a87d : do_cmake(int, char const* const*) [(cmake) ???:-1]
0x829e22 : main [(cmake) ???:-1]
0x7faec6bf83d5 : __libc_start_main [(libc.so.6) ???:-1]
0x829645 : ??? [(???) ???:-1]
cmake: /home/user/cmake-3.13.2/Source/cmGeneratorTarget.cxx:1893: void cmGeneratorTarget::ComputeLinkClosure(const string&, cmGeneratorTarget::LinkClosure&) const: Assertion `impl' failed.
Przerwane (core dumped)
[user@localhost b2]$
[user@localhost b2]$
My CMakeLists.txt
cmake_minimum_required(VERSION 3.13)
project(test-project)
include(ExternalProject)
ExternalProject_Add(onigmo
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/onigmo
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/onigmo/configure ${AUTOCONF_HOST_OPT} --with-pic --disable-shared --enable-static --prefix=<INSTALL_DIR>
CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
BUILD_COMMAND $(MAKE)
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
INSTALL_COMMAND $(MAKE) install)
add_library(libonigmo STATIC IMPORTED GLOBAL)
set_target_properties(libonigmo PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/libonigmo.a")
add_dependencies(libonigmo onigmo)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/include/")
add_library(test-project test.cpp)
target_link_libraries(test-project PUBLIC libonigmo)
install(
TARGETS test-project libonigmo
EXPORT test-project
ARCHIVE DESTINATION lib/
LIBRARY DESTINATION lib/
RUNTIME DESTINATION bin/)
install(
EXPORT test-project
FILE test-project-config.cmake
NAMESPACE test-project::
DESTINATION share/test-project/cmake)