Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake project( <name> NONE ) not supported #5456

Closed
3 tasks done
michaelmaguire opened this issue Jul 8, 2019 · 4 comments
Closed
3 tasks done

CMake project( <name> NONE ) not supported #5456

michaelmaguire opened this issue Jul 8, 2019 · 4 comments

Comments

@michaelmaguire
Copy link

We have some CMake script-only projects, one of which (cmake-bde-helpers) depends on another (cmake-module-test-helpers).

Right now in our CMakeLists.txt for cmake-bde-helpers we have:

project( cmake-bde-helpers NONE )

but when I tried to use Conan to build I got:

-- Conan: called by CMake conan helper
-- Conan: called inside local cache
CMake Error at conanbuildinfo.cmake:437 (message):
  This project seems to be plain C, but no compiler defined
Call Stack (most recent call first):
  conanbuildinfo.cmake:112 (conan_check_compiler)
  CMakeLists.txt:11 (conan_basic_setup)

it would not work until I changed my CML.txt to:

project( cmake-bde-helpers CXX )

There is no code to compile. We're only using CMake to install, test, and package these helpers because it's convenient and CMake supports it with mechanisms like NONE.

Windows Server 2012R2
E:>conan --version
Conan version 1.10.1

To help us debug your issue please explain:

  • I've read the CONTRIBUTING guide.
  • I've specified the Conan version, operating system version and any tool that can be relevant.
  • I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
@lasote lasote self-assigned this Jul 8, 2019
@lasote
Copy link
Contributor

lasote commented Jul 8, 2019

Hello Michael!
You can set the CONAN_DISABLE_CHECK_COMPILER variable in the CMake build helper:

 def build(self):
    cmake = CMake(self)
    cmake.definitions["CONAN_DISABLE_CHECK_COMPILER"] = True
    cmake.configure(source_folder="src")
    cmake.build()

It will skip that check.

@michaelmaguire
Copy link
Author

I've added the lines as indicated, my conanfile snippet now looks like:

    def build(self):
        cmake = CMake(self)
        cmake.definitions["CONAN_DISABLE_CHECK_COMPILER"] = True
        cmake.configure()
        cmake.build()
        cmake.install()

but even after conan remove of the package I still get error:

cmake-bde-helpers/0.6.0@PORT/stable: WARN: Build folder E:\DevelopBp\mmaguir1\.conan\cmake-bde-helpers\0.6.0\PORT\stable\build\4bd22f8292fc808c556e2440c204491f154100b0
ERROR: Traceback (most recent call last):
  File "conan\conans\errors.py", line 24, in conanfile_exception_formatter
  File "conan\conans\client\installer.py", line 186, in _build_package
  File "E:\DevelopBp\mmaguir1\.conan\cmake-bde-helpers\0.6.0\PORT\stable\export\conanfile.py", line 19, in build
    cmake.configure()
  File "conan\conans\client\build\cmake.py", line 188, in configure
  File "conan\conans\client\build\cmake.py", line 149, in _run
  File "conan\conans\model\conan_file.py", line 267, in run

@michaelmaguire
Copy link
Author

Ah, I see. The "disabilitation" was only added 6 months ago:

https://github.com/conan-io/conan/blame/d815f1da95a9acd2dabd7743a9ac81b139e0edb6/conans/client/generators/cmake_common.py#L421

I'll get our team to update to a more recent version of Conan

@lasote
Copy link
Contributor

lasote commented Jul 8, 2019

6 months in the Conan world is a life... ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants