MantisBT - CMake
View Issue Details
0011731CMakeCMakepublic2011-01-20 04:402011-01-31 16:08
Johannes Brunen 
Brad King 
lowmajorN/A
closedfixed 
win32windows 7
CMake 2.8.3 
CMake 2.8.4CMake 2.8.4 
0011731: Issue with CheckTypeSize test
Hello,

after switching from CMake version 2.8.0 to 2.8.3 I ran into the following issue. I have a script named 'FindComLibs1.0.cmake' which does contain the following statement:

include(CheckTypeSize)
check_type_size("void*" _comlibs1.0_void_ptr_size BUILTIN_TYPES_ONLY)

running a CMake project containing a find_package call to this script does produce the following error:

-- Check size of void*
CMake Error: Unknown extension ".0_void_ptr_size.c" for file "E:/prod_xxx_/Build32/caddy/CMakeFiles/CheckTypeSize/_comlibs1.0_void_ptr_size.c".
TRY_COMPILE only works for enabled languages.
Currently enabled languages are: C CXX RC
See PROJECT command for help enabling other languages.
-- Check size of void* - failed

I think that the determination of the file extension is wrongly implemented.
No tags attached.
Issue History
2011-01-20 04:40Johannes BrunenNew Issue
2011-01-20 08:29Brad KingAssigned To => Brad King
2011-01-20 08:29Brad KingStatusnew => assigned
2011-01-20 08:32Brad KingNote Added: 0024952
2011-01-20 09:11Brad KingNote Added: 0024954
2011-01-20 09:11Brad KingStatusassigned => closed
2011-01-20 09:11Brad KingResolutionopen => fixed
2011-01-20 09:11Brad KingTarget Version => CMake 2.8.4
2011-01-31 16:08David ColeFixed in Version => CMake 2.8.4

Notes
(0024952)
Brad King   
2011-01-20 08:32   
This issue was introduced by a near-complete rewrite of that module:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9b726c3 [^]
(0024954)
Brad King   
2011-01-20 09:11   
This is actually a bug in try_compile that happened to be exposed by the changes to CheckTypeSize and your project's call to it. Fixed:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=699a7255 [^]

While at it I also improved the error messages of try_compile to give context information and have better formatting:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1bee6b17 [^]