Dear CMake-Hackers, I have a project which is purely C++. We have recently switched from
project (FOO) to project (FOO CXX) so that we don't depend on CMAKE_C_COMPILER being set. This has broken our BZip2 detection: -- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.6") -- Looking for BZ2_bzCompressInit in /usr/lib/x86_64-linux-gnu/libbz2.so CMake Error at /usr/share/cmake-3.0/Modules/CheckLibraryExists.cmake:52 (try_compile): Unknown extension ".c" for file /usr/share/cmake-3.0/Modules/CheckFunctionExists.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-3.0/Modules/FindBZip2.cmake:60 (CHECK_LIBRARY_EXISTS) Note that this is fixed in cmake-3.4 by https://github.com/Kitware/CMake/commit/23876eda9f1d4b5725407aef7d218fc3ce4113cb because the CheckLibraryExists is removed. However I depend on shipping the software on platforms with cmake>=3.0 so this doesn't help. I have tried to set SET_SOURCE_FILES_PROPERTIES(CheckFunctionExists.c PROPERTIES LANGUAGE CXX) but this doesn't help, either. Is there any workaround for this problem? And isn't requiring C_COMPILER in CheckLibraryExists a bug? IMHO it should check CMAKE_C_COMPILER_LOADED and use cxx otherwise... Thank you for your help! -- Best regards, Hannes Hauswedell Free Software Foundation Europe -- German Team pgp-key: https://blogs.fsfe.org/h2/files/2015/09/hannes_hauswedell_public_key.asc fingerprint: FC35 7547 7916 DA55 DC42 27EA 1D57 8E18 A109 60BF
signature.asc
Description: OpenPGP digital signature
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake