Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default value for CMAKE_INSTALL_PREFIX #208

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipe/activate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off

if "%CONDA_BUILD%" EQU "1" (
set CMAKE_INSTALL_PREFIX=%PREFIX%\Library
) else (
set CMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library
)
16 changes: 16 additions & 0 deletions recipe/activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
if [[ $CONDA_BUILD -eq 1 ]];
then
if [[ ! -z $COMSPEC ]];
then
export CMAKE_INSTALL_PREFIX=$PREFIX/Library
else
export CMAKE_INSTALL_PREFIX=$PREFIX
fi;
else
if [[ ! -z $COMSPEC ]];
then
export CMAKE_INSTALL_PREFIX=$CONDA_PREFIX/Library
else
export CMAKE_INSTALL_PREFIX=$CONDA_PREFIX
fi;
fi;
12 changes: 12 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ if errorlevel 1 exit 1

ctest --test-dir . --output-on-failure -j%CPU_COUNT% -R "CTestTestParallel|DOWNLOAD"
if errorlevel 1 exit 1

setlocal EnableDelayedExpansion
:: Generate and copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
for %%F in (activate deactivate) DO (
if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
if %errorlevel% neq 0 exit /b %errorlevel%

copy %RECIPE_DIR%\%%F.sh %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.sh
if %errorlevel% neq 0 exit /b %errorlevel%
)
8 changes: 8 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ cmake --build . --target install -j${CPU_COUNT}
if [[ "${CONDA_BUILD_CROSS_COMPILATION}" != "1" ]]; then
ctest --output-on-failure -j${CPU_COUNT} -R "CTestTestParallel|DOWNLOAD"
fi

# Generate and copy the [de]activate scripts to $PREFIX/etc/conda/[de]activate.d.
# This will allow them to be run on environment activation.
for CHANGE in "activate" "deactivate"
do
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done
3 changes: 3 additions & 0 deletions recipe/deactivate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

set CMAKE_INSTALL_PREFIX=
1 change: 1 addition & 0 deletions recipe/deactivate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unset CMAKE_INSTALL_PREFIX
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source:
sha256: a0669630aae7baa4a8228048bf30b622f9e9fd8ee8cedb941754e9e38686c778

build:
number: 0
number: 1
ignore_run_exports:
- vc

Expand Down