Closed Nemirtingas closed 1 month ago
if(NOT "ON")
andif(NOT "OFF")
doesn't work. Its always true.
It does work. At least with cmake_minimum_required(VERSION 3.0)
. (CMP0012.)
cmake_minimum_required(VERSION 3.0)
if("ON")
message(STATUS "okay: ON")
endif()
if(NOT "ON")
message(FATAL_ERROR "not okay: NOT ON")
endif()
if("OFF")
message(FATAL_ERROR "not okay: OFF")
endif()
if(NOT "OFF")
message(STATUS "okay: NOT OFF")
endif()
The patch adds all this logic before cmake_minimum_required: https://github.com/paullouisageneau/libdatachannel/blob/3c33ea0f49fff2630be080b2043052b4d3de5786/CMakeLists.txt#L1
Maybe thats the issue?
The patch doesn't add any code before cmake_minimum_required
. A config.cmake file is generally used after cmake_minimum_required
+ project
.
AFAIU you must look at your project, not at vcpkg.
My cmakelists.txt is written as:
cmake_policy(SET CMP0063 NEW)
cmake_policy(SET CMP0091 NEW)
project(lib_name)
cmake_minimum_required(VERSION 3.15)
find_package(LibDataChannel CONFIG REQUIRED)
What could be the issue then?
cmake_minimum_required
must be used before project
. Frequent error.
Dang x), thanks for the help!
Operating system
Linux
Compiler
GCC
Steps to reproduce the behavior
vcpkg install libdatachannel
Then use libdatachannel in your project.
Failure logs
Additional context
Here is the config file's LibDataChannelConfig.cmake content:
if(NOT "ON")
andif(NOT "OFF")
doesn't work. Its always true. https://github.com/microsoft/vcpkg/blob/e60236ee051183f1122066bee8c54a0b47c43a60/ports/libdatachannel/dependencies.diff#L45-L61When building a static library.