aewallin / opencamlib

open source computer aided manufacturing algorithms library
http://www.anderswallin.net/CAM
GNU Lesser General Public License v2.1
408 stars 137 forks source link

`check_ipo_supported` causing CMake to error out #152

Closed ad1217 closed 1 year ago

ad1217 commented 1 year ago

The call to check_ipo_supported, introduced in PR #142, causes CMake 3.25.2 (on Arch Linux) to error out:

CMake Error at /usr/share/cmake/Modules/CheckIPOSupported.cmake:169 (message):
  Policy CMP0069 is not set
Call Stack (most recent call first):
  CMakeLists.txt:94 (check_ipo_supported)

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.25)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

I'm not very familiar with CMake, but either adding cmake_policy(SET CMP0069 NEW) or cmake_minimum_required(VERSION 3.15) to src/CMakeLists.txt seems to fix this.

vespakoen commented 1 year ago

The cmake_minimum_required call is done in ./CMakeLists.txt, perhaps you are trying to compile ./src/CmakeLists.txt directly?

See: https://github.com/aewallin/opencamlib/blob/master/CMakeLists.txt#L1

ad1217 commented 1 year ago

Err, whoops. That was indeed the issue... Looks like I changed it to build directly from src/ in 2017 for unclear reasons. Thanks!