[CMake] How force cmake debug/release

Andy borucki.andrzej at gmail.com
Thu Dec 6 03:50:53 EST 2018


In cmake I have:
if (${CMAKE_BUILD_TYPE} STREQUAL Release)
  message(WARNING "Release")
endif()

if (${CMAKE_BUILD_TYPE} STREQUAL Debug)
  message(WARNING "Debug")
endif()

(how write something like elseif?)

If I call "cmake ." it write: "Warning:Debug"
Debug is default and I must call "cmake . -DCMAKE_BUILD_TYPE=Release"
for release?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181206/f470ab23/attachment-0001.html>


More information about the CMake mailing list