Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
530cc397
Commit
530cc397
authored
6 months ago
by
Joscha Schmiedt
Browse files
Options
Downloads
Patches
Plain Diff
Update build instructions on Windows to use make.ps1
parent
567c8eef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!61
Release 0.3.0
,
!54
Resolve "Windows: Linker errors with protobuf-generated code"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/Install_develop.rst
+13
-16
13 additions, 16 deletions
doc/Install_develop.rst
make.ps1
+46
-31
46 additions, 31 deletions
make.ps1
with
59 additions
and
47 deletions
doc/Install_develop.rst
+
13
−
16
View file @
530cc397
...
...
@@ -108,22 +108,19 @@ How to build on Windows
We use `Visual Studio
2022 <https://visualstudio.microsoft.com/de/vs/features/cplusplus/>`__
as compiler. We use `cmake <https://cmake.org/download/>`__ as build
tool.
1. Install Python and create a virtual environment with the dependencies in `requirements.txt`.
2. Activate the environment run in the repository folder: ``conan install . --build=missing -s build_type=Release``
3. ``cmake --preset conan-default``
4. Open ``build/liblinkahead.sln`` with Visual Studio, change the
buildtype to ``Release`` and build the project (ALL_BUILD). (You
can open Tools/Command Line/Developer Command Prompt and execute
``msbuild liblinkahead.sln /property:Configuration=Release``)
5. Try running the cli clients in ``.\build\Release\``.
Known problems
^^^^^^^^^^^^^^
- Building the unit tests on Windows currently fails with linker errors. See
`#90 <https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib/-/issues/90>`__
tool, which can be installed together with Visual Studio.
1. Install Python and create a virtual environment with the dependencies in
`requirements.txt`.
2. In a PowerShell, activate the environment and run the following commands from the
repository root:
3. ``conan profile detect --force`` (and check the output)
3. ``make.ps1 conan-install``
4. ``make.ps1 build``
You'll find the shared libraries and cli clients in ``.\build\Release\``. To run the tests,
use ``make.ps1 test``. As a shortcut to run all steps, use ``make.ps1 all``.
Troubleshooting
~~~~~~~~~~~~~~~
...
...
This diff is collapsed.
Click to expand it.
make.ps1
+
46
−
31
View file @
530cc397
...
...
@@ -2,6 +2,43 @@ param (
[
string
]
$target
)
function
Install-Conan
{
Write-Output
"Installing Release dependencies with Conan..."
# check if conan is available
if
(
-not
(
Get-Command
conan
-ErrorAction
SilentlyContinue
))
{
Write-Output
"Conan is not available. Please install Conan or activate the Conan environment venv"
exit
1
}
conan
install
.
--build
=
missing
-s
build_type
=
Release
-s
compiler.cppstd
=
17
cmake
--preset
conan-default
}
function
Build-Project
{
Write-Output
"Building the project..."
# check if msbuild is available
if
(
-not
(
Get-Command
msbuild
-ErrorAction
SilentlyContinue
))
{
Write-Output
"msbuild is not available. Please install Visual Studio or open the Developer PowerShell."
exit
1
}
# check if conan install was run
if
(
-not
(
Test-Path
.
\build\liblinkahead.sln
))
{
Write-Output
"Please run conan-install first."
exit
1
}
msbuild
.
\build\liblinkahead.sln
/property:Configuration
=
Release
}
function
Invoke-Tests
{
Write-Output
"Running tests..."
# check if build was run before
if
(
-not
(
Test-Path
.
\build\Release\linkahead.dll
))
{
Write-Output
"Please build the project first."
exit
1
}
Set-Location
.
\build\
ctest
}
# check if vswhere is available
if
(
-not
(
Test-Path
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
))
{
Write-Output
"vswhere is not available. Please install Visual Studio"
...
...
@@ -20,46 +57,24 @@ Set-Location $currentPath
switch
(
$target
)
{
"build"
{
Write-Output
"Building the project..."
# check if msbuild is available
if
(
-not
(
Get-Command
msbuild
-ErrorAction
SilentlyContinue
))
{
Write-Output
"msbuild is not available. Please install Visual Studio or open the Developer PowerShell:."
exit
1
}
# check if conan install was run
if
(
-not
(
Test-Path
.
\build\liblinkahead.sln
))
{
Write-Output
"Please run conan-install first."
exit
1
}
msbuild
.
\build\liblinkahead.sln
/property:Configuration
=
Release
Build-Project
}
"test"
{
Write-Output
"Running tests..."
# check if build was run before
if
(
-not
(
Test-Path
.
\build\Release\linkahead.dll
))
{
Write-Output
"Please build the project first."
exit
1
}
Set-Location
.
\build\
ctest
Invoke-Tests
}
"conan-install"
{
Write-Output
"Installing Release dependencies with Conan..."
# check if conan is available
if
(
-not
(
Get-Command
conan
-ErrorAction
SilentlyContinue
))
{
Write-Output
"Conan is not available. Please install Conan or activate the Conan environment venv"
exit
1
}
conan
install
.
--build
=
missing
-s
build_type
=
Release
-s
compiler.cppstd
=
17
cmake
--preset
conan-default
Install-Conan
}
"clean"
{
Write-Output
"Cleaning the project..."
Remove-Item
-Recurse
-Force
.
\build\
*
}
"all"
{
Install-Conan
Build-Project
Invoke-Tests
}
default
{
Write-Output
"Usage: .\
script
.ps1 [conan-install|build|test|clean]"
Write-Output
"Usage: .\
make
.ps1 [
all|
conan-install|build|test|clean]"
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment