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

Unknown CMake command "add_compile_definitions". #244

Closed
linas opened this issue Feb 27, 2021 · 4 comments
Closed

Unknown CMake command "add_compile_definitions". #244

linas opened this issue Feb 27, 2021 · 4 comments
Assignees
Labels

Comments

@linas
Copy link
Member

linas commented Feb 27, 2021

While refreshing on an Ubuntu bionic (18.04 LTS) system, I got the error

CMake Error at opencog/util/CMakeLists.txt:72 (add_compile_definitions):
  Unknown CMake command "add_compile_definitions".

Apparently, this requires a newer version of CMake? Which version? Currently, the very first line of CMakeLists.txt is

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.2)

but apparently, this is not enough? Looking at the blame log, this shows that pull req #240 added this code, and it was provided by @ntoxeg and merged by me (apparently, without checking if it worked on bionic ...)

Any clue for what it would take to get this to work on bionic?

@linas linas added the bug label Feb 27, 2021
@linas
Copy link
Member Author

linas commented Feb 27, 2021

Apparently, this first appears in cmake version 3.12 while ubuntu 18.04 has only cmake version 3.10

linas added a commit to linas/cogutils that referenced this issue Feb 27, 2021
Ubuntu 18.04 does not have a new-enough CMake
@linas linas self-assigned this Feb 27, 2021
@ntoxeg
Copy link
Contributor

ntoxeg commented Feb 27, 2021

The older way of doing this is to use add_compile_options and explicitly state the option. Another way is to have newer CMake installed - besides obvious (and undesirable I’m assuming) installation from source it should also be installable with Snap like this: sudo snap install cmake —classic.

@amebel
Copy link
Contributor

amebel commented Mar 1, 2021

See https://apt.kitware.com/ for installing the latest cmake version on ubuntu.

linas added a commit that referenced this issue Mar 5, 2021
Bug #244 -- allow older cmake versions
@linas
Copy link
Member Author

linas commented Mar 6, 2021

fixed in #246

@linas linas closed this as completed Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants