build user example with cmake and test it
This commit is contained in:
parent
9d484de82a
commit
7e4aba9a6d
|
|
@ -32,7 +32,8 @@ configure
|
|||
ethercat.spec
|
||||
examples/dc_user/ec_dc_user_example
|
||||
examples/user/ec_user_example
|
||||
lib/EtherCATConfig.cmake
|
||||
examples/user/build/
|
||||
lib/*.cmake
|
||||
lib/libethercat.la
|
||||
lib/libethercat.pc
|
||||
libtool
|
||||
|
|
|
|||
|
|
@ -10,6 +10,19 @@ build:
|
|||
- make -j8 all modules
|
||||
- make DISTCHECK_CONFIGURE_FLAGS="--with-linux-dir=/usr/src/linux-obj/$(uname -i)/default" distcheck
|
||||
|
||||
test cmake:
|
||||
stage: test
|
||||
|
||||
script:
|
||||
- ./bootstrap
|
||||
- ./configure --prefix=/tmp/ethercat_test_dir --disable-kernel
|
||||
- make -j8 install
|
||||
- cd examples/user
|
||||
- mkdir build && cd build
|
||||
- cmake -DCMAKE_PREFIX_PATH=/tmp/ethercat_test_dir -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make
|
||||
- ldd userexample
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
rules:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
project(EtherCatUserExample C)
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
|
||||
find_package(EtherCAT REQUIRED)
|
||||
|
||||
add_executable(userexample
|
||||
main.c
|
||||
)
|
||||
|
||||
target_link_libraries(userexample PUBLIC EtherLab::ethercat)
|
||||
Loading…
Reference in New Issue