[CMake] Cannot set ASM_MASM flags?

2018-11-21 Thread Tiago Macarios
I am trying to set a flag for the Microsoft assembler, but no luck. Dummy
repro below.
I tried setting target_compile_options, but that seems not to work. Then I
tried setting CMAKE_ASM_MASM_FLAGS, but that does not seem to work either.

It seems like I am hitting this issue:
https://gitlab.kitware.com/cmake/cmake/issues/14711

Which was already discussed here:
https://cmake.org/pipermail/cmake/2014-August/058422.html

If indeed this is a CMake problem. Maybe someone knows of a work around?

CMakeLists:
cmake_minimum_required(VERSION 3.11)
enable_language(ASM_MASM)
project(AsmTest)

set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /Sg" PARENT_SCOPE)

add_executable(AsmTest AsmTestFunc.asm)
#target_compile_options(AsmTest PRIVATE /Sg)
target_link_options(AsmTest PRIVATE /SAFESEH:NO)
target_link_libraries(AsmTest kernel32.lib)

File:
.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
.code
main PROC
INVOKE ExitProcess,0
main ENDP
END main
-- 

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, master, updated. v3.13.0-508-gf32c0a2

2018-11-21 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  f32c0a2400238e754b630d99fed66f36dd0f7083 (commit)
  from  4e0c75b78f5745d1369867f25a46ab7d158b4469 (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=f32c0a2400238e754b630d99fed66f36dd0f7083
commit f32c0a2400238e754b630d99fed66f36dd0f7083
Author: Kitware Robot 
AuthorDate: Thu Nov 22 00:01:04 2018 -0500
Commit: Kitware Robot 
CommitDate: Thu Nov 22 00:01:04 2018 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 869c6dd..eb62f68 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 20181121)
+set(CMake_VERSION_PATCH 20181122)
 #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 is ARGN passed to a macro

2018-11-21 Thread Torsten Robitzki
Hi Andreas,

> Am 21.11.2018 um 20:18 schrieb Andreas Naumann :
> 
> I think the behavior is explained in [1] and [2]. In particular the second 
> section of [2] states that the parameter " [...] such as ARGN are not 
> variables in the usual CMake sense. They are string replacements [...]".  And 
> the example at the end of [2] seems to match your test perfectly.

yes, but what puzzles me, is that I can’t print ${ARGN} in the macro (but in 
the function) but I can loop over it. That seems to be somehow strange to me.

Anyhow, thanks a lot and as long as this behavior is defined and (most likely) 
stays this way, I can work with it :-)

regards,

Torsten



signature.asc
Description: Message signed with OpenPGP
-- 

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 is ARGN passed to a macro

2018-11-21 Thread Andreas Naumann

Hey Torsten,

Am 21.11.18 um 13:15 schrieb Torsten Robitzki:

Hi,
I’ve stumbled over following behavior and now I’m searching for the rules, that 
explains that behavior:

test.cmake:

   macro(check_argn)
 message("in macro check_argn ARGN: ${ARGN}")

 if(ARGN)
   foreach(item IN LISTS ARGN)
 message("ARG: ${item}")
   endforeach(item)
   message("ARGN: ${ARGN}")
 endif()
   endmacro()

   function(f1 a)
 message("in function ARGN: ${ARGN}")
 check_argn()
   endfunction()

   f1(1)
   f1(1 2)

This will yield the following output:

   $ cmake -P ./test.cmake
   in function ARGN:
   in macro check_argn ARGN:
   in function ARGN: 2
   in macro check_argn ARGN:
   ARG: 2
   ARGN:

I would expect ARGN to behave exactly the same in the macro, as in the 
function, but apparently there is a difference. Can someone of you explain that 
to me?


I think the behavior is explained in [1] and [2]. In particular the 
second section of [2] states that the parameter " [...] such as ARGN are 
not variables in the usual CMake sense. They are string replacements 
[...]".  And the example at the end of [2] seems to match your test 
perfectly.


