On 13. Oct, 2010, at 23:31 , [email protected] wrote:

> 
>> Nevertheless,
>> I think may be you did not fully read my answer (unless I'm wrong)
>> but you CAN call [part of] your home made makefile rules
>> ** FROM THE SEPARATE CMAKE BUILD  **
> 
> I read it, I just did not get it, being a newbie and all.    :-)
> But, I see now.
> 
>> if you add some extra CMake lines like the following:
>> add_custom_target(save
>>                            COMMAND ${CMAKE_MAKE_PROGRAM} save
>>                            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
>>                            COMMENT "Home brewed make save target")
>> The previous line will create in the CMake generated makefile
>> a rule which when invoked will call your makefile rule
>> (same name) in the source tree.
>> 
> 
> I leave my existing makefiles in the source tree and CMake will
> create the build Makefiles in the out-of-source area.
> In this way they will not step on my existing makefiles.
> 
> Then, simple targets in the CMake makefiles can be used
> to run the real targets in my existing makefile (which live
> in the source area.)
> 
> Very clever.
> 
> Bill

But please, put something like this in your CMakeLists.txt:

# detect symlink trickery
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
# prevent in-source builds
if("${srcdir}" STREQUAL "${bindir}")
  message(FATAL_ERROR "In-source builds are forbidden!")
endif()


Otherwise it is all too easy to shoot yourself in the foot!

Michael

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken

Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
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

Reply via email to