[CMake] Forcing location of binary directory in CMake

Carlson Daniel daniel.c.carlson at gmail.com
Thu Mar 26 15:38:20 EDT 2009


Why not use out of source build?

http://wiki.qgis.org/qgiswiki/Building_with_CMake

//Daniel

2009/3/26 Michael Jackson <mike.jackson at bluequartz.net>

> I would use something like the following:
>
> get_filename_component(buildParent ${CMAKE_CURRENT_BINARY_DIR} PATH)
> if (NOT ${buildParent} STREQUAL ${${PROJECT_NAME}_SOURCE_DIR})
>        message(FATAL_ERROR "Wrong Build Directory")
> endif()
>
> Or something similar to that might work.
>
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
> BlueQuartz Software                    www.bluequartz.net
> Principal Software Engineer                  Dayton, Ohio
>
>
>
> On Mar 26, 2009, at 3:16 PM, Robert Dailey wrote:
>
>  Hi,
>>
>> For various reasons I will not bother to mention here, I need to stipulate
>> the location of the binary directory. For example, if my source directory
>> is:
>>
>> C:\foo\bar
>>
>> My build directory *must* be here:
>>
>> C:\foo\bar\build
>>
>> The user should not have a choice in the matter. This is a requirement. Is
>> there a way to enforce this?
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090326/290502be/attachment.htm>


More information about the CMake mailing list