[CMake] Cache variables from module

2018-05-03 Thread Florian Lindner
Hello, I have a third party FindPETSc.cmake module: https://github.com/jedbrown/cmake-modules/blob/master/FindPETSc.cmake The problem I have, is that variable PETSC_VERSION is not set when cmake is run for a second time https://github.com/jedbrown/cmake-modules/issues/28 What is best way to d

Re: [CMake] advice for resolving errors with CMake 3.8

2018-05-03 Thread Stephen McDowell
If you don't want to have to keep switching to Windows and back to test, the most reliable way to know with absolute certainty is to install CMake 3.8 on OSX and use that. Fortunately building cmake is actually quite easy, you can even use the newer cmake from brew to configure the older one (use

Re: [CMake] Cache variables from module

2018-05-03 Thread Isaiah Norton
PARENT_SCOPE and CACHE can't be used in the same call, presumably because cache is global. So cmake doesn't recognize those arguments, and instead sets the variable PETSC_VERSION to a list containing all the following arguments except PARENT_SCOPE (which does still apply). Perhaps a newer cmake ver

Re: [CMake] Cache variables from module

2018-05-03 Thread Isaiah Norton
> > Perhaps a newer cmake version will give an error. > Just tested with 3.11 -- sadly not. But the suggested fix does work. On Thu, May 3, 2018 at 10:39 AM, Isaiah Norton wrote: > PARENT_SCOPE and CACHE can't be used in the same call, presumably because > cache is global. So cmake doesn't reco

Re: [CMake] using ExternalProject_Add when cmake is launched

2018-05-03 Thread Bill Hoffman
On 5/2/2018 4:47 AM, Petr Kmoch wrote: Hi Stephane. ExternalProject is designed to run at *build* time, not at *CMake* time. It is not really intended for mixing with normal, non-ExternalProject targets (such as those created by add_library). When using ExternalProject, the canonical form of

[CMake] C library export management, please critique and improve and tell me if there's a better way

2018-05-03 Thread remleduff
Hello! I'm converting a legacy C code base with a slightly unusual problem, but one that I've seen elsewhere occasionally. Basically, the libraries were not written with any concept of namespace cleanliness, and when they are linked together there are many symbol conflicts. Worse, there are symbol