You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmake_minimum_required(VERSION 3.8)
project(lcm-toy)
find_package(lcm REQUIRED)
include(${LCM_USE_FILE})
lcm_wrap_types(C_SOURCES c_sources C_HEADERS c_headers vector_t.lcm)
lcm_add_library(lcm-toy C STATIC${c_sources}${c_headers})
target_include_directories(lcm-toy PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
and the LCM message definition file vector_t.lcm:
struct vector_t
{
double x;
double y;
double z;
}
I get this failure when attempting to build the CMake project:
$ mkdir build
$ cd build
$ cmake ..
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /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: /usr/bin/c++
-- Check for working CXX compiler: /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
-- Generating done-- Build files have been written to: /home/gregjm/c/lcm-toy/build
$ cmake --build .
Scanning dependencies of target lcm-toy.sources
[ 25%] Generating _vector_t.h, _vector_t.c
[ 25%] Built target lcm-toy.sources
[ 50%] Generating _vector_t.h, _vector_t.c
Scanning dependencies of target lcm-toy
[ 50%] Generating _vector_t.h, _vector_t.c
[ 75%] Building C object CMakeFiles/lcm-toy.dir/_vector_t.c.o
cc: error: /home/gregjm/c/lcm-toy/build/_vector_t.c: No such file or directory
cc: fatal error: no input files
compilation terminated.
gmake[2]: *** [CMakeFiles/lcm-toy.dir/build.make:70: CMakeFiles/lcm-toy.dir/_vector_t.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:104: CMakeFiles/lcm-toy.dir/all] Error 2
gmake: *** [Makefile:84: all] Error 2
$ ls
CMakeCache.txt CMakeFiles/ cmake_install.cmake Makefile vector_t.c vector_t.h
Note that the files vector_t.h and vector_t.c are being generated, but the target lcm-types is attempting to compile using the file _vector_t.c.
I have created a pull request, #284, to address this issue.
The text was updated successfully, but these errors were encountered:
Given the following CMakeLists.txt:
and the LCM message definition file
vector_t.lcm
:I get this failure when attempting to build the CMake project:
Note that the files
vector_t.h
andvector_t.c
are being generated, but the targetlcm-types
is attempting to compile using the file_vector_t.c
.I have created a pull request, #284, to address this issue.
The text was updated successfully, but these errors were encountered: