[CXX-892] Segregate Release vs. Debug build outputs Created: 11/Apr/16  Updated: 26/Apr/16  Resolved: 26/Apr/16

Status: Closed
Project: C++ Driver
Component/s: Build
Affects Version/s: 3.0.1
Fix Version/s: None

Type: Improvement Priority: Trivial - P5
Reporter: Steve Hickman Assignee: Andrew Morrow (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win 7, VS2015, CMake 3.5



 Description   

It appears that builds do not segregate outputs based on configuration (Release, Debug, ...). It would be nice if outputs were automatically segregated by configuration (either by directory name or some file naming scheme that distinguishes configurations) so that users (like me) don't accidentally overwrite build results when switching to a different configuration.

I understand that the way cmake works the onus is on the developer to target different install directories based on compiler version (VS2012, VS2013, VS2015, ...) and platform (Win32, Win64, ...) when configuring CMake.



 Comments   
Comment by Andrew Morrow (Inactive) [ 26/Apr/16 ]

OK, thanks. I'm going to close this out i favor of the other tickets. Please feel free to watch them for updates. The 3.1.0 release should be coming out sometime this summer with many small build improvements.

Comment by Steve Hickman [ 25/Apr/16 ]

That's actually better. Thx

Comment by Andrew Morrow (Inactive) [ 25/Apr/16 ]

Thanks for clarifying. I actually want to take this a different direction, where we adorn the libraries with ABI tags, like boost does. I also want to add autolink (autolib?) support, so that the headers #pragma in an appropriately adorned name. Please see CXX-521 (and, to a lesser extent, CXX-816). Under this scheme, the library names will vary with the build type automatically, and you will be able to install them all to the same installation prefix without conflict.

Those tickets are currently slated for the 3.1.0 release.

Comment by Steve Hickman [ 25/Apr/16 ]

The installation directory.

Reasoning: The intermediate files (the build directory) can be overwritten because it will only be used to build the libraries. The installation directory/ies will be used when linking to the libraries. Users will sometimes want to link to different builds of the library (release vs. debug, 32 vs. 64 bit).

Comment by Andrew Morrow (Inactive) [ 24/Apr/16 ]

Hi sxhickman -

Would you please clarify something for me: Is it the installation directory that you want to automatically disambiguate? Or the CMake build time directory (like where CMakeCache.txt is emitted)?

Thanks

Comment by Steve Hickman [ 18/Apr/16 ]

Not that was generated by CMake. However, I do this all the time in VS. My Output directory is typically defined as:
...<some root>....\$(PlatformToolset)\$(Platform)\$(Configuration)\
Note that
$(PlatformToolset) is defined in VS as the compiler version (e.g., v110 for VS2012, v140 for VS2015)
$(Platform) is defined in VS as either 'Win32' or 'x64'
$(Configuration) is defined in VS as either 'Debug' or 'Release'

All you need to do is to use these macros in the string used to construct the output directory and VS will translate them when building.

Comment by Andrew Morrow (Inactive) [ 17/Apr/16 ]

I'm not entirely sure that this is possible. CMake generally treats the cwd as the output directory. Do you have a link to another project that exhibits the behavior that you want? Or let me know if I'm misunderstanding what you are after here.

Generated at Wed Feb 07 22:00:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.