Skip to content

cmake_dependent_option fails if CMAKE_PROJECT_NAME has a space in it #294

@JesseTG

Description

@JesseTG

When trying to include toml11 in melonDS DS via FetchContent, I get this error message:

CMake Error at C:/tools/msys64/ucrt64/share/cmake/Modules/CMakeDependentOption.cmake:83 (if):
  if given arguments:

    "'melonDS" "DS'" "STREQUAL" "toml11"

  Unknown arguments specified
Call Stack (most recent call first):
  cmake-build-debug-windows/_deps/toml11-src/CMakeLists.txt:27 (cmake_dependent_option)


-- Configuring incomplete, errors occurred!

The offending CMake call is right here:

toml11/CMakeLists.txt

Lines 27 to 28 in 2a18a89

cmake_dependent_option(TOML11_INSTALL "install toml11 library" ON
"${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}" OFF)

Of note is that my project's value of CMAKE_PROJECT_NAME is melonDS DS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions