Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue regarding CMake Error: No source given to target

I am trying to add FreeRtos to a project of mine using cmake and eclipse but I am getting an error. I am running debian 10 and my cmake version is 3.13.4. The files for cmake can be found at this git repo. When I run the following command:

frank@debian:~/temp2/build$ cmake ../../temp2/AM335X-FreeRTOS-lwip/ -G"Eclipse CDT4 - Unix Makefiles"

I get the following error:

    CMake Error at ProjectIncludes.cmake:46 (add_library):
  No SOURCES given to target: lib_third_party_ti_platform_beaglebone
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:30 (add_library):
  No SOURCES given to target: lib_third_party_ti_utils
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:38 (add_library):
  No SOURCES given to target: lib_third_party_ti_mmcsdlib
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:54 (add_library):
  No SOURCES given to target: lib_third_party_ti_nandlib
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at CMakeLists.txt:15 (add_executable):
  No SOURCES given to target: freeRTOSBBB.elf


CMake Error at ProjectIncludes.cmake:23 (add_library):
  No SOURCES given to target: lib_third_party_ti_drivers
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:115 (add_library):
  No SOURCES given to target:
  lib_third_party_amazon_freertos_kernel_portable_MemMang
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:86 (add_library):
  No SOURCES given to target:
  lib_third_party_amazon_libraries_3rdparty_lwip_src
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:101 (add_library):
  No SOURCES given to target: src_portable_lwip_ports_cpsw_netif
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:106 (add_library):
  No SOURCES given to target: lib_third_party_amazon_freertos_kernel
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:111 (add_library):
  No SOURCES given to target:
  src_portable_FreeRTOS_portable_GCC_ARM_CA8_amm335x
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:65 (add_library):
  No SOURCES given to target: lib_third_party_ti_system_config_armv7a
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:134 (add_library):
  No SOURCES given to target: src_application
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:120 (add_library):
  No SOURCES given to target: src_portable_AM335X
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)


CMake Error at ProjectIncludes.cmake:129 (add_library):
  No SOURCES given to target: src_portable_ported_aws_bufpool
Call Stack (most recent call first):
  CMakeLists.txt:33 (include)
like image 833
programmer25 Avatar asked Feb 26 '26 02:02

programmer25


1 Answers

For me (came here from Google), this error occurred when CMake target_sources had only PRIVATE sources, and no PUBLIC sources.

I had to make at least one PUBLIC source file:

old:

target_sources(${PROJECT_NAME}
        PRIVATE
        External/dbscan.cpp

        main.cpp
        )

new:

target_sources(${PROJECT_NAME}
        PRIVATE
        External/dbscan.cpp

        PUBLIC
        main.cpp
        )
like image 91
Gulzar Avatar answered Feb 27 '26 16:02

Gulzar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!