<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <blockquote type="cite"
      cite="mid:65058547-9cb0-b269-625d-aea787ab1a3c@gmail.com">
      <p>good afternoon, <br>
        <br>
        I am following the CMake book to learn about CMake. I have
        trouble to follow chapter 3: build configurations
        (<a class="moz-txt-link-freetext"
href="https://riptutorial.com/cmake/example/26702/setting-a-release-debug-configuration"
          moz-do-not-send="true">https://riptutorial.com/cmake/example/26702/setting-a-release-debug-configuration</a>)<br>
        <br>
        In this part it is not very clear why these configurations are
        used, and how they work. <br>
        <br>
        here is the script in cmake:<br>
        <br>
        <b>CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)</b><b><br>
        </b><b>SET(PROJ_NAME "myproject")</b><b><br>
        </b><b>PROJECT(${PROJ_NAME})</b><b><br>
        </b><b><br>
        </b># Configuration types<b><br>
        </b><b>SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE
          STRING "Configs" FORCE)</b><b><br>
        </b><b>IF(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION
          VERSION_GREATER "2.8")</b><b><br>
        </b><b>  SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 
          ${CMAKE_CONFIGURATION_TYPES})</b><b><br>
        </b><b>ENDIF()</b><b><br>
        </b><b><br>
        </b><b>SET(${PROJ_NAME}_PATH_INSTALL    
          "/opt/project"                     CACHE PATH "This directory
          contains installation Path")</b><b><br>
        </b><b>SET(CMAKE_DEBUG_POSTFIX "d")</b><b><br>
        </b><br>
        # Install<br>
        #---------------------------------------------------#<b><br>
        </b><b>INSTALL(TARGETS ${PROJ_NAME}</b><b><br>
        </b><b>    DESTINATION 
          "${${PROJ_NAME}_PATH_INSTALL}/lib/${CMAKE_BUILD_TYPE}/"</b><b><br>
        </b><b>    )</b><b><br>
        </b><br>
        <br>
        So, instead of building the project relative to my project
        folder, it installs into "/opt/" directory in linux. Why would I
        want/prefere to do that? And what if I am working with Windows,
        instead? <br>
        <br>
        Since the application is build in "/opt/" it suggests that cmake
        in above example functions similar to an software installer. <br>
      </p>
      <p><br>
      </p>
      <p>The documentation on cmake.org states that
        CMAKE_CONFIGURATION_TYPES specifies multiple build types (Debug,
        Release, Test, etc), which is ultimately what I am interested
        in. <br>
      </p>
      <p>I suppose I am also able to use this concept if I want relative
        path for debug/release directories like in Eclipse? <br>
        <br>
        <br>
        thank you!<br>
      </p>
    </blockquote>
  </body>
</html>