[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Any way to append CMAKE_INSTALL_PREFIX with CMAKE_CFG_INTDIR?
From:       "Thompson, KT" <kgt () lanl ! gov>
Date:       2015-03-24 19:58:41
Message-ID: 0458DF31F610EF42BFC78C497E806C7B40FF2342 () ECS-EXG-P-MB03 ! win ! lanl ! gov
[Download RAW message or body]

That solution works for me.  Thanks for your help!

-----Original Message-----
From: David Cole [mailto:DLRdave@aol.com] 
Sent: Tuesday, March 24, 2015 12:23 PM
To: Thompson, KT
Cc: cmake@cmake.org
Subject: Re: [CMake] Any way to append CMAKE_INSTALL_PREFIX with CMAKE_CFG_INTDIR?

An "install" of a CMake based project is invoked something like this
from within a generated Visual Studio project:

    cmake.exe -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake

If you dig into the (generated) cmake_install.cmake file, you'll see
a chunk like this right near the top of the file:

    if(NOT DEFINED CMAKE_INSTALL_PREFIX)
      set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/Tutorial")
    endif()

One thing you could do is write your own custom install command that
passes in a value of CMAKE_INSTALL_PREFIX with the per-configuration
suffix you're looking for.

    cmake.exe -DBUILD_TYPE=${CMAKE_CFG_INTDIR}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}${CMAKE_CFG_INTDIR} -P
cmake_install.cmake


HTH,
David C.


On Tue, Mar 24, 2015 at 1:32 PM, Thompson, KT <kgt@lanl.gov> wrote:
> Hi,
> 
> 
> 
> For build tools like Visual Studio or Xcode, I would like to have
> CMAKE_INSTALL_PREFIX end with the build configuration type (Release, Debug,
> etc.)  I tried to append CMAKE_INSTALL_PREFIX with ${CMAKE_CFG_INTDIR} or
> $<CONFIG> but those approaches didn't work (The install directory had was a
> folder that ended with the string literal ‘${configuration}').  Can anyone
> provide a recipe that allows me to run cmake once to generate a project and
> then toggle between Debug and Release in the build tool to generate separate
> installations in directories that have names that use the configuration
> type?
> 
> 
> 
> Thanks!
> 
> 
> 
> -kt
> 
> Kelly (KT) Thompson
> 
> 
> 
> 
> --
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic