Skip to content

Commit

Permalink
Update for new vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
seanwarren committed Nov 24, 2020
1 parent d8db5b5 commit c893fff
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Expand Up @@ -7,4 +7,4 @@
url = https://github.com/flimfit/matlab-ui-common.git
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/seanwarren/vcpkg
url = https://github.com/microsoft/vcpkg
29 changes: 17 additions & 12 deletions BuildFLIMfit.bat
Expand Up @@ -2,20 +2,23 @@

SETLOCAL

IF NOT DEFINED MATLAB_VER SET MATLAB_VER=R2016b
IF NOT DEFINED MSVC_VER SET MSVC_VER=15
SET ROOT=%~dp0

IF NOT DEFINED MATLAB_VER SET MATLAB_VER=R2019b
IF NOT DEFINED MSVC_VER SET MSVC_VER=16

if %MSVC_VER%==14 SET MSVC_YEAR=2015
if %MSVC_VER%==15 SET MSVC_YEAR=2017
if %MSVC_VER%==16 SET MSVC_YEAR=2019

IF NOT DEFINED TRIPLET SET TRIPLET=x64-windows-static

echo Setting up vcpkg paths
SET TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake
SET TOOLCHAIN_FILE=%TOOLCHAIN_FILE:\=/%

if %MSVC_VER%==15 (set GENERATOR="Visual Studio %MSVC_VER% Win64"
) else set GENERATOR="Visual Studio %MSVC_VER% %MSVC_YEAR% Win64"
) else set GENERATOR="Visual Studio %MSVC_VER% %MSVC_YEAR%"



SET FEED_URL=https://pkgs.dev.azure.com/FLIMfit/FLIMfit/_packaging/vcpkg/nuget/v3/index.json
if NOT DEFINED VCPKG_BINARY_SOURCES SET VCPKG_BINARY_SOURCES=nuget,%FEED_URL%,read

:: Build main library
echo Cleaning CMake Project
Expand All @@ -24,7 +27,7 @@ SET PROJECT_DIR=GeneratedProjects\MSVC%MSVC_VER%_64
if "%1"=="--clean" rmdir %PROJECT_DIR% /s /q
mkdir %PROJECT_DIR%
echo Generating CMake Project in: %PROJECT_DIR%, using %GENERATOR%
cmake -G %GENERATOR% -H. -B%PROJECT_DIR% -DCMAKE_TOOLCHAIN_FILE="%TOOLCHAIN_FILE%" -DVCPKG_TARGET_TRIPLET=%TRIPLET%
cmake -G %GENERATOR% -H. -B%PROJECT_DIR% -DVCPKG_TARGET_TRIPLET=%TRIPLET%
if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL%
echo Building 64bit Project in Release mode
cmake --build %PROJECT_DIR% --config Release
Expand All @@ -36,8 +39,9 @@ SET PROJECT_DIR=GeneratedProjects\MSVC%MSVC_VER%_64_FLIMreader
if "%1"=="--clean" rmdir %PROJECT_DIR% /s /q
mkdir %PROJECT_DIR%
echo Generating CMake Project in: %PROJECT_DIR%, using %GENERATOR%
cmake -G %GENERATOR% -HFLIMfitLibrary\FLIMreader -B%PROJECT_DIR% -DCMAKE_TOOLCHAIN_FILE="%TOOLCHAIN_FILE%" -DNO_CUDA=1^
-DVCPKG_TARGET_TRIPLET=%TRIPLET% -DMSVC_CRT_LINKAGE=static -DFlimReaderMEX_OUT_DIR="%CD%\FLIMfitFrontEnd\Libraries"
cmake -G %GENERATOR% -HFLIMfitLibrary\FLIMreader -B%PROJECT_DIR% -DNO_CUDA=1^
-DVCPKG_TARGET_TRIPLET=%TRIPLET% -DMSVC_CRT_LINKAGE=static -DFlimReaderMEX_OUT_DIR="%CD%\FLIMfitFrontEnd\Libraries"^
-DCMAKE_TOOLCHAIN_FILE=%ROOT%vcpkg/scripts/buildsystems/vcpkg.cmake
if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL%
echo Building 64bit Project in Release mode
cmake --build %PROJECT_DIR% --config Release
Expand All @@ -47,4 +51,5 @@ if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL%
echo Compiling front end
echo Please wait for MATLAB to load

"C:\Program Files\MATLAB\%MATLAB_VER%\bin\matlab.exe" -nosplash -nodesktop -wait -log compile_output.txt -r "cd('%CD%\FLIMfitFrontEnd'); compile(true); quit();"
"C:\Program Files\MATLAB\%MATLAB_VER%\bin\matlab.exe" -nosplash -nodesktop -wait^
-log compile_output.txt -r "cd('%CD%\FLIMfitFrontEnd'); compile(true); quit();"
2 changes: 2 additions & 0 deletions CMakeLists.txt
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.12)

set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file")

set(TARGET_SDKROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk")

Expand Down
12 changes: 6 additions & 6 deletions Configure.bat
Expand Up @@ -5,13 +5,13 @@ IF DEFINED INSTALL_REQUIRED (
:: The following packages must be installed as admin
choco install curl -y
choco install cmake.portable -y
choco install innosetup -y
choco install ghostscript.app -y -version 9.16
choco install innosetup -y
choco install ghostscript.app -y -version 9.16

:: Install Inno Downloader
curl -LO https://bitbucket.org/mitrich_k/inno-download-plugin/downloads/idpsetup-1.5.1.exe
idpsetup-1.5.1.exe /silent
del idpsetup-1.5.1.exe
:: Install Inno Downloader
curl -LO https://bitbucket.org/mitrich_k/inno-download-plugin/downloads/idpsetup-1.5.1.exe
idpsetup-1.5.1.exe /silent
del idpsetup-1.5.1.exe
)

:: vcpkg install opencv[core,tiff]:x64-windows-static boost-filesystem:x64-windows-static boost-iostreams:x64-windows-static boost-serialization:x64-windows-static dlib:x64-windows-static
2 changes: 1 addition & 1 deletion FLIMfitLibrary/FLIMreader
3 changes: 2 additions & 1 deletion FLIMfitLibrary/Source/AbstractFitter.cpp
Expand Up @@ -31,7 +31,7 @@
#include "boost/math/distributions/fisher_f.hpp"
#include "boost/math/tools/minima.hpp"
#include <boost/math/tools/roots.hpp>
#include "boost/bind.hpp"
#include "boost/bind/bind.hpp"
#include <limits>
#include <exception>

Expand Down Expand Up @@ -194,6 +194,7 @@ int AbstractFitter::CalculateErrors(double* alf, double conf_limit, double* err_
using namespace boost::math;
using namespace boost::math::tools;
using namespace boost::math::policies;
using namespace boost::placeholders;
using boost::math::policies::domain_error;
using boost::math::policies::ignore_error;

Expand Down
2 changes: 1 addition & 1 deletion FLIMfitLibrary/Source/FLIMData.h
Expand Up @@ -33,7 +33,7 @@
#include <boost/interprocess/file_mapping.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <stdint.h>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/function.hpp>
#include "tinythread.h"
#include "FitStatus.h"
Expand Down
2 changes: 1 addition & 1 deletion FLIMfitLibrary/Source/VariableProjector.cpp
Expand Up @@ -20,7 +20,7 @@
#include <algorithm>
#include "util.h"

#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/function.hpp>

#include "omp_stub.h"
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Expand Up @@ -11,6 +11,7 @@ pr:

variables:
MATLAB_VER: R2020b
VCPKG_BINARY_SOURCES: clear;nuget,https://pkgs.dev.azure.com/FLIMfit/FLIMfit/_packaging/vcpkg/nuget/v3/index.json,readwrite

jobs:

Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 5466 files
17 changes: 17 additions & 0 deletions vcpkg.json
@@ -0,0 +1,17 @@
{
"name": "flimfit",
"version-string": "5.1.1",
"homepage": "https://flimfit.org/",
"dependencies": [
"boost-accumulators",
"boost-align",
"boost-bind",
"boost-filesystem",
"boost-function",
"boost-interprocess",
"boost-iostreams",
"boost-math",
"boost-random",
"boost-serialization"
]
}

0 comments on commit c893fff

Please sign in to comment.