[Cmake-commits] CMake branch, master, updated. v3.12.2-751-g8bb0e09

2018-09-27 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  8bb0e09e38d3ab75198b1cd9746bfa7a7b80ff94 (commit)
  from  3f7312a97800801735a63dd65b17e06a0fc61348 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8bb0e09e38d3ab75198b1cd9746bfa7a7b80ff94
commit 8bb0e09e38d3ab75198b1cd9746bfa7a7b80ff94
Author: Kitware Robot 
AuthorDate: Fri Sep 28 00:01:10 2018 -0400
Commit: Kitware Robot 
CommitDate: Fri Sep 28 00:01:10 2018 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 1a82e2a..d9aa818 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 12)
-set(CMake_VERSION_PATCH 20180927)
+set(CMake_VERSION_PATCH 20180928)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


Re: [CMake] LOCATION target property, generator expressions

2018-09-27 Thread Hendrik Greving
Thanks. Ok one step back. What we want is to have the same relative path
from binary/executable to linked library in build and install tree (which
we assume is the same for us). Looks like by default, e.g. cmake 3.9, puts
in an absolute path. The current (c-)makefiles compute the relative part of
an executable -> library by using LOCATION and add this to
-Wl,-rpath=$ORIGIN/[relative part]. We want to do the same w/o LOCATION
(i.e. resolving CMP0026)

On Thu, Sep 27, 2018 at 7:29 AM Brad King  wrote:

> On 09/26/2018 10:23 AM, Hendrik Greving wrote:
> > Is there any way before 3.13 to achieve what I need? Right now we
> > modify LINK_FLAGS based on something that is computed with values
> > from LOCATION.
> [snip]
> > our cmake setup is using LOCATION property for two targets to compute
> > a relative path from these two, and adds this to LINK_FLAGS
> > (for rpath, but irrelevant in this context).
>
> To at least see if 3.13 will support your use case, you could
> try a nightly binary from here:
>
>   https://cmake.org/files/dev/?C=M;O=D
>
> Use `$/..` to refer to a path relative
> to the target file location.
>
> I've never seen a need to adjust link flags based on the target
> location.  CMake has several features for RPATH support.  What
> are you really trying to do?
>
> -Brad
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Roger Leigh

On 27/09/18 22:55, Mateusz Loskot wrote:

On Thu, 27 Sep 2018 at 23:34, Dorier, Matthieu  wrote:


When I call find_package(XercesC REQUIRED) and XercesC is not in a standard 
location, I have to set XercesC_INCLUDE_DIR to its include directory and 
XercesC_LIBRARY to the location of the library.


[…]


I use to rely on a custom FindXercesC.cmake file that was using XercesC_ROOT to 
figure all this out.
Is there any way to do the same here?


There seem to be no Xxx_ROOT_DIR handled by this module
https://cmake.org/cmake/help/latest/module/FindXercesC.html


No, but CMAKE_PREFIX_PATH should be sufficient.  We can certainly add 
XercesC_ROOT, but is it really needed?  Matthieu, did you try 
CMAKE_PREFIX_PATH at all?


(I'm not sure what the CMake policy is on this point.  Is 
CMAKE_PREFIX_PATH support alone sufficient for Find modules?)


If the consensus is that Find modules should all provide ROOT_DIR type 
variables, then I'm sure patches to FindXercesC and FindXalanC would be 
appreciated.



Regards,
Roger
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Michael Ellery

> On Sep 27, 2018, at 2:55 PM, Mateusz Loskot  wrote:
> 
> 
> 
>> I use to rely on a custom FindXercesC.cmake file that was using XercesC_ROOT 
>> to figure all this out.
>> Is there any way to do the same here?
> 
> There seem to be no Xxx_ROOT_DIR handled by this module
> https://cmake.org/cmake/help/latest/module/FindXercesC.html
> 
> Best regards,
> -- 
> Mateusz Loskot, http://mateusz.loskot.net
> — 

although, if I understand correctly, it sounds like cmake 3.12 with policy 0074 
set might give you the xx_ROOT functionality without changing the find module:

https://cmake.org/cmake/help/latest/policy/CMP0074.html




-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Mateusz Loskot
On Thu, 27 Sep 2018 at 23:34, Dorier, Matthieu  wrote:
>
> When I call find_package(XercesC REQUIRED) and XercesC is not in a standard 
> location, I have to set XercesC_INCLUDE_DIR to its include directory and 
> XercesC_LIBRARY to the location of the library.

Correct. If Find-module can not guess, you help it by setting
FOO_INCLUDE_DIR and FOO_LIBRARY.

> If I set XercesC_LIBRARY to the directory containing the library (not to the 
> fullpath of the library itself), cmake finds XercesC but sets 
> XercesC_LIBRARIES to the folder instead of the library, and the same for the 
> XercesC::XercesC target. It seems I truly have to set XercesC_LIBRARY to the 
> name of the library rather than the path to the folder containing it, which 
> kinds of defies the point of find_package...

Find-modules are guessers and as such they do not guarantee they will
find anything.
Sometimes you need to help it, by setting some standard variables,
https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html

Xxx_INCLUDE_DIR - Where to find headers for using the Xxx library.
Xxx_LIBRARY - The path of the Xxx library

Then, Find-module can also perform extra checks of the explicitly
specified library
for eg.  version, symbols, functions, etc.

> I use to rely on a custom FindXercesC.cmake file that was using XercesC_ROOT 
> to figure all this out.
> Is there any way to do the same here?

There seem to be no Xxx_ROOT_DIR handled by this module
https://cmake.org/cmake/help/latest/module/FindXercesC.html

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake Cookbook is out!!

2018-09-27 Thread Alan W. Irwin

On 2018-09-27 20:26+0200 Eric Noulard wrote:


Hi CMakers,

Hi try not do that too often but here comes a little promotion for a book
which (I think) deserve attention.
The CMake Cookbook by Radovan Bast, Roberto Di Remigio
https://www.packtpub.com/application-development/cmake-cookbook


I don't buy e-books unless they are DRM-free. (See 
 for why 
DRM is such a concern to knowledgable readers of e-books.)
Thus, I was very happy to see the e-book form of the above book is DRM-free.

Alan
__
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Dorier, Matthieu
Hi,


I'm using cmake 3.11.4 and the FindXercesC.cmake file shipped with it.


When I call find_package(XercesC REQUIRED) and XercesC is not in a standard 
location, I have to set XercesC_INCLUDE_DIR to its include directory and 
XercesC_LIBRARY to the location of the library.


If I set XercesC_LIBRARY to the directory containing the library (not to the 
fullpath of the library itself), cmake finds XercesC but sets XercesC_LIBRARIES 
to the folder instead of the library, and the same for the XercesC::XercesC 
target. It seems I truly have to set XercesC_LIBRARY to the name of the library 
rather than the path to the folder containing it, which kinds of defies the 
point of find_package...


I use to rely on a custom FindXercesC.cmake file that was using XercesC_ROOT to 
figure all this out. Is there any way to do the same here?


Thanks,


Matthieu
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] How to produce a -config.cmake file

2018-09-27 Thread Dorier, Matthieu
Thanks, those pointers helped a lot!


Matthieu


From: Thompson, KT 
Sent: Thursday, September 27, 2018 3:30:33 PM
To: Dorier, Matthieu; cmake@cmake.org
Subject: RE: How to produce a -config.cmake file


Matthieu,



I think are asking about the CMakePackageConfigHelpers CMake module 
(https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html) 
that defines the macro ‘configure_package_config_file’.



You can probably find several tutorials or examples by searching github or 
stackoverflow, etc. for ‘CMakePackageConfigHelpers‘.  It is also covered in 
some detail in the e-book “Professional CMake” by Craig Scott (requires a 
purchase).



-kt



From: CMake  On Behalf Of Dorier, Matthieu
Sent: Thursday, September 27, 2018 2:42 AM
To: cmake@cmake.org
Subject: [CMake] How to produce a -config.cmake file



Hi,



I'm using cmake to build a library (damaris). Once installed, I would like 
users to be able to find it and its dependencies using find_package(damaris). 
If I understand correctly, the way to do that is to have cmake create and 
install a "damaris-config.cmake" file.



Is there a tutorial somewhere on how to do that?



Here is some more information:

the library depends on

- Boost (using the default FindBoost.cmake installed with cmake)

- XercesC (using a custom FindXercesC.cmake located in my source tree)

- XSD (using a custom FindXSD.cmake as well)

Additionally, it may have been built with the following optional dependencies:

- CppUnit (using a custom FindCppUnit.cmake)

- HDF5 (using the default FindHDF5.cmake shipped with cmake)

- VisIt (using a custom FindVisIt.cmake)

- ParaView (relying on the ParaViewConfig.cmake produced when installing 
ParaView).



Thanks,



Matthieu
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[Cmake-commits] CMake branch, release, updated. v3.12.2-12-ga9694d6

2018-09-27 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, release has been updated
   via  a9694d6538b5a975b08cea89bdd86ebce6166452 (commit)
   via  e7e88e955bc773be792e645ee8558d78b4183a87 (commit)
  from  60e6e5db61d6f27814bb68dee1f497848e147ffb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
---

Summary of changes:
 Utilities/cmlibarchive/libarchive/archive_openssl_hmac_private.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


[CMake] Issues with Python, Locale, CTest and MacOS

2018-09-27 Thread Michael Jackson
As part of our build we use “mkdocs” to generate our documentation. Last night 
I thought I made an innocuous change to our CMake files which ended up blowing 
up all of our macOS builds (10.10 and 10.13 systems). It is all related to 
trying to get Python/Mkdocs/Click to use a locale that is UTF-8 and not ASCII. 

Part of the error is:

Error 
  File "/usr/local/anaconda3/lib/python3.6/site-packages/click/_unicodefun.py", 
line 118, in _verify_python3_env
'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was 
configured to use ASCII as encoding for the environment.  Consult 
http://click.pocoo.org/python3/for mitigation steps.

This system lists a couple of UTF-8 supporting locales that
you can pick from.  The following suitable locales where
discovered: af_ZA.UTF-8, am_ET.UTF-8, be_BY.UTF-8, bg_BG.UTF-8, ca_ES.UTF-8, 
cs_CZ.UTF-8, da_DK.UTF-8, de_AT.UTF-8, de_CH.UTF-8, de_DE.UTF-8, el_GR.UTF-8, 
en_AU.UTF-8, en_CA.UTF-8, en_GB.UTF-8, en_IE.UTF-8, en_NZ.UTF-8, en_US.UTF-8, 
es_ES.UTF-8, et_EE.UTF-8, eu_ES.UTF-8, fi_FI.UTF-8, fr_BE.UTF-8, fr_CA.UTF-8, 
fr_CH.UTF-8, fr_FR.UTF-8, he_IL.UTF-8, hr_HR.UTF-8, hu_HU.UTF-8, hy_AM.UTF-8, 
is_IS.UTF-8, it_CH.UTF-8, it_IT.UTF-8, ja_JP.UTF-8, kk_KZ.UTF-8, ko_KR.UTF-8, 
lt_LT.UTF-8, nl_BE.UTF-8, nl_NL.UTF-8, no_NO.UTF-8, pl_PL.UTF-8, pt_BR.UTF-8, 
pt_PT.UTF-8, ro_RO.UTF-8, ru_RU.UTF-8, sk_SK.UTF-8, sl_SI.UTF-8, sr_YU.UTF-8, 
sv_SE.UTF-8, tr_TR.UTF-8, uk_UA.UTF-8, zh_CN.UTF-8, zh_HK.UTF-8, zh_TW.UTF-8

The whole build can be found at 


The _only_ way I seem to be able to get this to work is to use the built in 
python 2.7 at /usr/bin/python on the systems. I tried anaconda3 and python.org 
and neither of those worked. I can't be the only person to encounter this issue 
in CTest on a mac? If I build from the command line everything works just fine 
no matter which Python distribution that I use. The Ctest script is launched 
through "launchd" on the mac. I have exported environment variables, set 
environment variables for the locale in each bash script file that gets called? 
I am just plain out of ideas. 

Thanks for any help.

--
Michael Jackson | Owner, President
  BlueQuartz Software
[e] mike.jack...@bluequartz.net
[w] www.bluequartz.net 


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] CMake Cookbook is out!!

2018-09-27 Thread Eric Noulard
Hi CMakers,

Hi try not do that too often but here comes a little promotion for a book
which (I think) deserve attention.
The CMake Cookbook by Radovan Bast, Roberto Di Remigio
https://www.packtpub.com/application-development/cmake-cookbook

I'm not the author but I participate in the book review and I think the
authors did a great job and the book contains a lot of good stuff for CMake
users.

There is companion github project:
https://github.com/dev-cafe/cmake-cookbook/
which contains all the recipes of example of code  used in the book.
All the recipes are tested to various CI in order to ensure they work as
expected.

Happy building for everyone.
-- 
Eric
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] How to append a string on list inside a function

2018-09-27 Thread Marc CHEVRIER
Using a cache variable seems not required. A function creates a new scope
and inherit a copy of all variables defined in the upper scope.
So, by adding a set command using PARENT_SCOPE in your function you can
update the variable in the parent scope:
  function(addTest targetName)
# create the executable with all the souces
add_executable(${targetName} ${ARGN})
list(APPEND allTestsList ${targetName})
*set (allTestsList  ${allTestsList} PARENT_SCOPE) *
message("inside addTestFunction. allTestsList: "
${allTestsList})
endfunction()

Le jeu. 27 sept. 2018 à 12:43, Romain LEGUAY  a
écrit :

> Hello everyone,
>
> I try to append a string (target name) on a list inside a function called
> in other CMakeLists.
>
> I have the following project’s tree:
>
> ├── CMakeLists.txt
> ├── test
> ├── CMakeLists.txt
> └── app
> ├── CMakeLists.txt
> ├── appA
> │   ├── CMakeLists.txt
> │   └── main.cpp
> └── appB
> ├── CMakeLists.txt
> └── main.cpp
>
> Inside the test/CMakeLists.txt, I defined an internal variable like this:
> set(allTestsList "" CACHE INTERNAL "All executable tests.'')
> And my function:
> function(addTest targetName)
> # create the executable with all the souces
> add_executable(${targetName} ${ARGN})
> list(APPEND allTestsList ${targetName})
> message("inside addTestFunction. allTestsList: "
> ${allTestsList})
> endfunction()
>
> I call this function inside the test/app/appA and test/app/appB
> CMakeLists.txt like this:
> addTest(appA main.cpp)
> addTest(appB main.cpp)
>
> I expected to have as final result:
> inside addTestFunction. allTestsList: appA;appB
>
> But I only have:
> inside addTestFunction. allTestsList: appB
>
> I suspect that a new variable is created at each call of the function.
>
> Is it possible to use a global variable? (I tried to use PARENT_SCOPE with
> no success).
>
> Thank you,
>
> Romain
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] How to produce a -config.cmake file

2018-09-27 Thread Thompson, KT via CMake
Matthieu,

I think are asking about the CMakePackageConfigHelpers CMake module 
(https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html) 
that defines the macro 'configure_package_config_file'.

You can probably find several tutorials or examples by searching github or 
stackoverflow, etc. for 'CMakePackageConfigHelpers'.  It is also covered in 
some detail in the e-book "Professional CMake" by Craig Scott (requires a 
purchase).

-kt

From: CMake  On Behalf Of Dorier, Matthieu
Sent: Thursday, September 27, 2018 2:42 AM
To: cmake@cmake.org
Subject: [CMake] How to produce a -config.cmake file


Hi,



I'm using cmake to build a library (damaris). Once installed, I would like 
users to be able to find it and its dependencies using find_package(damaris). 
If I understand correctly, the way to do that is to have cmake create and 
install a "damaris-config.cmake" file.



Is there a tutorial somewhere on how to do that?



Here is some more information:

the library depends on

- Boost (using the default FindBoost.cmake installed with cmake)

- XercesC (using a custom FindXercesC.cmake located in my source tree)

- XSD (using a custom FindXSD.cmake as well)

Additionally, it may have been built with the following optional dependencies:

- CppUnit (using a custom FindCppUnit.cmake)

- HDF5 (using the default FindHDF5.cmake shipped with cmake)

- VisIt (using a custom FindVisIt.cmake)

- ParaView (relying on the ParaViewConfig.cmake produced when installing 
ParaView).



Thanks,



Matthieu
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] LOCATION target property, generator expressions

2018-09-27 Thread Brad King
On 09/26/2018 10:23 AM, Hendrik Greving wrote:
> Is there any way before 3.13 to achieve what I need? Right now we
> modify LINK_FLAGS based on something that is computed with values
> from LOCATION.
[snip]
> our cmake setup is using LOCATION property for two targets to compute
> a relative path from these two, and adds this to LINK_FLAGS
> (for rpath, but irrelevant in this context).

To at least see if 3.13 will support your use case, you could
try a nightly binary from here:

  https://cmake.org/files/dev/?C=M;O=D

Use `$/..` to refer to a path relative
to the target file location.

I've never seen a need to adjust link flags based on the target
location.  CMake has several features for RPATH support.  What
are you really trying to do?

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] How to append a string on list inside a function

2018-09-27 Thread Romain LEGUAY
Hello everyone,

I try to append a string (target name) on a list inside a function called in 
other CMakeLists.

I have the following project’s tree:

├── CMakeLists.txt
├── test
├── CMakeLists.txt
└── app
├── CMakeLists.txt
├── appA
│   ├── CMakeLists.txt
│   └── main.cpp
└── appB
├── CMakeLists.txt
└── main.cpp

Inside the test/CMakeLists.txt, I defined an internal variable like this:
set(allTestsList "" CACHE INTERNAL "All executable tests.'')
And my function:
function(addTest targetName)
# create the executable with all the souces
add_executable(${targetName} ${ARGN})
list(APPEND allTestsList ${targetName})
message("inside addTestFunction. allTestsList: " 
${allTestsList})
endfunction()

I call this function inside the test/app/appA and test/app/appB CMakeLists.txt 
like this:
addTest(appA main.cpp)
addTest(appB main.cpp)

I expected to have as final result:
inside addTestFunction. allTestsList: appA;appB

But I only have:
inside addTestFunction. allTestsList: appB

I suspect that a new variable is created at each call of the function.

Is it possible to use a global variable? (I tried to use PARENT_SCOPE with no 
success).

Thank you,

Romain


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] file(TO_NATIVE_PATH ... ) and cross-compiling

2018-09-27 Thread Kukosa Tomáš
Unfortunately I encountered exactly the same problem.

It would be nice to describe in documentation that file(TO_NATIVE_PATH 
...) means "native for target system" and also would be nice to 
introduce the file(TO_HOST_NATIVE_PATH ...) subcommand.

On 26.3.2018 19:40, Miroslav Keš wrote:
> I'm cross-compiling in Windows to another target system (VxWorks) but this is 
> not so important.
>
> I thought the idea behind the TO_NATIVE_PATH option was that the internal 
> CMake path representation could be transformed to the system native path so 
> that external programs that rely on the native path convention could be 
> easily used during the build.
>
> Either this my assumption is wrong or the CMake implementation is wrong. And 
> the documentation should be more detailed on the exact behavior.
>
> Mira
>
> On 03/21/2018 09:29 PM, Stephen McDowell wrote:
>> Disclaimer: I cannot speak to intent, and have never used these before.
>>
>> So since you’re cross compiling, when looking at the docs ( 
>> https://cmake.org/cmake/help/v3.0/command/file.html ), I *think* you can get 
>> away with using TO_CMAKE_PATH.  I do *not* know how you actually determine 
>> this, but the idea would be
>>
>> if (CMAKE_CROSSCOMPILING)
>>    if (… host is windows …)
>>        if (… target is unix …)
>>          … use TO_CMAKE_PATH …
>>        else()
>>          … use TO_NATIVE_PATH …
>>        endif()
>>    else() # … host is unix …
>>      if (… target is unix …)
>>        … use TO_CMAKE_PATH or TO_NATIVE_PATH …
>>      else() # … target is windows
>>        … PROBLEM …
>>      endif()
>> endif()
>>
>> That is, I think if you are compiling *on* Windows *for* Unix, you can cheat 
>> and use TO_CMAKE_PATH to get unix style paths.  But if you are compiling 
>> *on* unix *for* Windows, I don’t know how you get it to be Windows paths.
>>
>> But if this does solve Windows -> Unix, you could maybe just 
>> message(FATAL_ERROR …) saying that cross compiling for Windows from Unix is 
>> not supported.  You could also take a look at the implementation of 
>> TO_NATIVE_PATH and just snag the Windows code and make your own function 
>> that converts it, maybe calling it to_windows_path() or something?
>>
>> I hope that is helpful, but I really don’t know if anything in the above is 
>> possible :/
>>
>>
>>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] How to produce a -config.cmake file

2018-09-27 Thread Dorier, Matthieu
Hi,


I'm using cmake to build a library (damaris). Once installed, I would like 
users to be able to find it and its dependencies using find_package(damaris). 
If I understand correctly, the way to do that is to have cmake create and 
install a "damaris-config.cmake" file.


Is there a tutorial somewhere on how to do that?


Here is some more information:

the library depends on

- Boost (using the default FindBoost.cmake installed with cmake)

- XercesC (using a custom FindXercesC.cmake located in my source tree)

- XSD (using a custom FindXSD.cmake as well)

Additionally, it may have been built with the following optional dependencies:

- CppUnit (using a custom FindCppUnit.cmake)

- HDF5 (using the default FindHDF5.cmake shipped with cmake)

- VisIt (using a custom FindVisIt.cmake)

- ParaView (relying on the ParaViewConfig.cmake produced when installing 
ParaView).


Thanks,


Matthieu
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake