Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This project can not be installed by colcon build #31

Open
felixf4xu opened this issue Jul 20, 2023 · 0 comments
Open

This project can not be installed by colcon build #31

felixf4xu opened this issue Jul 20, 2023 · 0 comments

Comments

@felixf4xu
Copy link

Windows 11 and Visual Studio.

steps:

  1. create an empty workspace: d:\ws
  2. put this project to d:\ws\src\mrt_cmake_modules
  3. in d:\ws, run colcon build

error:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\colcon_core\executor_init_.py", line 91, in call
rc = await self.task(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\colcon_core\task_init_.py", line 93, in call
return await task_method(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\colcon_ros\task\catkin\build.py", line 75, in build
rc = await extension.build(
File "C:\Program Files\Python310\lib\site-packages\colcon_cmake\task\cmake\build.py", line 103, in build
rc = await self._build(
File "C:\Program Files\Python310\lib\site-packages\colcon_cmake\task\cmake\build.py", line 236, in build
if not await has_target(args.build_base, target):
File "C:\Program Files\Python310\lib\site-packages\colcon_cmake\task\cmake_init
.py", line 62, in has_target
assert target == 'install'
AssertionError

for C:\Program Files\Python310\lib\site-packages\colcon_cmake\task\cmake\__init__.py

async def has_target(path, target):
    """
    Check if the CMake generated build system has a specific target.

    :param str path: The path of the directory contain the generated build
      system
    :param str target: The name of the target
    :rtype: bool
    """
    generator = get_generator(path)
    if 'Unix Makefiles' in generator:
        return target in await get_makefile_targets(path)
    if 'Ninja' in generator:
        return target in get_ninja_targets(path)
    if 'Visual Studio' in generator:
        print(target)
        assert target == 'install'                                             <-- error
        install_project_file = get_project_file(path, 'INSTALL')
        return install_project_file is not None
    assert False, \
        "'has_target' not implemented for CMake generator '{generator}'" \
        .format_map(locals())

print(target) is for debug and its output is

tests

so assert target == 'install' failed

ps:
if I do a normal cmake --build (not colcon), it compiles ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant