Skip to content
Snippets Groups Projects
Commit 942290a3 authored by Carl Philipp Klemm's avatar Carl Philipp Klemm
Browse files

add windows packageing

parent 2e6d4cb6
Branches
No related tags found
No related merge requests found
......@@ -6,6 +6,13 @@ set (CMAKE_CXX_STANDARD 20)
option(PROFILE_ENABLED "instrument for gprof" OFF)
set(CMAKE_PROJECT_VERSION_MAJOR 2)
set(CMAKE_PROJECT_VERSION_MINOR 0)
set(CMAKE_PROJECT_VERSION_PATCH 0)
add_compile_definitions(VERSION_MAJOR=${CMAKE_PROJECT_VERSION_MAJOR})
add_compile_definitions(VERSION_MINOR=${CMAKE_PROJECT_VERSION_MINOR})
add_compile_definitions(VERSION_PATCH=${CMAKE_PROJECT_VERSION_PATCH})
find_package(Doxygen)
set(SRC_FILES
......@@ -69,6 +76,16 @@ if(WIN32)
)
set(COMMON_LINK_FLAGS "-flto -dl")
if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/package-win.sh ${CMAKE_CURRENT_BINARY_DIR}/package.sh @ONLY)
add_custom_target(package
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/package.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Createing release archive"
VERBATIM)
endif()
else()
message("Building on UNIX")
......
......@@ -452,6 +452,16 @@ std::pair<std::valarray<fvalue>, std::valarray<fvalue>> eisToValarrays(const std
/** @} */
struct VersionFixed
{
int major;
int minor;
int patch;
};
const VersionFixed& getVersion();
}
std::ostream &operator<<(std::ostream &s, eis::DataPoint const& dp);
......@@ -460,3 +470,4 @@ std::ostream &operator<<(std::ostream &s, eis::Range const& range);
std::ostream &operator<<(std::ostream &s, eis::EisSpectra const& spectra);
......@@ -394,6 +394,13 @@ EisSpectra EisSpectra::loadFromDisk(const std::filesystem::path& path)
}
}
static VersionFixed version = {VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH};
const VersionFixed& getVersion()
{
return version;
}
std::ostream &operator<<(std::ostream &s, EisSpectra const& spectra)
{
spectra.saveToStream(s);
......
......@@ -20,13 +20,13 @@
#pragma once
#include <string>
#include <vector>
#include <argp.h>
#include "model.h"
#include "log.h"
#include "strops.h"
const char *argp_program_version = "eisgenerator-1.0";
#define xstr(s) str(s)
#define str(s) #s
const char *argp_program_version = "eisgenerator-" xstr(VERSION_MAJOR) "." xstr(VERSION_MINOR) "." xstr(VERSION_PATCH);
const char *argp_program_bug_address = "<carl@uvos.xyz>";
static char doc[] = "Application that generates EIS spectra from model strings";
static char args_doc[] = "";
......
#!/bin/bash -e
PORJECT_NAME=@PROJECT_NAME@
ONNXNAME="@ONNX_NAME@"
VERSION="@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@.@CMAKE_PROJECT_VERSION_PATCH@"
BINARYDIR="@CMAKE_CURRENT_BINARY_DIR@"
SRCDIR="@CMAKE_CURRENT_SOURCE_DIR@"
RELDIRECTORY="$BINARYDIR/packaged/$VERSION/release"
rm $BINARYDIR/packaged/$PORJECT_NAME-$VERSION.zip || true
cd $BINARYDIR
install -d $RELDIRECTORY
cp libeisgenerator.dll $RELDIRECTORY
cp libeisgenerator.dll.a $RELDIRECTORY
cp libeisgenerator_static.a $RELDIRECTORY
cp eisgenerator_export.exe $RELDIRECTORY
cp eisgenerator_test.exe $RELDIRECTORY
cd $RELDIRECTORY/..
zip -r $BINARYDIR/packaged/$PORJECT_NAME-$VERSION.zip release
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment