What is the default build configuration of cmake

Lahiru Chandima

In this answer, it says Debug is the default cmake build configuration.

But I have a different observation:

I have following in my CMakeLists.txt to choose debug and release versions of a lib according to the current build configuration.

target_link_libraries(MyApp debug Widgets_d)
target_link_libraries(MyApp optimized Widgets)

It seems that when I invoke cmake without sepcifying -DCMAKE_BUILD_TYPE flag, Widgets is used instead of Widgets_d (When I delete Widgets and try to build, make complains that lib is not there). So that means by default the build configuration is optimized, not debug.

So what actually is the default build configuration? If it is debug, what could be wrong with my CMakelists.txt?

Mikhail Maltsev

target_link_libraries with optimized keyword corresponds to all configurations, which are not debug.

Try adding message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") to your CMakeLists.txt to see the actual build type (I suppose it should be empty).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What is the name of CMake's default build target?

From Dev

Set a default build configuration for project

From Dev

cmake set build configuration per target

From Dev

How to change default options of Visual Studio build using CMake

From Dev

Android CMake build adding no-exceptions and no-rtti by default

From Dev

cmake: check if file exists at build time rather than during cmake configuration

From Dev

What is the default search path for find_package in windows using cmake?

From Dev

Gradle build error "Configuration with name 'default' not found."

From Dev

What package do I need to build a Qt 5 & CMake application?

From Dev

What package do I need to build a Qt 5 & CMake application?

From Dev

auto-generated sources and cmake configuration: developer build vs user build

From Dev

What's the error as "CMAKE_BOOTSTRAP_BINARY_DIR" at a time as build CMake from a source code

From Dev

Gradle: What Is The Default Configuration and How Do I Change It

From Dev

What does <Directory /> entry mean in Apache2 default configuration

From Dev

What other build options exist to compile the most superior configuration of FFmpeg?

From Dev

android build.gradle file for app - what is default repository

From Dev

What are the default arguments in GPS's Build>Run command?

From Dev

android build.gradle file for app - what is default repository

From Dev

Using cmake, how do you determine the default compiler flags per build type?

From Dev

What's the differnce between "Set as Default Device" and "Set as Default Communications Device" in the Sound configuration in Windows 7?

From Dev

CMake: per configuration dependencies

From Dev

cmake build error on build process

From Dev

What is the difference between "configuration: 'android-endpoints'" and "configuration: 'endpoints'" in build.gradle in Android Studio?

From Dev

Global default settings for cmake

From Dev

What is the proper way of using /p per build step in a TeamCity build configuration?

From Java

What Product Flavor does Android Studio build by default in build.gradle?

From Java

CMake output/build directory

From Dev

Is it possible to build Boost with CMake?

From Dev

Build Project Tree in CMake

Related Related

  1. 1

    What is the name of CMake's default build target?

  2. 2

    Set a default build configuration for project

  3. 3

    cmake set build configuration per target

  4. 4

    How to change default options of Visual Studio build using CMake

  5. 5

    Android CMake build adding no-exceptions and no-rtti by default

  6. 6

    cmake: check if file exists at build time rather than during cmake configuration

  7. 7

    What is the default search path for find_package in windows using cmake?

  8. 8

    Gradle build error "Configuration with name 'default' not found."

  9. 9

    What package do I need to build a Qt 5 & CMake application?

  10. 10

    What package do I need to build a Qt 5 & CMake application?

  11. 11

    auto-generated sources and cmake configuration: developer build vs user build

  12. 12

    What's the error as "CMAKE_BOOTSTRAP_BINARY_DIR" at a time as build CMake from a source code

  13. 13

    Gradle: What Is The Default Configuration and How Do I Change It

  14. 14

    What does <Directory /> entry mean in Apache2 default configuration

  15. 15

    What other build options exist to compile the most superior configuration of FFmpeg?

  16. 16

    android build.gradle file for app - what is default repository

  17. 17

    What are the default arguments in GPS's Build>Run command?

  18. 18

    android build.gradle file for app - what is default repository

  19. 19

    Using cmake, how do you determine the default compiler flags per build type?

  20. 20

    What's the differnce between "Set as Default Device" and "Set as Default Communications Device" in the Sound configuration in Windows 7?

  21. 21

    CMake: per configuration dependencies

  22. 22

    cmake build error on build process

  23. 23

    What is the difference between "configuration: 'android-endpoints'" and "configuration: 'endpoints'" in build.gradle in Android Studio?

  24. 24

    Global default settings for cmake

  25. 25

    What is the proper way of using /p per build step in a TeamCity build configuration?

  26. 26

    What Product Flavor does Android Studio build by default in build.gradle?

  27. 27

    CMake output/build directory

  28. 28

    Is it possible to build Boost with CMake?

  29. 29

    Build Project Tree in CMake

HotTag

Archive