Re: [CMake] how to set current source directory relative to external project

2019-07-13 Thread Marc Herbert
Le mar. 9 juil. 2019 à 13:24, hex a écrit : > Now that I look at it it seems very obvious. I still have doubts, though: > > I guess I am seeing the contents of a build directory as somewhat > volatile. For most files I want that, to either clean the project or > override the files. > > But what

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread Hex
When I use CMAKE_BINARY_DIR the problem remains. If I set( EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin ) in my external project the binary is placed in build/ext1-prefix/src/ext1-build/bin/. Wouldn't it be better to have all my binaries in a single location? Such as build/bin/ ? The only way

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
>   Except for my generators well, to be exact it's not /except for/ . I am using multiple generators which means multiple copies of build targets. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
I don't know what sorts of files those are; they don't exist but they get created, they're not tracked, and not installed... They sounds like a build product, which is a target, (even it it's just part of a product, it's still a target) Exactly, these are mostly BYPRODUCTS, but also OUTPUT

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread J Decker
On Tue, Jul 9, 2019 at 1:24 PM hex wrote: > On 09/07/2019 18:25, J Decker wrote: > > > On Tue, Jul 9, 2019 at 9:38 AM hex wrote: > >> >> I think the better solution now is to make it relative to build directory >> and force out of source builds. >> >> >> +1 I think; You said it was generated?

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
On 09/07/2019 18:25, J Decker wrote: On Tue, Jul 9, 2019 at 9:38 AM hex > wrote: I think the better solution now is to make it relative to build directory and force out of source builds. +1 I think; You said it was generated?  It should be in the build

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread J Decker
On Tue, Jul 9, 2019 at 9:38 AM hex wrote: > thank you J Decker for your reply. > > > Your suggestion does work but I want to preserve standalone use of the > project, meaning that I want a reference to CMake source root directory. > > Assuming there is only 1 hierarchy I could add an option: > >

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
thank you J Decker for your reply. Your suggestion does work but I want to preserve standalone use of the project, meaning that I want a reference to CMake source root directory. Assuming there is only 1 hierarchy I could add an option: if ( SUPERBUILD ) /message("${CMAKE_SOURCE_DIR}/.. =

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread J Decker
On Tue, Jul 9, 2019 at 5:35 AM hex wrote: > hello CMake community, > > > I am experimenting with external projects. I have some files in an > external project which are generated in `${CMAKE_SOURCE_DIR}`. > > > When I add the external project, however, it is using > `${CMAKE_SOURCE_DIR}` of the

[CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
hello CMake community, I am experimenting with external projects. I have some files in an external project which are generated in `${CMAKE_SOURCE_DIR}`. When I add the external project, however, it is using `${CMAKE_SOURCE_DIR}` of the external project. I need `${CMAKE_SOURCE_DIR}` to

[CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
hello CMake community, I am experimenting with external projects. I have documentation in an external project which is generated in `${CMAKE_CURRENT_SOURCE_DIR}`. When I add the external project, however, it is using `${CMAKE_CURRENT_SOURCE_DIR}` of the "super build". I need