Skip to content

Commit

Permalink
Merge pull request UCL#1295 from KrisThielemans/fix_STIR_local_doc
Browse files Browse the repository at this point in the history
correct doc on extra_stir_dirs.cmake
  • Loading branch information
KrisThielemans authored Dec 5, 2023
2 parents b5c21c3 + 70ebdbe commit 30cf642
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions documentation/STIR-developers-overview.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1261,8 +1261,21 @@ \section{
# add my include directory to compiler switches (or better: use target_include_directories)
include_directories(include)
# check CMakeLists in next directories
add_subdirectory(buildblock my_buildblock)
# check CMakeLists in next directory
# note: 2nd argument needs to have different name than any of the existing STIR libraries
add_subdirectory(${STIR_LOCAL}/buildblock my_buildblock)
# add registries (if you have any)
list(APPEND STIR_REGISTRIES
${STIR_LOCAL}/buildblock/my_registries.cxx)
# add to list of libraries to include in linking
list(APPEND STIR_LIBRARIES my_buildblock)
# copy variables to PARENT_SCOPE
SET( STIR_REGISTRIES ${STIR_REGISTRIES} PARENT_SCOPE)
SET( STIR_LIBRARIES ${STIR_LIBRARIES} PARENT_SCOPE)
\end{verbatim}
where \textbf{buildblock} is the name of your subdirectory and \textbf{my\_buildblock} is a name for the
sub-directory where CMake will build the files (make sure the latter is different from any
Expand All @@ -1286,12 +1299,6 @@ \section{
# declare dependencies on other STIR libraries, for instance
target_link_libraries($(dir) PUBLIC buildblock)
# add to list of libraries for STIR to include in linking
list(APPEND STIR_LIBRARIES $(dir))
# add source file for registries (if you have one)
list(APPEND STIR_REGISTRIES my_registry)
include(stir_lib_target)
\end{verbatim}

Expand All @@ -1311,7 +1318,7 @@ \section{
#include "myOutputFileFormat.h"
static myOutputFileFormat::RegisterIt dummy1;
\end{verbatim}
If you add that to the \texttt{STIR\_REGISTRIES} variable in your \textbf{CMakeLists.txt}
If you add that to the \texttt{STIR\_REGISTRIES} variable in your \textbf{extra\_stir\_dirs.cmake}
as above, everything should work as expected.

\section{Contributing to STIR}
Expand Down

0 comments on commit 30cf642

Please sign in to comment.