Skip to content

Fix CMAKE_BUILD_TYPE handling in CMakeLists.txt in the root directory #188

@ahuimmo

Description

@ahuimmo

In CMakeLists.txt in the root directory, at line 41:

if(NOT DEFINED ${CMAKE_BUILD_TYPE})
    set(CMAKE_BUILD_TYPE "Release")
endif()

If I want a debug build, and I run:

$ cmake .. -DCMAKE_BUILD_TYPE=Debug

Since ${CMAKE_BUILD_TYPE} is "Debug", and the code is actually checking if a variable named "Debug" is defined, and obviously, it isn't. So I always get a release build instead. I think it should be:

if(NOT DEFINED CMAKE_BUILD_TYPE)

Please reply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions