[Cmake-commits] CMake branch, master, updated. v3.13.0-rc1-177-g9869b1d

2018-10-20 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  9869b1de3899bf9db3f02240f553d1187290f22c (commit)
  from  eef0ae604726e90c98c485adc0515e981f5ef5e8 (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=9869b1de3899bf9db3f02240f553d1187290f22c
commit 9869b1de3899bf9db3f02240f553d1187290f22c
Author: Kitware Robot 
AuthorDate: Sun Oct 21 00:01:05 2018 -0400
Commit: Kitware Robot 
CommitDate: Sun Oct 21 00:01:05 2018 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index b970019..bd80231 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 13)
-set(CMake_VERSION_PATCH 20181020)
+set(CMake_VERSION_PATCH 20181021)
 #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] how to debug CPack creation

2018-10-20 Thread Craig Scott
On Sun, Oct 21, 2018 at 3:41 AM Илья Шипицин  wrote:

>
>
> сб, 20 окт. 2018 г. в 18:31, Eric Noulard :
>
>>
>>> And the content is:
>>> $ rpm -qpl softether-vpnserver-5.1.9660-1.x86_64.rpm
>>> /lib
>>> /lib/systemd
>>> /lib/systemd/system
>>> /lib/systemd/system/softether-vpnserver.service
>>> /usr/libexec
>>> /usr/libexec/softether
>>> /usr/libexec/softether/vpnserver
>>> /usr/libexec/softether/vpnserver/hamcore.se2
>>> /usr/libexec/softether/vpnserver/vpnserver
>>> /usr/local
>>> /usr/local/bin
>>> /usr/local/bin/vpnserver
>>>
>>> the content of the .deb is similar:
>>> $ dpkg-deb -c softether-vpnserver_5.1.9660_amd64.deb
>>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/
>>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/systemd/
>>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/systemd/system/
>>> -rw-r--r-- root/root   700 2018-10-20 14:45
>>> ./lib/systemd/system/softether-vpnserver.service
>>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/
>>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/libexec/
>>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/libexec/softether/
>>> drwxr-xr-x root/root 0 2018-10-20 14:45
>>> ./usr/libexec/softether/vpnserver/
>>> -rw-r--r-- root/root   1770716 2018-10-20 14:45
>>> ./usr/libexec/softether/vpnserver/hamcore.se2
>>> -rwxr-xr-x root/root   2088960 2018-10-20 14:45
>>> ./usr/libexec/softether/vpnserver/vpnserver
>>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/local/
>>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/local/bin/
>>> -rwxr-xr-x root/root72 2018-10-20 14:45 ./usr/local/bin/vpnserver
>>>
>>> The main question is, what filesystem layout do you expect for those
>>> files?
>>>
>>>
>> Now I think I get it.
>> IN vpnserver CMakeLists.txt you do:
>>
>> install_systemd_service("vpnserver"
>> "${CMAKE_SOURCE_DIR}/systemd/softether-vpnserver.service"
>> "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver")
>>
>> So at this point (during CMake config step)
>> "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver"
>> is /usr/local/softether/vpnserver/vpnserver
>>
>> In your install_systemd_service CMake macro wrapper you do:
>>
>> macro(install_systemd_service component file_path binary_path)
>> get_filename_component(file_name ${file_path} NAME)
>> get_filename_component(binary_directory ${binary_path} DIRECTORY)
>>
>> file(READ ${file_path} FILE_CONTENT)
>> string(REPLACE "[DIRECTORY]" ${binary_directory} FILE_CONTENT
>> ${FILE_CONTENT})
>> string(REPLACE "[BINARY]" ${binary_path} FILE_CONTENT ${FILE_CONTENT})
>> file(WRITE ${CMAKE_SOURCE_DIR}/tmp/systemd/${file_name}
>> ${FILE_CONTENT})
>> ...
>>
>> So you generate a systemd service file which contains /usr/local prefix
>> because this is the one which
>> is know during "CMake configuration step".
>>
>> You cannot do that this way with .deb or .rpm because you don't know the
>> "actual" prefix that will be in the package
>> because it is controlby CPACK_PACKAGING_INSTALL_PREFIX  "at CPack time",
>> i.e. when CPack runs.
>>
>> It's even worse because .deb or .rpm may be relocated see e.g.:
>>
>> https://www.cyberciti.biz/faq/howto-install-rpm-package-into-another-directory/
>>
>> When you want to install script that should know where things get
>> installed you have 3 options:
>>
>> 1) Assume the binary executable is installed in the path
>> thus call the executable as-is "vpnserver" without absolute path
>>
>> 2) Put a pre- or post- install script that will compute the appropriate
>> path
>>**during package installation** when you are sure what the real path
>> will be.
>>Have a look at CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA in
>> https://cmake.org/cmake/help/latest/cpack_gen/deb.html
>> or
>> https://cmake.org/cmake/help/latest/cpack_gen/rpm.html#variable:CPACK_RPM_SPEC_MORE_DEFINE
>>
>> 3) Ensure that you generate package with
>>CMAKE_INSTALL_PREFIX == CPACK_PACKAGING_INSTALL_PREFIX
>>This is ok but will break if the installation of the package is
>> relocated.
>>
>
> this is good.
> is there a way to install shared libs to system location ? (in order to
> avoid ld manipulation)
>

If your app isn't part of the Linux distribution itself, you shouldn't
install it to /usr. You should be looking to install to somewhere like /opt
instead (or maybe /usr/local, but /opt is generally better). You should be
able to use RPATH to avoid needing to mess with the library search path -
search the CMake docs for INSTALL_RPATH, it has pretty good support for
RPATH these days. Just be sure to use relative RPATHs (i.e. start each path
with $ORIGIN for Linux) to ensure your package remains relocatable.


-- 
Craig Scott
Melbourne, Australia
https://crascit.com

New book released: Professional CMake: A Practical Guide

-- 

Powered by www.kitware.com

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


[CMake] best way to override or bypass find_package for OS-specific settings

2018-10-20 Thread Joachim Wuttke

Project P depends on library L.
L comes with a module FindL.cmake, which is so
complicated that we would not be able to adapt it
to our needs.

On most platforms, users will build P from source,
and dynamically link with L. For them, the line

  find_package(L REQUIRED)

in P/CMakeLists.txt works fine.

But now let's suppose users of platform W are unable
to cope with binaries that depend on dynamic libraries.
They want a fully self-contained executable.

Therefore on this platform, we need to link P
statically with L. Let's assume that a static binary
of L is provided in an idiosyncratic location X/L.lib.

So we need to inform CMake that we want static linkage,
and where L.lib is located. What is the best way to
do this?

Shall we bypass find_package?
Or shall we provide a location hint to find_package?
Shall we hard-code the library location, or pass
it as a command-line argument?





smime.p7s
Description: S/MIME Cryptographic Signature
-- 

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 debug CPack creation

2018-10-20 Thread Илья Шипицин
сб, 20 окт. 2018 г. в 18:31, Eric Noulard :

>
>> And the content is:
>> $ rpm -qpl softether-vpnserver-5.1.9660-1.x86_64.rpm
>> /lib
>> /lib/systemd
>> /lib/systemd/system
>> /lib/systemd/system/softether-vpnserver.service
>> /usr/libexec
>> /usr/libexec/softether
>> /usr/libexec/softether/vpnserver
>> /usr/libexec/softether/vpnserver/hamcore.se2
>> /usr/libexec/softether/vpnserver/vpnserver
>> /usr/local
>> /usr/local/bin
>> /usr/local/bin/vpnserver
>>
>> the content of the .deb is similar:
>> $ dpkg-deb -c softether-vpnserver_5.1.9660_amd64.deb
>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/
>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/systemd/
>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/systemd/system/
>> -rw-r--r-- root/root   700 2018-10-20 14:45
>> ./lib/systemd/system/softether-vpnserver.service
>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/
>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/libexec/
>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/libexec/softether/
>> drwxr-xr-x root/root 0 2018-10-20 14:45
>> ./usr/libexec/softether/vpnserver/
>> -rw-r--r-- root/root   1770716 2018-10-20 14:45
>> ./usr/libexec/softether/vpnserver/hamcore.se2
>> -rwxr-xr-x root/root   2088960 2018-10-20 14:45
>> ./usr/libexec/softether/vpnserver/vpnserver
>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/local/
>> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/local/bin/
>> -rwxr-xr-x root/root72 2018-10-20 14:45 ./usr/local/bin/vpnserver
>>
>> The main question is, what filesystem layout do you expect for those
>> files?
>>
>>
> Now I think I get it.
> IN vpnserver CMakeLists.txt you do:
>
> install_systemd_service("vpnserver"
> "${CMAKE_SOURCE_DIR}/systemd/softether-vpnserver.service"
> "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver")
>
> So at this point (during CMake config step)
> "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver"
> is /usr/local/softether/vpnserver/vpnserver
>
> In your install_systemd_service CMake macro wrapper you do:
>
> macro(install_systemd_service component file_path binary_path)
> get_filename_component(file_name ${file_path} NAME)
> get_filename_component(binary_directory ${binary_path} DIRECTORY)
>
> file(READ ${file_path} FILE_CONTENT)
> string(REPLACE "[DIRECTORY]" ${binary_directory} FILE_CONTENT
> ${FILE_CONTENT})
> string(REPLACE "[BINARY]" ${binary_path} FILE_CONTENT ${FILE_CONTENT})
> file(WRITE ${CMAKE_SOURCE_DIR}/tmp/systemd/${file_name}
> ${FILE_CONTENT})
> ...
>
> So you generate a systemd service file which contains /usr/local prefix
> because this is the one which
> is know during "CMake configuration step".
>
> You cannot do that this way with .deb or .rpm because you don't know the
> "actual" prefix that will be in the package
> because it is controlby CPACK_PACKAGING_INSTALL_PREFIX  "at CPack time",
> i.e. when CPack runs.
>
> It's even worse because .deb or .rpm may be relocated see e.g.:
>
> https://www.cyberciti.biz/faq/howto-install-rpm-package-into-another-directory/
>
> When you want to install script that should know where things get
> installed you have 3 options:
>
> 1) Assume the binary executable is installed in the path
> thus call the executable as-is "vpnserver" without absolute path
>
> 2) Put a pre- or post- install script that will compute the appropriate
> path
>**during package installation** when you are sure what the real path
> will be.
>Have a look at CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA in
> https://cmake.org/cmake/help/latest/cpack_gen/deb.html
> or
> https://cmake.org/cmake/help/latest/cpack_gen/rpm.html#variable:CPACK_RPM_SPEC_MORE_DEFINE
>
> 3) Ensure that you generate package with
>CMAKE_INSTALL_PREFIX == CPACK_PACKAGING_INSTALL_PREFIX
>This is ok but will break if the installation of the package is
> relocated.
>

this is good.
is there a way to install shared libs to system location ? (in order to
avoid ld manipulation)



>
> 1) may be ok.
> 2) need a little work but is the more robust
> 3) may be enough but prevent relocatable install
>
> --
> 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] find_package Config vs Module mode

2018-10-20 Thread Johannes Zarl-Zierl
Hi Joachim,

Am Samstag, 20. Oktober 2018, 13:22:04 CEST schrieb Joachim Wuttke:
> If Config mode is the newer, preferred way to find a package, I would expect
> find_package to first try Config mode, and only fall back to Module mode if
> no config scripts can be found. However, according to the find_package doc
> page, it is just the other way round.
> 
> Why?

The reason as far as I understand it is that you, as the consumer of a 
library, might want to customize the find_package process. Since find_package 
modules are usually shipped by your own code[1], it's not a problem that the 
module eclipses the config package.

> How to enforce that new config scripts are used if there are still FindXXX
> modules around?

First of all, purge the FindXXX modules from your own code base if you don't 
use them.
Otherwise, append the "CONFIG" keyword to the find_package call as described 
in the docs[2].

If you want to keep the FindXXX module around for compatibility with older 
versions of a library, then an even better solution is to fix your FindXXX 
module to call find_package(...CONFIG) and skip the search if a config file is 
found.

Cheers,
  Johannes



[1] apart from the modules shipped with cmake
[2] 
https://cmake.org/cmake/help/latest/command/find_package.html#full-signature-and-config-mode


-- 

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 debug CPack creation

2018-10-20 Thread Eric Noulard
>
>
> And the content is:
> $ rpm -qpl softether-vpnserver-5.1.9660-1.x86_64.rpm
> /lib
> /lib/systemd
> /lib/systemd/system
> /lib/systemd/system/softether-vpnserver.service
> /usr/libexec
> /usr/libexec/softether
> /usr/libexec/softether/vpnserver
> /usr/libexec/softether/vpnserver/hamcore.se2
> /usr/libexec/softether/vpnserver/vpnserver
> /usr/local
> /usr/local/bin
> /usr/local/bin/vpnserver
>
> the content of the .deb is similar:
> $ dpkg-deb -c softether-vpnserver_5.1.9660_amd64.deb
> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/
> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/systemd/
> drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/systemd/system/
> -rw-r--r-- root/root   700 2018-10-20 14:45
> ./lib/systemd/system/softether-vpnserver.service
> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/
> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/libexec/
> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/libexec/softether/
> drwxr-xr-x root/root 0 2018-10-20 14:45
> ./usr/libexec/softether/vpnserver/
> -rw-r--r-- root/root   1770716 2018-10-20 14:45
> ./usr/libexec/softether/vpnserver/hamcore.se2
> -rwxr-xr-x root/root   2088960 2018-10-20 14:45
> ./usr/libexec/softether/vpnserver/vpnserver
> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/local/
> drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/local/bin/
> -rwxr-xr-x root/root72 2018-10-20 14:45 ./usr/local/bin/vpnserver
>
> The main question is, what filesystem layout do you expect for those files?
>
>
Now I think I get it.
IN vpnserver CMakeLists.txt you do:

install_systemd_service("vpnserver"
"${CMAKE_SOURCE_DIR}/systemd/softether-vpnserver.service"
"${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver")

So at this point (during CMake config step)
"${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver"
is /usr/local/softether/vpnserver/vpnserver

In your install_systemd_service CMake macro wrapper you do:

macro(install_systemd_service component file_path binary_path)
get_filename_component(file_name ${file_path} NAME)
get_filename_component(binary_directory ${binary_path} DIRECTORY)

file(READ ${file_path} FILE_CONTENT)
string(REPLACE "[DIRECTORY]" ${binary_directory} FILE_CONTENT
${FILE_CONTENT})
string(REPLACE "[BINARY]" ${binary_path} FILE_CONTENT ${FILE_CONTENT})
file(WRITE ${CMAKE_SOURCE_DIR}/tmp/systemd/${file_name} ${FILE_CONTENT})
...

So you generate a systemd service file which contains /usr/local prefix
because this is the one which
is know during "CMake configuration step".

You cannot do that this way with .deb or .rpm because you don't know the
"actual" prefix that will be in the package
because it is controlby CPACK_PACKAGING_INSTALL_PREFIX  "at CPack time",
i.e. when CPack runs.

It's even worse because .deb or .rpm may be relocated see e.g.:
https://www.cyberciti.biz/faq/howto-install-rpm-package-into-another-directory/

When you want to install script that should know where things get installed
you have 3 options:

1) Assume the binary executable is installed in the path
thus call the executable as-is "vpnserver" without absolute path

2) Put a pre- or post- install script that will compute the appropriate
path
   **during package installation** when you are sure what the real path
will be.
   Have a look at CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA in
https://cmake.org/cmake/help/latest/cpack_gen/deb.html
or
https://cmake.org/cmake/help/latest/cpack_gen/rpm.html#variable:CPACK_RPM_SPEC_MORE_DEFINE

3) Ensure that you generate package with
   CMAKE_INSTALL_PREFIX == CPACK_PACKAGING_INSTALL_PREFIX
   This is ok but will break if the installation of the package is
relocated.

1) may be ok.
2) need a little work but is the more robust
3) may be enough but prevent relocatable install

-- 
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 debug CPack creation

2018-10-20 Thread Eric Noulard
Le sam. 20 oct. 2018 à 10:54, Илья Шипицин  a écrit :

>
>
> сб, 20 окт. 2018 г. в 13:30, Eric Noulard :
>
>>
>>
>> Le sam. 20 oct. 2018 à 10:15, Илья Шипицин  a
>> écrit :
>>
>>> hi,
>>>
>>> we use cmake/cpack for mangling systemd scripts
>>>
>>>
>>> https://github.com/SoftEtherVPN/SoftEtherVPN/blob/master/src/vpnserver/CMakeLists.txt#L26
>>>
>>> what happens:
>>>
>>> (*) deb installs files to /usr/libexec
>>> (*) cmake sets location as /usr/local/libexec
>>>
>>
>> It looks like your get default "/usr/local" prefix from somewhere.
>>
>
> exactly.
>

So I I understand it well (correct me if I'm wrong) when you do:

1) make install
You get all installed files prefixed by /usr/local
which is the expected behaviour unless you configure
CMAKE_INSTALL_PREFIX
or you use
DESTDIR=/your/prefix make install

2) deb created by CPack get "/usr" prefix instead
   which is the expected behaviour unless you specify an alternate value
using
   CPACK_PACKAGING_INSTALL_PREFIX

go to your build tree and try:
cpack -G DEB -D  CPACK_PACKAGING_INSTALL_PREFIX=/opt

and you'll see that the .deb will have /opt prefix.

The question is what do expect as a prefix?
/usr/local
/usr
something else ??

The rules are the following when using install rule.
1) if your DESTINATION is a relative path then it will be prefix with
   CMAKE_INSTALL_PREFIX when doing make install
   CPACK_PACKAGING_INSTALL_PREFIX when building package with CPack

2) if your DESTINATION is "absolute" like /etc/whatever/confdir
It'll get install there when doing make install (whatever the value of
CMAKE_INSTALL_PREFIX)

With CPack, it depends on the generator.
   Some generators (like DEB a,nd RPM) try to catch "absolute" install file
and handle them
   as config file. RPM generator is more verbose about it see below.

Is the RPM containing what you expect?
>>
>
> I did not check it yet.
>

I tried using:
$  cpack -G RPM

and you get expected warning about the mix of absolute and relative install
path:
CPack: Create package using RPM
CPack: Install projects
CPack: - Install project: SoftEtherVPN
CPack: -   Install component: vpnserver
CPack: -   Install component: vpnclient
CPack: -   Install component: vpnbridge
CPack: -   Install component: vpncmd
CPack: Create package
CMake Warning (dev) at
/home/enoulard/local/share/cmake-3.12/Modules/Internal/CPack/CPackRPM.cmake:135
(message):
  CPackRPM:Warning: Path /lib/systemd/system/softether-vpnbridge.service is
  not on one of the relocatable paths! Package will be partially
relocatable.
Call Stack (most recent call first):

/home/enoulard/local/share/cmake-3.12/Modules/Internal/CPack/CPackRPM.cmake:1001
(cpack_rpm_prepare_relocation_paths)

/home/enoulard/local/share/cmake-3.12/Modules/Internal/CPack/CPackRPM.cmake:1870
(cpack_rpm_generate_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

[...]

CPack: - package: []/build/softether-vpnbridge-5.1.9660-1.x86_64.rpm
generated.
CPack: - package: []/build/softether-vpnclient-5.1.9660-1.x86_64.rpm
generated.
CPack: - package: []/build/softether-vpncmd-5.1.9660-1.x86_64.rpm generated.
CPack: - package: []/build/softether-vpnserver-5.1.9660-1.x86_64.rpm
generated.

And the content is:
$ rpm -qpl softether-vpnserver-5.1.9660-1.x86_64.rpm
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/softether-vpnserver.service
/usr/libexec
/usr/libexec/softether
/usr/libexec/softether/vpnserver
/usr/libexec/softether/vpnserver/hamcore.se2
/usr/libexec/softether/vpnserver/vpnserver
/usr/local
/usr/local/bin
/usr/local/bin/vpnserver

the content of the .deb is similar:
$ dpkg-deb -c softether-vpnserver_5.1.9660_amd64.deb
drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/
drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/systemd/
drwxr-xr-x root/root 0 2018-10-20 14:45 ./lib/systemd/system/
-rw-r--r-- root/root   700 2018-10-20 14:45
./lib/systemd/system/softether-vpnserver.service
drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/
drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/libexec/
drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/libexec/softether/
drwxr-xr-x root/root 0 2018-10-20 14:45
./usr/libexec/softether/vpnserver/
-rw-r--r-- root/root   1770716 2018-10-20 14:45
./usr/libexec/softether/vpnserver/hamcore.se2
-rwxr-xr-x root/root   2088960 2018-10-20 14:45
./usr/libexec/softether/vpnserver/vpnserver
drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/local/
drwxr-xr-x root/root 0 2018-10-20 14:45 ./usr/local/bin/
-rwxr-xr-x root/root72 2018-10-20 14:45 ./usr/local/bin/vpnserver

The main question is, what filesystem layout do you expect for those files?

-- 
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: 

[CMake] find_package Config vs Module mode

2018-10-20 Thread Joachim Wuttke

Somewhere we are advised that Module mode should be phased out in favor of 
Config mode.

If Config mode is the newer, preferred way to find a package, I would expect
find_package to first try Config mode, and only fall back to Module mode if
no config scripts can be found. However, according to the find_package doc page,
it is just the other way round.

Why?

How to enforce that new config scripts are used if there are still FindXXX
modules around?



smime.p7s
Description: S/MIME Cryptographic Signature
-- 

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] Using CMake with Visual Studio 2017 on Windows

2018-10-20 Thread Osman Zakir
Hi.

I recently tried to build the Jinja2Cpp library on Windows 10 with Visual 
Studio 2017.  I had managed to do this successfully before, but when I tried it 
again this time after deleting the `Jinja2Cpp` directory and cloning from the 
GitHub repo again, I had errors in CMake and couldn't generate files correctly.

I've attached three files to this email.  One is a text file I made myself by 
copy-pasting the output I got from my CMake build attempt.  The other two are 
the log files mentioned in said output.

Note: The command I had used was "cmake .. -DCMAKE_INSTALL_PREFIX=../install".

I opened an issue for this at the Jinja2Cpp GitHub repo as well; here: 
https://github.com/flexferrum/Jinja2Cpp/issues/75 .  I want to try to edit the 
CMakeLists.txt file to use Clang instead if I can't get it to work with Visual 
Studio, but for now I want to try getting it to work with Visual Studio.
[https://avatars0.githubusercontent.com/u/18173932?s=400=4]

Can't Build Jinja2Cpp on Windows with Visual Studio 2017 Anymore · Issue #75 · 
flexferrum/Jinja2Cpp
Just now, just to check, I tried to build the library on Windows again by 
cloning fresh into Jinja2Cpp, updating the submodule, and then running cmake 
-DCMAKE_INSTALL_PREFIX=../install and got this...
github.com


C:\Jinja2Cpp\build>cmake .. -DCMAKE_INSTALL_PREFIX=../install
-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.15.26730.0
-- The CXX compiler identification is MSVC 19.15.26730.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual 
Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual 
Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- broken
CMake Error at C:/Program Files 
(x86)/CMake/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

"C:/Program Files (x86)/Microsoft Visual 
Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

Change Dir: C:/Jinja2Cpp/build/CMakeFiles/CMakeTmp

Run Build Command:"C:/Program Files (x86)/Microsoft Visual 
Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe" "cmTC_f8e1b.vcxproj" 
"/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 10/18/2018 1:51:09 AM.
Project "C:\Jinja2Cpp\build\CMakeFiles\CMakeTmp\cmTC_f8e1b.vcxproj" on node 
1 (default targets).
PrepareForBuild:
  Creating directory "cmTC_f8e1b.dir\Debug\".
  Creating directory "C:\Jinja2Cpp\build\CMakeFiles\CMakeTmp\Debug\".
  Creating directory "cmTC_f8e1b.dir\Debug\cmTC_f8e1b.tlog\".
InitializeBuildStatus:
  Creating "cmTC_f8e1b.dir\Debug\cmTC_f8e1b.tlog\unsuccessfulbuild" because 
"AlwaysCreate" was specified.
VcpkgTripletSelection:
  Using triplet "x86-windows" from "C:\vcpkg\installed\x86-windows\"
ClCompile:
  C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\CL.exe /c 
/I"C:\Program Files (x86)\Visual Leak Detector\include" 
/I"C:\vcpkg\installed\x86-windows\include" /Zi /W3 /WX- /diagnostics:classic 
/Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- 
/RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline 
/Fo"cmTC_f8e1b.dir\Debug\\" /Fd"cmTC_f8e1b.dir\Debug\vc141.pdb" /Gd /TC 
/analyze- /FC /errorReport:queue 
C:\Jinja2Cpp\build\CMakeFiles\CMakeTmp\testCCompiler.c
  Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26730 for x86
  Copyright (C) Microsoft Corporation.  All rights reserved.

  cl /c /I"C:\Program Files (x86)\Visual Leak Detector\include" 
/I"C:\vcpkg\installed\x86-windows\include" /Zi /W3 /WX- /diagnostics:classic 
/Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- 
/RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline 
/Fo"cmTC_f8e1b.dir\Debug\\" /Fd"cmTC_f8e1b.dir\Debug\vc141.pdb" /Gd /TC 
/analyze- /FC /errorReport:queue 
C:\Jinja2Cpp\build\CMakeFiles\CMakeTmp\testCCompiler.c
  testCCompiler.c

Link:
  C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\link.exe 
/ERRORREPORT:QUEUE 
/OUT:"C:\Jinja2Cpp\build\CMakeFiles\CMakeTmp\Debug\cmTC_f8e1b.exe" /INCREMENTAL 
/NOLOGO /LIBPATH:"C:\Program Files (x86)\Visual Leak Detector\lib\Win32" 
/LIBPATH:"C:\vcpkg\installed\x86-windows\debug\lib" 
/LIBPATH:"C:\vcpkg\installed\x86-windows\debug\lib\manual-link" kernel32.lib 
user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
comdlg32.lib advapi32.lib "C:\vcpkg\installed\x86-windows\debug\lib\*.lib" 

Re: [CMake] how to debug CPack creation

2018-10-20 Thread Илья Шипицин
just in case, I tried 3.12.3
the same issue

сб, 20 окт. 2018 г. в 13:53, Илья Шипицин :

>
>
> сб, 20 окт. 2018 г. в 13:30, Eric Noulard :
>
>>
>>
>> Le sam. 20 oct. 2018 à 10:15, Илья Шипицин  a
>> écrit :
>>
>>> hi,
>>>
>>> we use cmake/cpack for mangling systemd scripts
>>>
>>>
>>> https://github.com/SoftEtherVPN/SoftEtherVPN/blob/master/src/vpnserver/CMakeLists.txt#L26
>>>
>>> what happens:
>>>
>>> (*) deb installs files to /usr/libexec
>>> (*) cmake sets location as /usr/local/libexec
>>>
>>
>> It looks like your get default "/usr/local" prefix from somewhere.
>>
>
> exactly.
>
>
>> The installation prefix of CPack is controlled by the
>> https://cmake.org/cmake/help/latest/variable/CPACK_PACKAGING_INSTALL_PREFIX.html
>> variable.
>> Each CPack generator has a default value for that (if you don't specify
>> it).
>>
>> How do run cpack?
>> Do you do "make package" or do you run
>>
>
> I run:
>
> ./configure
> make -C tmp package
>
>
>> cpack -G DEB
>>
>> Which version of cmake/cpack are you using?
>>
>
> 3.9.6
>
>
>>
>>
>>> as a result: it does not work (systemd cannot find executable)
>>>
>>> https://gitlab.com/chipitsine/SoftEtherVPN/-/jobs/110262386
>>>
>>> I enabled "set(CPACK_DEBIAN_PACKAGE_DEBUG ON)", but it did not provide
>>> me a clue.
>>>
>>
>> DEB generator is not as verbose as I thought.
>>
>> Do you generate RPM as well? RPM is more verbose and leaves you log file
>> in
>> _CPack_Packages//RPM/
>>
>> Is the RPM containing what you expect?
>>
>
>
> I did not check it yet.
>
>
>>
>> --
>> 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 debug CPack creation

2018-10-20 Thread Илья Шипицин
сб, 20 окт. 2018 г. в 13:30, Eric Noulard :

>
>
> Le sam. 20 oct. 2018 à 10:15, Илья Шипицин  a
> écrit :
>
>> hi,
>>
>> we use cmake/cpack for mangling systemd scripts
>>
>>
>> https://github.com/SoftEtherVPN/SoftEtherVPN/blob/master/src/vpnserver/CMakeLists.txt#L26
>>
>> what happens:
>>
>> (*) deb installs files to /usr/libexec
>> (*) cmake sets location as /usr/local/libexec
>>
>
> It looks like your get default "/usr/local" prefix from somewhere.
>

exactly.


> The installation prefix of CPack is controlled by the
> https://cmake.org/cmake/help/latest/variable/CPACK_PACKAGING_INSTALL_PREFIX.html
> variable.
> Each CPack generator has a default value for that (if you don't specify
> it).
>
> How do run cpack?
> Do you do "make package" or do you run
>

I run:

./configure
make -C tmp package


> cpack -G DEB
>
> Which version of cmake/cpack are you using?
>

3.9.6


>
>
>> as a result: it does not work (systemd cannot find executable)
>>
>> https://gitlab.com/chipitsine/SoftEtherVPN/-/jobs/110262386
>>
>> I enabled "set(CPACK_DEBIAN_PACKAGE_DEBUG ON)", but it did not provide me
>> a clue.
>>
>
> DEB generator is not as verbose as I thought.
>
> Do you generate RPM as well? RPM is more verbose and leaves you log file
> in
> _CPack_Packages//RPM/
>
> Is the RPM containing what you expect?
>


I did not check it yet.


>
> --
> 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 debug CPack creation

2018-10-20 Thread Eric Noulard
Le sam. 20 oct. 2018 à 10:15, Илья Шипицин  a écrit :

> hi,
>
> we use cmake/cpack for mangling systemd scripts
>
>
> https://github.com/SoftEtherVPN/SoftEtherVPN/blob/master/src/vpnserver/CMakeLists.txt#L26
>
> what happens:
>
> (*) deb installs files to /usr/libexec
> (*) cmake sets location as /usr/local/libexec
>

It looks like your get default "/usr/local" prefix from somewhere.
The installation prefix of CPack is controlled by the
https://cmake.org/cmake/help/latest/variable/CPACK_PACKAGING_INSTALL_PREFIX.html
variable.
Each CPack generator has a default value for that (if you don't specify it).

How do run cpack?
Do you do "make package" or do you run
cpack -G DEB

Which version of cmake/cpack are you using?


> as a result: it does not work (systemd cannot find executable)
>
> https://gitlab.com/chipitsine/SoftEtherVPN/-/jobs/110262386
>
> I enabled "set(CPACK_DEBIAN_PACKAGE_DEBUG ON)", but it did not provide me
> a clue.
>

DEB generator is not as verbose as I thought.

Do you generate RPM as well? RPM is more verbose and leaves you log file in
_CPack_Packages//RPM/

Is the RPM containing what you expect?

-- 
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


[CMake] how to debug CPack creation

2018-10-20 Thread Илья Шипицин
hi,

we use cmake/cpack for mangling systemd scripts

https://github.com/SoftEtherVPN/SoftEtherVPN/blob/master/src/vpnserver/CMakeLists.txt#L26

what happens:

(*) deb installs files to /usr/libexec
(*) cmake sets location as /usr/local/libexec

as a result: it does not work (systemd cannot find executable)

https://gitlab.com/chipitsine/SoftEtherVPN/-/jobs/110262386

I enabled "set(CPACK_DEBIAN_PACKAGE_DEBUG ON)", but it did not provide me a
clue.


any idea how to debug that?

CPackDeb Debug: Found dependency: libc6 (>= 2.15), libreadline7 (>= 6.0),
libssl1.1 (>= 1.1.0), zlib1g (>= 1:1.1.4) from output shlibs:Depends=libc6
(>= 2.15), libreadline7 (>= 6.0), libssl1.1 (>= 1.1.0), zlib1g (>= 1:1.1.4)
CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY  =
'/home/ilia/softethervpn/build/_CPack_Packages/Linux/DEB'
CPackDeb:Debug: CPACK_TOPLEVEL_TAG= 'Linux'
CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY =
'/home/ilia/softethervpn/build/_CPack_Packages/Linux/DEB/softether-5.1.9660-Linux/vpnserver'
CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME=
'softether-vpnserver_5.1.9660-1_amd64.deb'
CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH=
'/home/ilia/softethervpn/build/softether-vpnserver_5.1.9660-1_amd64.deb'
CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME   =
'softether-5.1.9660-Linux'
CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = 'softether 5.1.9660'
CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME =
'/home/ilia/softethervpn/build/_CPack_Packages/Linux/DEB/softether-vpnserver_5.1.9660-1_amd64.deb'
CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION = ''
CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_SOURCE   = ''
CPack: - package:
/home/ilia/softethervpn/build/softether-vpnbridge_5.1.9660-1_amd64.deb
generated.
CPack: - package:
/home/ilia/softethervpn/build/softether-vpnclient_5.1.9660-1_amd64.deb
generated.
CPack: - package:
/home/ilia/softethervpn/build/softether-vpncmd_5.1.9660-1_amd64.deb
generated.
CPack: - package:
/home/ilia/softethervpn/build/softether-vpnserver_5.1.9660-1_amd64.deb
generated.
make: Leaving directory '/home/ilia/softethervpn/tmp'
-- 

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