Hope that helps a bit,
Andreas

[1] https://cmake.org/cmake/help/latest/command/function.html

[2] https://cmake.org/cmake/help/latest/command/macro.html



TIA and kind regards,

Torsten



--

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, master, updated. v3.13.0-507-g4e0c75b

2018-11-21 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  4e0c75b78f5745d1369867f25a46ab7d158b4469 (commit)
   via  2b427c2fadc917ebcaf2f246d53504ce5b6ad754 (commit)
   via  74cc42e937e3117e9514f0c1561f212a8867bc92 (commit)
   via  8b83d1fdffeab9d24946552a9b8252c2e0dc4570 (commit)
   via  3d48c5404cde1ca5f9956d9587f7d5b134a696eb (commit)
   via  a586b60129bb29ad99107164439b38f4de60f599 (commit)
   via  6962a41e6b83e1ead36ab26b06ebe81aeee0087a (commit)
   via  5bc64fe6c25f3c02dda7d22eb65c07bdf2e6eb46 (commit)
   via  8068850fcc1575210c968365e71cb7ece6771022 (commit)
   via  ead16adfc8dc387a59057717521976cbe7ae9067 (commit)
   via  19d92d5e6e79448337aface8ed40df78240d674b (commit)
   via  186f69cf26b02ec4e2583c846ab3f2d4211997b7 (commit)
   via  5731ec30f0596fefede4321e9883043aa7db60ba (commit)
  from  3804122ab2793b9d54aa8c69df62ed86f526d50f (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=4e0c75b78f5745d1369867f25a46ab7d158b4469
commit 4e0c75b78f5745d1369867f25a46ab7d158b4469
Merge: 2b427c2 5731ec3
Author: Brad King 
AuthorDate: Wed Nov 21 12:42:26 2018 +
Commit: Kitware Robot 
CommitDate: Wed Nov 21 07:42:32 2018 -0500

Merge topic 'clang-tidy'

5731ec30f0 clang-tidy: fix warnings from version 7

Acked-by: Kitware Robot 
Merge-request: !2636


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b427c2fadc917ebcaf2f246d53504ce5b6ad754
commit 2b427c2fadc917ebcaf2f246d53504ce5b6ad754
Merge: 8b83d1f 74cc42e
Author: Brad King 
AuthorDate: Wed Nov 21 12:41:21 2018 +
Commit: Kitware Robot 
CommitDate: Wed Nov 21 07:41:27 2018 -0500

Merge topic 'FindGIF-modernize'

74cc42e937 Help: Add notes for topic 'FindGIF-modernize'
6962a41e6b FindGIF: Add test
5bc64fe6c2 FindGIF: Modernize

Acked-by: Kitware Robot 
Merge-request: !2632


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74cc42e937e3117e9514f0c1561f212a8867bc92
commit 74cc42e937e3117e9514f0c1561f212a8867bc92
Author: Brad King 
AuthorDate: Wed Nov 21 07:39:58 2018 -0500
Commit: Brad King 
CommitDate: Wed Nov 21 07:39:58 2018 -0500

Help: Add notes for topic 'FindGIF-modernize'

diff --git a/Help/release/dev/FindGIF-modernize.rst 
b/Help/release/dev/FindGIF-modernize.rst
new file mode 100644
index 000..3bb4821
--- /dev/null
+++ b/Help/release/dev/FindGIF-modernize.rst
@@ -0,0 +1,4 @@
+FindGIF-modernize
+-
+
+* The :module:`FindGIF` module now provides imported targets.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b83d1fdffeab9d24946552a9b8252c2e0dc4570
commit 8b83d1fdffeab9d24946552a9b8252c2e0dc4570
Merge: 3d48c54 19d92d5
Author: Brad King 
AuthorDate: Wed Nov 21 12:37:04 2018 +
Commit: Kitware Robot 
CommitDate: Wed Nov 21 07:37:11 2018 -0500

Merge topic 'find-boost-test-version'

19d92d5e6e FindBoost: provide the version in x.y.z format
186f69cf26 FindBoost: test version variables

Acked-by: Kitware Robot 
Merge-request: !2638


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d48c5404cde1ca5f9956d9587f7d5b134a696eb
commit 3d48c5404cde1ca5f9956d9587f7d5b134a696eb
Merge: a586b60 8068850
Author: Brad King 
AuthorDate: Wed Nov 21 07:35:52 2018 -0500
Commit: Brad King 
CommitDate: Wed Nov 21 07:35:52 2018 -0500

Merge branch 'release-3.13'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a586b60129bb29ad99107164439b38f4de60f599
commit a586b60129bb29ad99107164439b38f4de60f599
Merge: 3804122 ead16ad
Author: Brad King 
AuthorDate: Wed Nov 21 12:34:42 2018 +
Commit: Kitware Robot 
CommitDate: Wed Nov 21 07:34:53 2018 -0500

Merge topic 'fortran-submodule-case'

ead16adfc8 Fortran: Fix module dependency scanning with upper-case SUBMODULE

Acked-by: Kitware Robot 
Merge-request: !2644


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6962a41e6b83e1ead36ab26b06ebe81aeee0087a
commit 6962a41e6b83e1ead36ab26b06ebe81aeee0087a
Author: Maximilian Heinzler 
AuthorDate: Tue Nov 20 21:03:19 2018 +0100
Commit: Maximilian Heinzler 
CommitDate: Tue Nov 20 21:07:03 2018 +0100

FindGIF: Add test

This tests whether GIFLIB can be found and the linker works. For newer
versions (>=5) it also tests if the version was parsed correctly.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 96cdfd0..8b5f2e9 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1388,6 +1388,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P 
${CMake_SOURCE_DIR}/Utilities/Release
 

[Cmake-commits] CMake branch, release, updated. v3.13.0-2-g8068850

2018-11-21 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  8068850fcc1575210c968365e71cb7ece6771022 (commit)
   via  ead16adfc8dc387a59057717521976cbe7ae9067 (commit)
  from  05a2ca7f87b9ae73f373e9967fde1ee5210e33af (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:
 Source/LexerParser/cmFortranLexer.cxx | 226 +++---
 Source/LexerParser/cmFortranLexer.in.l|   2 +-
 Tests/FortranModules/Submodules/child.f90 |   6 +-
 3 files changed, 117 insertions(+), 117 deletions(-)


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


[CMake] How is ARGN passed to a macro

2018-11-21 Thread Torsten Robitzki
Hi,
I’ve stumbled over following behavior and now I’m searching for the rules, that 
explains that behavior:

test.cmake:

  macro(check_argn)
message("in macro check_argn ARGN: ${ARGN}")

if(ARGN)
  foreach(item IN LISTS ARGN)
message("ARG: ${item}")
  endforeach(item)
  message("ARGN: ${ARGN}")
endif()
  endmacro()

  function(f1 a)
message("in function ARGN: ${ARGN}")
check_argn()
  endfunction()

  f1(1)
  f1(1 2)

This will yield the following output:

  $ cmake -P ./test.cmake 
  in function ARGN: 
  in macro check_argn ARGN: 
  in function ARGN: 2
  in macro check_argn ARGN: 
  ARG: 2
  ARGN: 

I would expect ARGN to behave exactly the same in the macro, as in the 
function, but apparently there is a difference. Can someone of you explain that 
to me?

TIA and kind regards,

Torsten
-- 

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 find GTK3 in CMake

2018-11-21 Thread Harry Mallon
Hi again,

Thanks David and Eric. I have actually used cmake’s pkgconfig integration to 
support this library. As you say (about it not being very portable) I only 
needed it on Linux so pkgconfig is a reasonable thing to use.

Thanks,
Harry


Harry Mallon

Senior Software Engineer

[http://codex.online/?action=asset=E3D62C3D-A12C-447D-87A5-F36E7C2AA9A4]

T +44 203 7000 989

60 Poland Street | London | England | W1F 7NT

[http://admin.codex.online/?action=asset=132CD8A9-76B5-48B4-80D3-F5E5C57FB76E]
A Star is Born  Halloween   13 Reasons Why


-- 

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 find GTK3 in CMake

2018-11-21 Thread Jan Wielemaker
On 21/11/2018 09:46, David Demelier wrote:
> The philosophy behind CMake is to let upstream projects provides their
> own CMake configuration packages rather than providing Find modules for
> every single library existing in the world.
>
> CMake should already not provide any of these, but this general
> recommendation came after.
>
> It's the same thing for pkg-config, pkg-config by itself does not
> provide any .pc file.

Good. I was already considering providing a cmake file after migrating
SWI-Prolog to cmake. Are there good guidelines for this? Pkg-config asks
for providing a .pc file and installing in a well-known place. Is there
a similar place for project cmake `find' files or some other convention
to make them available to users?

While porting SWI-Prolog I typically searched for FindXYZ and when in
the CMake dir, I just included this (always?) without trouble. If not I
searched the web and copied one. Most came from other projects also
trying to use the target library. It is not uncommon to find several
files, some copies, some good, some bad (outdated ways to find stuff,
local installation specific, poor cross-platform support, etc). This
wasn't the best part of the experience and I ended up (re-)writing
several Find* from scratch while still being an inexperienced CMake
user (so most are not good either) :(

This is similar autoconf, where the bundled tests are typically high
quality and the repositories and other projects locally provided tests
are often not.

Still a happy cmake user :)

Cheers --- Jan
-- 

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 find GTK3 in CMake

2018-11-21 Thread David Demelier

Le 21/11/2018 à 10:19, Jan Wielemaker a écrit :

Good. I was already considering providing a cmake file after migrating
SWI-Prolog to cmake. Are there good guidelines for this? Pkg-config asks
for providing a .pc file and installing in a well-known place. Is there
a similar place for project cmake `find' files or some other convention
to make them available to users?


Yes, it requires a little bit of boilerplate as CMake is a bit more 
extensive than pkg-config.


https://cmake.org/cmake/help/v3.12/manual/cmake-packages.7.html#creating-packages

Note: lot of things are optional, this guide shows everything you can do 
with provided package.


But the minimal required is:

1. install(TARGETS yourlibrary EXPORT yourlibrary-targets)
2. install(EXPORT yourlibrary-targets FILE yourlibrary-targets.cmake 
NAMESPACE yourlibrary DESTINATION lib/cmake/yourlibrary)

3. install(FILES yourlibrary-config.cmake DESTINATION lib/cmake/yourlibrary)

And create yourlibrary-config.cmake with

include("${CMAKE_CURRENT_LIST_DIR}/yourlibrary-targets.cmake")

Regards

--
David
--

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 find GTK3 in CMake

2018-11-21 Thread Eric Noulard
Le mer. 21 nov. 2018 à 09:46, David Demelier  a
écrit :

> Le 20/11/2018 à 17:03, Harry Mallon a écrit :
> > Hi,
> >
> > FindGTK and FindGTK2 exist in the CMake tree. How come there isn't one
> for GTK3? Should the GTK2 one work, or is there another way?
>
> GNOME people don't like CMake (they use meson). The philosophy behind
> CMake is to let upstream projects provides their own CMake configuration
> packages rather than providing Find modules for every single library
> existing in the world.
>

Right and the fact is even traced here:
https://gitlab.kitware.com/cmake/cmake/issues/15888



>
> CMake should already not provide any of these, but this general
> recommendation came after.
>
> It's the same thing for pkg-config, pkg-config by itself does not
> provide any .pc file.
>
> Also, Gtk is much more tied to Linux than being portable. I think that's
> why portable software don't use Gtk that much and thus, not CMake either.
>

Some project nevertheless uses GTK3 and CMake so that you may borrow
hopefully working
FindGTK3.cmake module from them:
E.g.
Darktable:
https://redmine.darktable.org/projects/darktable/repository/changes/cmake/modules/FindGTK3.cmake
WebKit:
https://github.com/WebKit/webkit/blob/master/Source/cmake/FindGTK3.cmake

and probably many others.
-- 
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 find GTK3 in CMake

2018-11-21 Thread David Demelier

Le 20/11/2018 à 17:03, Harry Mallon a écrit :

Hi,

FindGTK and FindGTK2 exist in the CMake tree. How come there isn't one for 
GTK3? Should the GTK2 one work, or is there another way?


GNOME people don't like CMake (they use meson). The philosophy behind 
CMake is to let upstream projects provides their own CMake configuration 
packages rather than providing Find modules for every single library 
existing in the world.


CMake should already not provide any of these, but this general 
recommendation came after.


It's the same thing for pkg-config, pkg-config by itself does not 
provide any .pc file.


Also, Gtk is much more tied to Linux than being portable. I think that's 
why portable software don't use Gtk that much and thus, not CMake either.


Regards,

--
David
--

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-developers] ENV{SOURCE_DATE_EPOCH}

2018-11-21 Thread Eric Noulard
Le mar. 20 nov. 2018 à 22:40, Oleh Kravchenko  a écrit :

> 20.11.18 23:29, Brad King wrote:
> > SOURCE_DATE_EPOCH was created for use by packagers where tools
> > already wrap the build.  By making it an environment variable
> > packagers could jump through any number of build system layers
> > with no patching.
>
> That's makes me confused, because CMake has CPack.
> And with CPack process looks like:
> - `cmake && make package`
> So there are no any packagers tools, all work done with CMake.
>

The package tool here is CPack.
You consider CMake and CPack as monolithic software they were not designed
this way (and I personally find it nice to be so).

CMake and CPack (or CTest) may work together but they may well be used
independently.
Moreover they do not run at the same time, have a look at the figure here:
https://github.com/dev-cafe/cmake-cookbook/blob/master/figures/cmake-times/cmake-times.jpg

And you may see that setting environment var at configure time is
relatively far away from packaging time.

All that saif you are right CPack may honor SOURCE_DATE_EPOCH, and CMake
"may" forward the usage
of SOURCE_DATE_EPOCH from configuration time down to CPack time.

At least one CPack generator (the DEB one) recently honor SOURCE_DATE_EPOCH
https://gitlab.kitware.com/cmake/cmake/commit/548ac51d8ea319c65abefa0a771636893c45014c


If you use a
https://cmake.org/cmake/help/v3.12/module/CPack.html#variable:CPACK_PROJECT_CONFIG_FILE
for your project
you may easily set the SOURCE_DATE_EPOCH env var at CPack time, i.e. when
CPack runs.



> > Build systems configure compilers with command-line flags, not
> > environment variables.  If you want to do this from within the
> > build system then GCC could be taught a new option for that.
>

Apparently gcc team decided to use env var for that:
https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html
see associated discussion (I did not read it all):
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02210.html

llvm/clang discussion on this does not seem to be closed:
https://reviews.llvm.org/D23934


> >
> > You could try hacking it with `CMAKE__COMPILER_LAUNCHER`:
> >
> >
> https://cmake.org/cmake/help/v3.13/variable/CMAKE_LANG_COMPILER_LAUNCHER.html
> >
> > e.g. -DCMAKE_C_COMPILER_LAUNCHER='env;SOURCE_DATE_EPOCH=1' or
> >
> > ```cmake
> > set(CMAKE_C_COMPILER_LAUNCHER env SOURCE_DATE_EPOCH=1)
> > ```
>
> Thank you, I will try that.
>

AFAIU this should already work with gcc.

I discovered https://reproducible-builds.org/, while reading your question.
The goal is nice, and I think CMake/CPack should support that for
compiler/[package] build tools that support it.

I won't have time to work on patches for that but I'll certainly take time
to read/test one if someone is working on it.

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