plibsys icon indicating copy to clipboard operation
plibsys copied to clipboard

Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR

Open Qix- opened this issue 6 years ago • 3 comments
trafficstars

Otherwise, you pollute the project's build directory with a bunch of random stuff, which isn't very fun. 🙃

Qix- avatar Feb 14 '19 23:02 Qix-

Codecov Report

Merging #76 into master will decrease coverage by <1%. The diff coverage is n/a.

@@          Coverage Diff          @@
##           master    #76   +/-   ##
=====================================
- Coverage      88%    88%   -1%     
=====================================
  Files          41     41           
  Lines        3853   3854    +1     
=====================================
- Hits         3426   3422    -4     
- Misses        427    432    +5

codecov-io avatar Feb 15 '19 00:02 codecov-io

@Qix- , Thank you for the patch. Apparently, CMAKE_BINARY_DIR is also used for the tests, therefore it shall be adjusted there as well.

For me, the use of CMAKE_BINARY_DIR for output brings some advantages like a ready-to-deploy build folder, or that you can run compiled project directly from the build directory. I also understand that such a behaviour may be not beneficial for other projects. Therefore, I still want to keep a possibility to output compiled library into the top build directory.

I'm thinking about adding an option to control the output binary dir - either into the current binary directory, or into the top one. Any other suggestions how it could be done in a proper CMake-way?

saprykin avatar Feb 23 '19 10:02 saprykin

@saprykin using CMAKE_BINARY_DIR is wrong pretty much in every scenario. I'd argue it should be deprecated from CMake entirely as it breaks hierarchical builds. Please do not use it.

Qix- avatar Feb 24 '19 02:02 Qix-

Okay, implemented in ac23d0a3c22eb3425a414366e401a8a2e5b3bda3.

saprykin avatar Jul 02 '23 16:07 saprykin