nasa / cFE

The Core Flight System (cFS) Core Flight Executive (cFE)
Apache License 2.0
408 stars 200 forks source link

Compiling in external libraries #2014

Open space-individual opened 2 years ago

space-individual commented 2 years ago

Hi, I am currently trying to run the core flight executive on a FreeRTOS environment. I am currently using a community port based on an older version and am running into some difficulties during the linking stage. My main issue I believe is due to the fact that I am trying to link an externally compiled library that contains FreeRTOS and all of the device drivers generated by my IDE.

However, when I insert the following lines into the CMakeLists.txt file in the osal folder:

add_library(libfreertros STATIC IMPORTED)

set_target_properties(libfreertos PROPERTIES IMPORTED_LOCATION "/home/user1/projects/cfs/bsp/libfreertos.a")

I get an error: set_target_properties Can not find target to add properties to: libfreertos

Please let me know if this is the appropriate place to post this:

astroesteban commented 2 years ago

I don't know if you still need help with this but do you still get the same CMake error if you change the first line to:

add_library(libfreertos STATIC IMPORTED GLOBAL)

Per the CMake docs:

The target name has scope in the directory in which it is created and below, but the GLOBAL option extends visibility.

This might help resolve that error.