getting_started:say_hello
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
getting_started:say_hello [2019/04/25 11:44] – [Test Program] graf | getting_started:say_hello [2020/01/23 15:22] – [Use KDevelop with Existing Build Configuration] graf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Say Hello with EEROS ====== | ====== Say Hello with EEROS ====== | ||
- | In order to be able to write your own EEROS programs or alter existing example applications, | + | In order to be able to write your own EEROS programs or alter existing example applications, |
===== Preparation ===== | ===== Preparation ===== | ||
Line 12: | Line 12: | ||
- Create a new C++ project: | - Create a new C++ project: | ||
- Project -> New from Template... | - Project -> New from Template... | ||
- | - Choose Standard/ | + | - Choose Standard/ |
- Create the project by clicking Finish | - Create the project by clicking Finish | ||
- | - Create the build configuration. It is recommended to put the target architecture in the name of the build folder. Put the location where EEROS is installed in the " | + | - Create the build configuration. It is recommended to put the target architecture in the name of the build folder. Put the location where EEROS is installed in the " |
===== Test Program ===== | ===== Test Program ===== | ||
Line 35: | Line 34: | ||
} | } | ||
</ | </ | ||
- | - Open CMakeLists.txt file, delete the text written | + | - Open CMakeLists.txt file, delete the text written |
cmake_minimum_required(VERSION 3.5.1) | cmake_minimum_required(VERSION 3.5.1) | ||
- | + | project(helloworld) | |
- | project(test-project) | + | |
- | + | set(CMAKE_CXX_STANDARD 14) | |
find_package(EEROS REQUIRED) | find_package(EEROS REQUIRED) | ||
include_directories(${EEROS_INCLUDE_DIR}; | include_directories(${EEROS_INCLUDE_DIR}; | ||
link_directories(${EEROS_LIB_DIR}; | link_directories(${EEROS_LIB_DIR}; | ||
- | + | ||
- | set(CMAKE_CXX_FLAGS " | + | add_executable(helloworld |
- | + | target_link_libraries(helloworld | |
- | add_executable(test-project | + | </ |
- | target_link_libraries(test-project | + | |
- | </ | + | |
- Build the project by clicking on the " | - Build the project by clicking on the " | ||
===== Run the Hello World Program ===== | ===== Run the Hello World Program ===== | ||
+ | If you run your test program on the host machine continue below. | ||
+ | If you want to do a crossdevelopment, | ||
- Open a terminal | - Open a terminal | ||
- | - Navigate to the build folder of your project (e.g. cd /home/abajric/work/build-test-project-x86-64) | + | - Navigate to the build folder of your project (e.g. cd /home/you/ |
- | - Run the program with the command: ./testproject | + | - Run the program with the command: ./test-project |
- | {{ : | + | {{ : |
===== Use KDevelop with Existing Build Configuration ===== | ===== Use KDevelop with Existing Build Configuration ===== | ||
- | If you have previously built your application manually or with the aid of the EEROS build scripts ([[https:// | + | If you have previously built your application manually or with the aid of the [[getting_started:install_and_setup_development_environment# |
- Import the project by choosing the '' | - Import the project by choosing the '' | ||
- Right click on the project and open the project configuration panel. | - Right click on the project and open the project configuration panel. | ||
Line 67: | Line 66: | ||
- Click '' | - Click '' | ||
- Build | - Build | ||
+ | |||
+ | If you are using ROS in your applications make sure that you fullfill the necessary steps described in [[getting_started: |