CheckCXXSourceRuns bug?

(Bill Lorensen) #1

Folks,

I’m trying to use VTK/CMake/CheckCXXSourceRuns.cmake.
My CXX file runs and checks to see if a certain capability works correctly.

  1. The VTK version of the cmake macro reports success if the program compiles, not if it runs successfully. This seems to be a bug.

  2. The CMake version CMake/Modules/CheckCXXSourceRuns.cmake does the proper checking. Why does the VTK version have the same name as the CMake version?

(Ben Boeckel) #2

VTK’s copy should probably just go away. It hasn’t been meaningfully edited in over 5 years. If this is for <regex> detection, is a simple try_compile not sufficient? Why would we need to run the resulting code since it’s a linker error?

(Bill Lorensen) #3

Some compilers will link but always return true on matches.

(Bill Lorensen) #4

Ben,

The use of kwsys regular expression vs. std::regex was discussed in this issue was a year ago.

And this part of the discussion talks about the skeleton code in some compilers that compiles but does not run correctly.

Bill

(Ben Boeckel) #5

Well, that is…dumb. Also, probably explicitly against the standard.