Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
docs
Commits
31352187
Commit
31352187
authored
Jan 18, 2021
by
Paul McCarthy
🚵
Browse files
ENH: Example c++ project/recipe
parent
dfa7e96f
Changes
8
Hide whitespace changes
Inline
Side-by-side
examples/cpp/example_cpp_project/Makefile
0 → 100644
View file @
31352187
include
${FSLCONFDIR}/default.mk
# All projects must specify a name. The
# source code for every project is
# installed into $FSLDIR/src/${PROJNAME}
PROJNAME
=
example_cpp_project
# All shared library dependencies required
# for linking a library or executable must
# be added to LIBS.
LIBS
=
-lfsl-newimage
-lfsl-NewNifti
-lfsl-znz
# The following variables can be populated
# with custom preprocessing, compilation,
# and linking flags, although in general
# this shouldn't be necessary. Do not set
# CPPFLAGS, CFLAGS, CXXFLAGS or LDFLAGS
# directly.
#
# - USRCPPFLAGS - C preprocessor flags
# - USRCFLAGS - C compiler flags
# - USRCXXFLAGS - C++ compiler flags
# - USRLDFLAGS - Linker flags
# Shared libraries that are provided by
# this project must be added to SOFILES.
# These files are installed into
# $FSLDIR/lib/.
SOFILES
=
libfsl-example_cpp_lib.so
# Executables that are provided by this
# project must be added to XFILES. These
# files are installed into $FSLDIR/bin/.
XFILES
=
example_cpp_exe
# The following variables can be populated
# to specify other outputs that are provided
# by your project:
# - AFILES - Static library files, installed
# into $FSLDIR/lib/
# - HFILES - Header files, installed into
# $FSLDIR/include/${PROJNAME}
# (defaults to *.h)
# - SCRIPTS - Executable scripts are installed
# into $FSLDIR/bin/.
# - DATAFILES - Data files are installed into
# $FSLDIR/data/${PROJNAME}
all
:
${XFILES} ${SOFILES}
libfsl-example_cpp_lib.so
:
example_cpp_lib.o
${CXX}
${CXXFLAGS}
-shared
-o
$@
$^
${LDFLAGS}
example_cpp_exe
:
example_cpp_exe.o libfsl-example_cpp_lib.so
${CXX}
${CXXFLAGS}
-o
$@
$<
-lfsl-example_cpp_lib
${LDFLAGS}
examples/cpp/example_cpp_project/example_cpp_exe.cpp
0 → 100644
View file @
31352187
#include
<iostream>
#include
"example_cpp_lib.h"
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
2
)
{
std
::
cout
<<
"Usage: example_cpp_exe name"
<<
std
::
endl
;
return
1
;
}
helloworld
(
argv
[
1
]);
return
0
;
}
examples/cpp/example_cpp_project/example_cpp_lib.cpp
0 → 100644
View file @
31352187
#include
<string>
#include
<iostream>
#include
"example_cpp_lib.h"
void
helloworld
(
std
::
string
s
)
{
std
::
cout
<<
"Hello, "
<<
s
<<
std
::
endl
;
}
examples/cpp/example_cpp_project/example_cpp_lib.h
0 → 100644
View file @
31352187
#ifndef EXAMPLE_CPP_LIB_H
#define EXAMPLE_CPP_LIB_H
#include
<string>
#include
<iostream>
void
helloworld
(
std
::
string
s
);
#endif
examples/cpp/fsl-example_cpp_project/build.sh
0 → 100644
View file @
31352187
#!/usr/bin/env bash
export
FSLDIR
=
$PREFIX
export
FSLDEVDIR
=
$PREFIX
mkdir
-p
$PREFIX
/src/
cp
-r
$(
pwd
)
$PREFIX
/src/
$PKG_NAME
.
$FSLDIR
/etc/fslconf/fsl-devel.sh
make
make
install
examples/cpp/fsl-example_cpp_project/meta.yaml
0 → 100644
View file @
31352187
# This is a FSL conda recipe for: example_cpp_project
# The project git repository is: https://git.fmrib.ox.ac.uk/fsl/example_cpp_project
# The git repository for this conda recipe is: https://git.fmrib.ox.ac.uk/fsl/conda/fsl-example_cpp_project
{
%
set name = fsl-example_cpp_project %
}
{
%
set version = 0.0.1 %
}
{
%
set repository = https
:
//git.fmrib.ox.ac.uk/fsl/example_cpp_project %
}
{
%
set build = '0' %
}
package
:
name
:
{{
name
}}
version
:
{{
version
}}
source
:
# the FSLCONDA_REPOSITORY and FSLCONDA_REVISION
# environment variables can be used to override
# the repository/revision for development purposes.
git_url
:
{{
'
{{
os.environ.get("FSLCONDA_REPOSITORY",
repository)
}}'
}}
git_rev
:
{{
'
{{
os.environ.get("FSLCONDA_REVISION",
version)
}}'
}}
build
:
number
:
{{
build
}}
run_exports
:
strong
:
-
{{
name
}}
requirements
:
host
:
-
{{
compiler("cxx")
}}
-
fsl-base >=2012.0
-
fsl-newnifti >=3.0.6
-
fsl-newimage >=2011.0
examples/cpp/fsl-example_cpp_project/post-link.sh
0 → 100644
View file @
31352187
if
[
-e
${
FSLDIR
}
/share/fsl/sbin/createFSLWrapper
]
;
then
${
FSLDIR
}
/share/fsl/sbin/createFSLWrapper example_cpp_exe
fi
examples/cpp/fsl-example_cpp_project/pre-unlink.sh
0 → 100644
View file @
31352187
if
[
-e
${
FSLDIR
}
/share/fsl/sbin/removeFSLWrapper
]
;
then
${
FSLDIR
}
/share/fsl/sbin/removeFSLWrapper example_cpp_exe
fi
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment