Re: [CMake] Policy Stack within Macros/Functions

2019-10-21 Thread Kyle Edwards via CMake
On Mon, 2019-10-21 at 21:39 +0200, Sérgio Agostinho wrote: > For further users with the same problem, you likely do not need need > to invoke cmake_policy(PUSH)/cmake_policy(POP) from your shipped > Config file, so just delete them and set whatever policies you need > without concerns. This has th

Re: [CMake] Policy Stack within Macros/Functions

2019-10-21 Thread Sérgio Agostinho
Thank you for the tip. After rereading the documentation again, I noticed the following quote in the docs CMake also manages a new entry for scripts loaded by include() and find_package()

Re: [CMake] Custom installation of cmake

2019-10-21 Thread Mahmood Naderan via CMake
Thanks. I found it much easier to use the installer package (.sh file). I wanted a new gcc for building cmake. since the system default is 4.8.5. The installer package is available and installed that to my custom folder. Regards, Mahmood On Sunday, October 20, 2019, 8:58:25 PM GMT+3:30, Ray

Re: [CMake] How to properly add include directories?

2019-10-21 Thread David Aldrich
> > >What generator are you using? > Ninja > That thread seems to contain a lot of misunderstandings about the issue. > > If you are using the Makefile generator then refer to > https://stackoverflow.com/questions/7461000/handling-header-files-dependencies-with-cmake. > After building the projec

Re: [CMake] [EXT] How to properly add include directories?

2019-10-21 Thread Bon, William
Hello, Have you try to add the header files in the add_library command to explicitely add a dependency over it ? add_library(MyLib SHARED my_source.cpp ../MyHeaders/header.hpp etc.) On 10/21/19 4:16 PM, David Aldrich wrote: WARNING: External email, please be mindful before clicking or replying.

Re: [CMake] How to properly add include directories?

2019-10-21 Thread Fred Baksik
On Mon, Oct 21, 2019, at 10:16 AM, David Aldrich wrote: > Hi again, > > My CMakeLists.txt file for my shared library contains: > > add_library(MyLib SHARED my_source.cpp etc.) > target_include_directories( MyLib PRIVATE ../MyHeaders) > > The library builds ok, but there is no dependency on dir

[CMake] How to properly add include directories?

2019-10-21 Thread David Aldrich
Hi again, My CMakeLists.txt file for my shared library contains: add_library(MyLib SHARED my_source.cpp etc.) target_include_directories( MyLib PRIVATE ../MyHeaders) The library builds ok, but there is no dependency on directory ../MyHeaders - touching a header file does not result in a re-compi

Re: [CMake] Concerning ninja -v

2019-10-21 Thread David Aldrich
> > >Does just invoking ninja with -v not show verbosity? That should do it. > > don't believe CMAKE_VERBOSE_MAKEFILE affects Ninja builds. > > >Kyle > Yes thanks, that does do it. I just wondered whether there was a neater way for when CMake is invoked by an IDE such as VS Code with the cmake-too

Re: [CMake] Concerning ninja -v

2019-10-21 Thread Kyle Edwards via CMake
On Mon, 2019-10-21 at 10:23 +0100, David Aldrich wrote: > I have a simple CMake project with subdirectories: > > cmake_minimum_required(VERSION 3.10) > project(MyProject VERSION 1.0.0) > > set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON") > > add_subdirectory(say-hello) > add_subdirectory(hello-exe

Re: [CMake] Policy Stack within Macros/Functions

2019-10-21 Thread Kyle Edwards via CMake
On Sun, 2019-10-20 at 19:25 +0200, Sérgio Agostinho wrote: > Hey everyone, > > I’m shipping a config file for my library and inside I set push/pop > specific policies so that me and the consumers of my library can > target different policies without us clashing against each other. > However I’m st

[CMake] Concerning ninja -v

2019-10-21 Thread David Aldrich
I have a simple CMake project with subdirectories: cmake_minimum_required(VERSION 3.10) project(MyProject VERSION 1.0.0) set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON") add_subdirectory(say-hello) add_subdirectory(hello-exe) Will the 'CMAKE_VERBOSE_MAKEFILE' option be inherited by the CMakeLists