Open GoogleCodeExporter opened 9 years ago
[deleted comment]
The attached patch fix the problem for me but I believe it is not what you want
otherwise FindThreadsCXX.cmake wouldn't exist.
IMHO, avoiding C and using CXX only is not such a good idea, I tried it once
and it bit me with the CMake modules. Same problem here apparently.
Original comment by guillaum...@parrot.com
on 27 Nov 2014 at 11:18
Attachments:
Thanks for the report. As you use a recent CMake version, can you try what
happens when you comment the set(CMAKE_MODULE_PATH ...) in the CMakeLists.txt
file of gflags ? I copied the CMake files just from the development branch of
CMake and made minor fixes that were not in their yet. It may well be that
these issues were fixed in the meantime. If it doesn't help, going back to
C/CXX languages is a viable option to avoid these problems until the CMake
modules work fine with CXX only.
Original comment by andreas....@gmail.com
on 27 Nov 2014 at 11:42
In my version of CMake the C language is still required by the CMake modules.
...
-- Looking for stddef.h
CMake Error at
/home/gpapin/pkg/cmake-3.0.2-Linux-i386/share/cmake-3.0/Modules/CheckIncludeFile
.cmake:58 (try_compile):
Unknown extension ".c" for file
/home/gpapin/pkg/gflags-2.1.1/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
try_compile() works only for enabled languages. Currently these are:
CXX
See project() command to enable other languages.
Call Stack (most recent call first):
/home/gpapin/pkg/cmake-3.0.2-Linux-i386/share/cmake-3.0/Modules/CheckTypeSize.cmake:223 (check_include_file)
CMakeLists.txt:116 (check_type_size)
...
Did you know if an issue was reported to the CMake guys?
Original comment by guillaum...@parrot.com
on 27 Nov 2014 at 12:54
To bad, I reported the bug and it has been fixed, though, see
https://www.cmake.org/Bug/view.php?id=14056&history=1.
Original comment by andreas....@gmail.com
on 27 Nov 2014 at 1:10
I.e. CMake 3.1 should be fine. Any chance you can quickly download and install
the release candidate for this version and try again? Would be interesting to
see if we then could not make use of the CMake modules included in the gflags
project and get rid of them eventually (once CMake 3.1 is the minimum default
on most systems).
Original comment by andreas....@gmail.com
on 27 Nov 2014 at 1:13
Okay, it looks like CheckTypeSize was fixed to support CXX only:
http://www.cmake.org/Bug/view.php?id=14056
But in practice, it still doesn't work with my CMake version (3.0.2) which
includes this change. Also IIUC, gflags fixed other modules than CheckTypeSize.
Original comment by guillaum...@parrot.com
on 27 Nov 2014 at 1:17
I saw your messages after I submitted one, looks like that was your bug that I
found.
Anyway, I downloaded cmake 3.1 rc2 and the example from the bug report works
now.
On the other hand compiling gflags still fails due to pthread which hasn't been
fixed.
-- Looking for include file pthread.h
CMake Error at
/home/gpapin/pkg/cmake-3.1.0-rc2-Linux-i386/share/cmake-3.1/Modules/CheckInclude
Files.cmake:74 (try_compile):
Unknown extension ".c" for file
/home/gpapin/pkg/gflags-2.1.1/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
try_compile() works only for enabled languages. Currently these are:
CXX
See project() command to enable other languages.
Call Stack (most recent call first):
/home/gpapin/pkg/cmake-3.1.0-rc2-Linux-i386/share/cmake-3.1/Modules/FindThreads.cmake:123 (CHECK_INCLUDE_FILES)
CMakeLists.txt:157 (find_package)
Original comment by guillaum...@parrot.com
on 27 Nov 2014 at 1:25
I see, thanks for giving it a try. Maybe the safest option is then to just
apply your patch and revert to C+CXX. Just wanted to avoid all the C compiler
checks to speed up configuration.
Original comment by andreas....@gmail.com
on 27 Nov 2014 at 4:05
Yeah I understand the concern as I tried this myself once.
I think it's best to just enable C for now and maybe one day, when CMake
supports CXX-only project more easily you will be able to call
enable_language(C) only for CMake versions prior to this one.
Best,
Guillaume
Original comment by guillaum...@parrot.com
on 27 Nov 2014 at 4:26
Original issue reported on code.google.com by
guillaum...@parrot.com
on 27 Nov 2014 at 10:58