User Tools

Site Tools


getting_started:write_app:use_on_host

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
getting_started:write_app:use_on_host [2021/03/24 19:02] – [Say Hello with EEROS] ursgrafgetting_started:write_app:use_on_host [2023/04/13 09:03] (current) – [Use Existing Project] ursgraf
Line 1: Line 1:
 ====== Writing EEROS Applications for the Host ====== ====== Writing EEROS Applications for the Host ======
 Back to [[getting_started:compile_eeros_host|]]. Back to [[getting_started:compile_eeros_host|]].
 +
 +You will use C++ to develop your EEROS applications. For this you need at least some knowledge of the basic language features. A good starting point might be [[https://www.cplusplus.com/doc/tutorial/]]. Minimal help can also be found under [[tools:cplusplus|]].
  
 What do you want to do next? What do you want to do next?
Line 8: Line 10:
  
 ===== Say Hello with EEROS ===== ===== Say Hello with EEROS =====
-  - Edit the file ''config.sh.in'' as follows <code> + 
-custom_application=hello +  - Create a project directory within your EEROS project directory and change into it with <code>
-</code> +
-  - Create a project directory and change into it with <code>+
 $ mkdir hello $ mkdir hello
 $ cd hello  $ cd hello 
Line 32: Line 32:
 </code> </code>
   - Create a text file "CMakeLists.txt" and copy the following text into it: <code cpp>   - Create a text file "CMakeLists.txt" and copy the following text into it: <code cpp>
-cmake_minimum_required(VERSION 3.5.1)+cmake_minimum_required(VERSION 3.10)
 project(helloworld) project(helloworld)
- 
-set(CMAKE_CXX_STANDARD 14) 
  
 find_package(EEROS REQUIRED) find_package(EEROS REQUIRED)
-include_directories(${EEROS_INCLUDE_DIR}) 
-link_directories(${EEROS_LIB_DIR}) 
  
 add_executable(helloworld main.cpp) add_executable(helloworld main.cpp)
-target_link_libraries(helloworld eeros ucl ${CMAKE_DL_LIBS})+target_link_libraries(helloworld PRIVATE eeros)
 </code>  </code> 
-  - Change back into your parent directory and build the project with <code> +  - Create a build directory for your new project and change into it with <code> 
-cd .. +mkdir build-x86 
-./make.sh+cd build-x86
 </code> </code>
 +  - Build the project with <code>
 +$ cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 ../../hello
 +$ make
 +</code>
 +  - Make changes to "main.cpp", save them and rebuild with <code>
 +$ make
 +</code> In order to be able to write your own EEROS programs, you could use any text editor. However, we recommend to use an integrated development environment, see [[getting_started:kdevelop|]].
 +
  
 Continue with [[getting_started:deploy:deploy_host|]]. Continue with [[getting_started:deploy:deploy_host|]].
Line 53: Line 57:
 ===== Use Existing Project ===== ===== Use Existing Project =====
 As an example we use the [[getting_started:tutorials:oneaxis|]] demo program. As an example we use the [[getting_started:tutorials:oneaxis|]] demo program.
-  Edit the file ''config.sh.in'' as follows <code> + 
-custom_application=simple-motor-control+  Fetch the code of the application from within your EEROS project directory with <code> 
 +$ git clone https://github.com/eeros-project/simple-motor-control.git 
 +$ cd simple-motor-control
 </code> </code>
-  - Fetch the code of the application with <code> +  - Create a build directory for your new project and change into it with <code> 
-./clone.sh+mkdir build-x86 
 +$ cd build-x86
 </code> </code>
   - Build the project with <code>   - Build the project with <code>
-$ ./make.sh+cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 -DREQUIRED_EEROS_VERSION=1.3 ../../simple-motor-control 
 +$ make
 </code> </code>
  
 Continue with [[getting_started:deploy:deploy_host|]]. Continue with [[getting_started:deploy:deploy_host|]].
  
getting_started/write_app/use_on_host.1616608929.txt.gz · Last modified: 2021/03/24 19:02 by ursgraf