jasmcaus/tau

Compilation failed with cmake

imsomedev opened this issue · 5 comments

Hi, this is the follow up of adorad/adorad#6 here is the error message that showed up. (CMakeOutput.log)

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
-- The C compiler identification is MSVC 19.26.28806.0
-- The CXX compiler identification is MSVC 19.26.28806.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:206 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "VERSION" is not allowed.


-- Configuring incomplete, errors occurred!
See also "C:/lang/Muon/build/CMakeFiles/CMakeOutput.log".

And I've did some googling and found the problem that caused. which is I'm using MSVC 19.26, MSVS 2019 and cmake 3.15. (Note that I've no prior knowledge in cmake). Your cmake script require 3.5+ cmake_minimum_required(VERSION 3.5 FATAL_ERROR) and my version is lower, however the FATAL_ERROR wasn't also working because

The FATAL_ERROR option is accepted but ignored by CMake 2.6 and higher. It should be specified so CMake versions 2.4 and lower fail with an error instead of just a warning.

Sorry if this issue is is pointless but I just want to point out the problem that caused, maybe you could print an error and terminate the script if the version is not compatible yourself, apparently cmake won't.

Thanks for pointing this out. I haven't tested CMake on earlier versions, hence the high version bar. On further inspection, I realized that I can support earlier versions.
I've changed the minimum CMake version of this project to 3.15+ - could you check whether it compiles with your configuration? Thanks much in advance.

Hi, It still fail to compile on 3.15-rc4 with the following error message.

CMake Error at CMakeLists.txt:217 (set_target_properties):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "VERSION" is not allowed.

I did some googling and find out that Interface library (no idea what it is) only support whitelisted properties till https://gitlab.kitware.com/cmake/cmake/-/merge_requests/3212 merged, which is 3.19.0-rc1 and then they removed it and allow any property to be set.

Okay, I should have done more reading on that. Would you like to add this change? Here n this project as well as adorad/adorad#6? I could do this, but since you found the issue, it would only be right if you did it.
I'm thinking maybe changing the version to 3.20? A nice round version haha

@imsomedev, are you interested in making this change? If I don't hear from you, I'll go ahead and make the change

@jasmcaus Oh, sorry I was busy since then, It's okey you could make the change, I'll test it by next week.