Separate the two concerns the repo root was mixing:
- src/ — bs/, modules/, libs/ (code + vendored libs)
- data/ — fpga_registry.yaml, probes.yaml, bsdl_files/, bscan_proxies/,
scripts/ (everything the tool reads at runtime, CWD-relative)
- doc/ — kept at the root
CMake: repoint DIR_MODULES/DIR_LIBS and add_subdirectory at src/; emit
the binary at the build/ root (build/bs) via CMAKE_RUNTIME_OUTPUT_DIRECTORY
instead of the nested build/src/bs/. The jtag_core ../../libs path still
resolves since modules and libs moved together.
Runtime default paths now point under data/ (fpga.c, probes.c, script.c
bsdl_files lookup, init.c config.script). Docs (README/tutorial/CLAUDE)
updated for the new layout, src/ module paths, and ./build/bs.
Validated on the IGLOO2/FlashPro: profiles, autoinit, and svf_play all
work run from the repo root.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
46 lines
1.7 KiB
CMake
46 lines
1.7 KiB
CMake
cmake_minimum_required(VERSION 3.10)
|
|
|
|
project(BoundaryScanExplorer)
|
|
|
|
# Put the built executable at the build/ root (build/bs), not nested under
|
|
# build/src/bs/ where the source tree would otherwise mirror it.
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
# Digilent JTAG-SMT* backend. The driver dlopen's libdjtg/libdmgr at
|
|
# runtime and degrades to "no probe" if they're absent, so building it
|
|
# in costs nothing — default ON. Needs <dlfcn.h>, so UNIX only.
|
|
if(UNIX)
|
|
set(BS_DIGILENT_DEFAULT ON)
|
|
else()
|
|
set(BS_DIGILENT_DEFAULT OFF)
|
|
endif()
|
|
option(BS_ENABLE_DIGILENT
|
|
"Enable Digilent JTAG-SMT* backend (dlopen libdjtg.so / libdmgr.so at runtime; Adept Runtime only needed to actually use such a probe)"
|
|
${BS_DIGILENT_DEFAULT})
|
|
|
|
# script and jtag_core must be the last linked archive for the application to compile
|
|
set(BS_MODULES script jtag_core)
|
|
set(DIR_MODULES ${CMAKE_SOURCE_DIR}/src/modules)
|
|
set(DIR_LIBS ${CMAKE_SOURCE_DIR}/src/libs)
|
|
|
|
# We dive into submodules
|
|
file(GLOB MODULES_DIRS RELATIVE ${DIR_MODULES} ${DIR_MODULES}/*)
|
|
foreach(module ${MODULES_DIRS})
|
|
set(module_path "${DIR_MODULES}/${module}")
|
|
|
|
# checks if it is a sub-directory and if it contains a cmake file
|
|
if(IS_DIRECTORY ${module_path} AND EXISTS "${module_path}/CMakeLists.txt")
|
|
message(STATUS "Submodule : ${module}")
|
|
# already existing modules are not included in the list
|
|
if(NOT ${module} IN_LIST BS_MODULES)
|
|
list(APPEND BS_MODULES ${module})
|
|
endif()
|
|
# We'll compile the module
|
|
add_subdirectory(src/modules/${module})
|
|
else()
|
|
message(STATUS "Ignored : ${module}")
|
|
endif()
|
|
endforeach()
|
|
|
|
add_subdirectory(src/bs)
|