[CMake] How to make Visual Studio .vcproj with relative paths

Ben Ratzlaff cmake at daishiva.com
Tue Mar 25 15:13:09 EDT 2008


I cant help but comment that this is unnecessarily complicated when
all that is desired is simply compiling without the Cmake dependency.
Conceptually it should not be this hard.

Recently I was tasked to help develop a small static library (4 source
files), the primay developer works in Linux and the library will be
primarily used in Linux. Thankfully we use CMake and the visual studio
project file was created without any hassle at all (woot!)

I still needed to make a visual studio tweak: "compile .c files as
c++". I would make the change in the IDE, but every so often CMake
would regenerate the project and force me to do it again. Its
irritating, but the time fixing CMakeLists.txt adds nothing when win32
is not the target platform this library runs on.

So yes, an option to generate a project without CMake dependency would
be value-added for me.

On Tue, Mar 25, 2008 at 11:31 AM, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2008/3/25, Olaf van der Spek <olafvdspek at gmail.com>:
>
> > On Tue, Mar 25, 2008 at 12:58 AM, Alexander Neundorf
>  >  <a.neundorf-work at gmx.net> wrote:
>  >  >  Not really.
>  >  >  Why do you actually want to ship VS project files ?
>  >
>  > To avoid a dependency on cmake. The library user probably doesn't have
>  >  cmake installed and it would be nice if he could directly open the
>  >  .sln file and build the library.
>  >
>  >  >  The preferred approach would be to ship the cmake files and if required also
>  >  >  include cmake itself.
>  >
>  >
>  > Include the cmake installer in every library zip file? That doesn't
>  >  sound like a good idea.
>  >  Even if you do, building the library still requires additional steps
>  >  to generate the .sln and .vcproj files.
>
>  If you are afraid to ask your user to run CMake you may
>  want to write a [possibly NSIS] installer which contains:
>
>  1) Your sources
>  2) CMake installer
>  3) Any other dependency
>
>  then with some [possibly NSIS] scripting you may
>  automagically
>
>    1) unzip/extract your source tree
>    2) install CMake
>    3) run cmake (command line) with appropriate arguments
>        (may be NSIS installer should ask for the Visual Studio version)
>    4) then tell the user that he can safely open the sln/vcproj generated files?
>
>  This is some work but seems doable, or am I totally wrong ?
>
>  Moreover if you have such NSIS installer some of us may well be
>  interested in getting it for re-use, since the pattern usage looks
>  generic to me :=)
>
>
>  --
>  Erk
>
>
> _______________________________________________
>  CMake mailing list
>  CMake at cmake.org
>  http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list