akhaldi@svn.reactos.org wrote:
+++ branches/cmake-bringup/base/applications/calc/CMakeLists.txt [...]
+file(GLOB_RECURSE SOURCE *.c) +list(REMOVE_ITEM SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/fun_mpfr.c${CMAKE_CURRENT_SOURCE_DIR}/rpn_mpfr.c${CMAKE_CURRENT_SOURCE_DIR}/utl_mpfr.c)
Should GLOB_RECURSE and later removing unwanted source files really be the way to go?
The only advantage I see are smaller CMakeLists files. On the contrary, it is quite an uncommon way and just adding a single unrelated file into an application's directory could render it unbuildable. Additionally, please take a look at http://public.kitware.com/pipermail/cmake/2010-July/037833.html. According to this user, CMake cannot automatically detect added files when using GLOB_RECURSE.
In my opinion, we should list every source file to be included to prevent unexpected side effects.
Cheers,
Colin
In my opinion, we should list every source file to be included to prevent unexpected side effects.
Actually I think listing *every* source file is not really the best way, because most of the build modules include all of their respective source files, with the only exception being 3rd party modules.
Unbuildable and unnecessary .c files floating in the code base are those unexpected "side effects" which need to be cleared/fixed.
WBR, Aleksey Bragin.
Aleksey Bragin schrieb:
In my opinion, we should list every source file to be included to prevent unexpected side effects.
Actually I think listing *every* source file is not really the best way, because most of the build modules include all of their respective source files, with the only exception being 3rd party modules.
Unbuildable and unnecessary .c files floating in the code base are those unexpected "side effects" which need to be cleared/fixed.
I agree with Colin here. I often add files into the build directory, that I don't want to be build. All automatic stuff is IMO a hack and only for really lazy people.
Timo