From 510a1b5016c0a3fdaf7dc8b8b292f09fc7442172 Mon Sep 17 00:00:00 2001 From: Hoang Tung Dinh Date: Mon, 26 Aug 2024 10:04:42 +0200 Subject: [PATCH] Update build instructions (#140) Signed-off-by: hoangtungdinh <11166240+hoangtungdinh@users.noreply.github.com> --- INSTALL.md | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 07736c75..c5855cf3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -26,6 +26,15 @@ The ASAM Quality Checker Framework runs on Linux and Windows. The framework cons Links to download the sources and the tested versions can be found in the [license information appendix](licenses/readme.md). +## Build and install C++ modules + +- Use CMakeLists.txt within the main directory as source directory +- Do not forget to set `CMAKE_INSTALL_PREFIX` +- Do not forget to set `CMAKE_BUILD_TYPE` if using CMake generator `Unix + Makefiles` + +### Build on Linux + On Linux, toolchain and 3rd party dependencies can be installed as follows (example for Ubuntu 22.04). ```bash @@ -44,14 +53,7 @@ apt update && apt install -y \ git ``` -## Build and install C++ modules - -- Use CMakeLists.txt within the main directory as source directory -- Do not forget to set `CMAKE_INSTALL_PREFIX` -- Do not forget to set `CMAKE_BUILD_TYPE` if using CMake generator `Unix - Makefiles` - -For Linux, an example CMake call to build the framework +An example CMake call to build the framework looks like this (call from the repository root): ```bash @@ -64,6 +66,22 @@ cmake --build ./build --target install --config Release -j4 cmake --install ./build ``` +### Build on Windows + +On Windows, an example build for the the dependency XercesC looks like this: + +```bash +$xercesZip = "$env:WORKING_PATH\xerces-c-3.2.5.zip" +Invoke-WebRequest -Uri "https://dlcdn.apache.org/xerces/c/3/sources/xerces-c-3.2.5.zip" -OutFile $xercesZip +Expand-Archive -Path $xercesZip -DestinationPath "$env:WORKING_PATH" +cd "$env:WORKING_PATH\xerces-c-3.2.5" +mkdir build +cd build +cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$env:WORKING_PATH\Xerces-Out" .. +cmake --build . --config Debug +cmake --build . --config Debug --target install +``` + For Windows Visual Studio 16 2019 an example CMake call to build the framework looks like this (call from the repository root): @@ -73,9 +91,8 @@ $ cmake -G "Visual Studio 16 2019" -A "x64" -T "v142" -B../build -S. ^ -DCMAKE_INSTALL_PREFIX="" ^ -DENABLE_FUNCTIONAL_TESTS=ON ^ -DGTest_ROOT="" ^ - -DASAM_OPENDRIVE_XSD_DIR="" ^ - -DASAM_OPENSCENARIO_XSD_DIR="" ^ - -DQt5_ROOT="" + -DQt5_ROOT="" ^ + -DXercesC_ROOT="" $ cmake --build ../build --target ALL_BUILD --config Release $ ctest --test-dir ../build -C Release $ cmake --install ../build @@ -85,12 +102,6 @@ With the following CMake values: - _\_: The prefix CMake installs the package to - _\_: The root dir of the pre-built GoogleTest package -- _\_: The directory containing the schema (*.xsd) - files for OpenDRIVE downloaded from the ASAM website (multiple versions of - the schema files in this directory are supported). -- _\_: The directory containing the schema (*.xsd) - files for OpenSCENARIO downloaded from the ASAM website (multiple versions of - the schema files in this directory are supported). - _\_: The root dir of the pre-built Xerces-C++ package - _\_: The root dir of the pre-built qt5 package