Visual Studio/MS Windows build system generation

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
thomb
Posts: 93
Joined: Mon, 2024-05-20, 08:10

Visual Studio/MS Windows build system generation

#1 Post by thomb »

Hi All,

I have run the config and generation steps with CMake. However, the solution and project files generated hard code the directory path on my machine. The generated build system for Visual Studio 2022 will be stored in a GitHub repository and should be useable by anyone who clones the repository and loads the DCMTK.sln file in Visual Studio.

Is there a way during the config and generation phases to introduce the use of a variable that is like the $(SolutionDir) so that it will match the director path for the clone repo?

Thanks.

Michael Onken
DCMTK Developer
Posts: 2073
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Visual Studio/MS Windows build system generation

#2 Post by Michael Onken »

Hi,

I have no experience to make Visual Studio solution files relocatable, and maybe it is not even possible. That being said, the Visual Studio files are rarely commited to a source code repository (at leas when working with a team). Instead, every developer usually runs CMake on his own machine and generates his only VS solution files.

If you are afraid that developers will not select the "right options" the project should use for the build, you can provide them with a batch file that runs cmake.exe for them and provide the CMake options via command line (e.g. -DDCMTK_WITH_OPENSSL="ON" -DCMAKE_INSTALL_PREFIX=...). They can still open the CMake GUI afterwards to edit path options and the like if they want to change some parametres and prefer the GUI view. cmake can even be used to trigger the build of the project on the command line without opening Visual Studio at all. Maybe it's worth to read about cmake in general.

BR Michael

thomb
Posts: 93
Joined: Mon, 2024-05-20, 08:10

Re: Visual Studio/MS Windows build system generation

#3 Post by thomb »

Hi Michael,
Thanks for the usual practice with CMake. I'm not sure my team wants to run CMake each time they need to build, but I will discuss it with them.
I know how to make the Visual Studio files relocatable after the build system is generated, but I thought it might be better to do that with CMake if it was possible.

Our current build process of 3.5.4 is manual. We don't have a build pipeline and would like to have one for 3.6.8.
Can we use CMake during an automated build process?

Thanks again,
Thom

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1511
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: Visual Studio/MS Windows build system generation

#4 Post by Marco Eichelberg »

Can we use CMake during an automated build process?
Yes, definitely. We do this in our automated nightly builds. If you run cmake.exe with the required command line options (selecting compiler, build options, source directory etc.), the tool will display no GUI. It will just generate the Visual Studio solution files and then terminate.

thomb
Posts: 93
Joined: Mon, 2024-05-20, 08:10

Re: Visual Studio/MS Windows build system generation

#5 Post by thomb »

Thank you. Helpful to know.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest