This is similar to Force CMake for using the C ++ compiler for C files with Visual Studio , but it is not quite the same. This is not the same because its CMake file fails; and I work on almost every modern platform, from BSD and OS X to Solaris and Unix.
I tried to avoid unnecessary checks performed by CMake:
project(cryptopp, CXX)
This is what happens when I try to generate a makefile:
$ cmake . -- Check if the system is big endian -- Searching 16 bit integer -- Check size of unsigned short CMake Error at /usr/share/cmake-2.8/Modules/CheckTypeSize.cmake:82 (try_compile): Unknown extension ".c" for file /home/jeffrey/cryptopp/CMakeFiles/CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.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): /usr/share/cmake-2.8/Modules/CheckTypeSize.cmake:167 (__check_type_size_impl) /usr/share/cmake-2.8/Modules/TestBigEndian.cmake:27 (CHECK_TYPE_SIZE) CMakeLists.txt:49 (TEST_BIG_ENDIAN)
We do not have C files in our project, so we should be safe with project(cryptopp, CXX) (if I read cmake --help-command project correctly).
This question is about project files, but not CMake files.
How to tell CMake to use the C ++ compiler for all files, including its own CMake files?
I am on Ubuntu 12 LTS and it provides:
$ cmake --version cmake version 2.8.7
cmake
jww Jun 20 '16 at 20:14 2016-06-20 20:14
source share