fpgasystems / Coyote

Framework providing operating system abstractions and a range of shared networking (RDMA, TCP/IP) and memory services to common modern heterogeneous platforms.
MIT License
207 stars 62 forks source link

Out-of tree SW builds fail #68

Open quetric opened 1 month ago

quetric commented 1 month ago

The instructions to build software in the Coyote documentation don't work for out-of-tree builds because FindCoyoteSW.cmake uses CMAKE_SOURCE_DIR to identify sources and this envvar is set to the location of the caller CMakeLists.txt. In the case of Coyote software examples in examples_sw it just happens that the relative paths overlap.

You can confirm that this is the case as follows:

  1. move examples_sw to a new directory e.g. Coyote/foo/examples_sw and cd into it
  2. edit line 4 of Coyote/foo/examples_sw/CMakeLists.txt to point to the Coyote top-level folder
  3. run cmake -DEXAMPLES=reconfigure_shell .

The output of this will be

CMake Error at Coyote/cmake/FindCoyoteSW.cmake:93 (add_library): No SOURCES given to target: Coyote Call Stack (most recent call first): CMakeLists.txt:7 (find_package)

This can be fixed by using CMAKE_CURRENT_LIST_DIR instead of CMAKE_SOURCE_DIR in FindCoyoteSW.cmake