[Cmake-commits] CMake branch, master, updated. v3.8.1-1121-gf1b9fe5

2017-05-10 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  f1b9fe5fc4af1bab7d551c48600ca3ebb717db8f (commit)
  from  8cc9e07a2ca7018feb0dbc286f1db23a4294eeec (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=f1b9fe5fc4af1bab7d551c48600ca3ebb717db8f
commit f1b9fe5fc4af1bab7d551c48600ca3ebb717db8f
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Thu May 11 00:01:06 2017 -0400
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Thu May 11 00:01:06 2017 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index b9921ef..6c443d6 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 8)
-set(CMake_VERSION_PATCH 20170510)
+set(CMake_VERSION_PATCH 20170511)
 #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
http://public.kitware.com/mailman/listinfo/cmake-commits


Re: [cmake-developers] Splitting CMakeLib

2017-05-10 Thread Egor Pugin
It's not the question of WPO. Some bottom components from my list
involve unwanted dependencies like flex/bison, curl etc. Also I don't
like building those other files. At the end cmakelib is very fat
itself, it can be very useful to split it into light, observable
components, move to subdirectories, maybe choose possible public apis.

On 10 May 2017 at 19:09, Jean-Michaël Celerier
 wrote:
>
> On Wed, May 10, 2017 at 4:56 PM, Egor Pugin  wrote:
>>
>> but CMakeLib looks too fat.
>
>
>
> In this age of link-time whole-program optimizations is this really a
> problem ?



-- 
Egor Pugin
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] Splitting CMakeLib

2017-05-10 Thread Jean-Michaël Celerier
On Wed, May 10, 2017 at 4:56 PM, Egor Pugin  wrote:

> but CMakeLib looks too fat.



In this age of link-time whole-program optimizations is this really a
problem ?
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] Splitting CMakeLib

2017-05-10 Thread Egor Pugin
I'd like to replace cmake language (frontend) with something different.
So, I need only target and generators.

On 10 May 2017 at 18:11, Ben Boeckel  wrote:
> On Wed, May 10, 2017 at 17:56:07 +0300, Egor Pugin wrote:
>> I'd like to re-use some CMake internal components, but CMakeLib looks too 
>> fat.
>> Is it possible to split it into several libraries? Are such changes
>> welcome to contribute?
>
> What is the use case? CMake does not ship an SDK to link against, so
> presumably this is something going into CMake itself?
>
> --Ben



-- 
Egor Pugin
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Splitting CMakeLib

2017-05-10 Thread Ben Boeckel
On Wed, May 10, 2017 at 17:56:07 +0300, Egor Pugin wrote:
> I'd like to re-use some CMake internal components, but CMakeLib looks too fat.
> Is it possible to split it into several libraries? Are such changes
> welcome to contribute?

What is the use case? CMake does not ship an SDK to link against, so
presumably this is something going into CMake itself?

--Ben
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] Splitting CMakeLib

2017-05-10 Thread Egor Pugin
Hi!

I'd like to re-use some CMake internal components, but CMakeLib looks too fat.
Is it possible to split it into several libraries? Are such changes
welcome to contribute?

Some rough plan:
1) Support library (if any stuff)
2) Core library (targets etc.)
3) Generators library
4) CMake syntax library (lexer, parser)
5) Commands implementation library (could be merged with 4)

True cmake power is in its generators. It's always possible to rip off
all other stuff, but in order to be tied with mainstream and
contribute back, I'm asking this.

-- 
Egor Pugin
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [CMake] RPM package and relocation

2017-05-10 Thread Domen Vrankar
>
> > set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/ssp-suite)
> > install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ssp/" DESTINATION
> ${INSTALL_DIR})
>

Eric already covered this part - use relative paths instead ( no / at the
beginning).


> But I also need to execute a post script, which runs after installation. I
> added
>
> > set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/
> postinstall")
>
> to my CMakeLists.txt and in that script, I am using the RPM variable
> $RPM_INSTALL_PREFIX. But during installation, I get this error message
>
> > chmod: cannot access '/usr/usr/bin/startssp': No such file or directory
> > warning: %post(ssp-suite-7.1-1.x86_64) scriptlet failed, exit status 1
> > Non-fatal POSTIN scriptlet failure in rpm package ssp-suite-7.1-1.x86_64
>


Pre/postinstall scripts are outside what CPackRPM is handling automatically
but you can still use the relocation paths as supported by RPM.

Example for single relocation path:
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") # this will become the
relocation path - becomes first relocation path

Example for multiple relocation paths:
set(CPACK_RPM_RELOCATION_PATHS "etc/foo" "opt/bar") # two paths that will
be relocatable - etc will become first relocation path and opt the second
one
set(CPACK_RPM_NO_INSTALL_PREFIX_RELOCATION ON) # this will remove the
default /usr from relocation paths
set(CPACK_PACKAGING_INSTALL_PREFIX "/a") # relative paths will be prefixed
with /a - there is a bug that prevents you from using "/" only for
relocation paths so you might decide to patch CPackRPM.cmake yourself [1]



Now for the postinstall script each relocation path becomes a variable in
RPM (RPM_INSTALL_PREFIX0 for first relocation path, RPM_INSTALL_PREFIX1 for
the second and so on) so what you have to do in your script is instead of
writing something like this:

chown someone:somegroup /etc/some_non_relocatable_path/some_file

you should write:

chown someone:somegroup
${RPM_INSTALL_PREFIX0}/some_non_relocatable_path/some_file

Regards,
Domen

[1] https://gitlab.kitware.com/cmake/cmake/merge_requests/583/diffs
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

[Cmake-commits] CMake branch, master, updated. v3.8.1-1120-g8cc9e07

2017-05-10 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  8cc9e07a2ca7018feb0dbc286f1db23a4294eeec (commit)
   via  d49aa10768fba4c2cb113d49629138140b37d560 (commit)
  from  d43eb3aec2419284c8491b0f8334ca47d0a6e334 (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=8cc9e07a2ca7018feb0dbc286f1db23a4294eeec
commit 8cc9e07a2ca7018feb0dbc286f1db23a4294eeec
Merge: d43eb3a d49aa10
Author: Brad King 
AuthorDate: Wed May 10 13:36:10 2017 +
Commit: Kitware Robot 
CommitDate: Wed May 10 09:36:16 2017 -0400

Merge topic 'sunpro-c++11-link'

d49aa107 Features: On SunPro link feature check with lang std flag

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d49aa10768fba4c2cb113d49629138140b37d560
commit d49aa10768fba4c2cb113d49629138140b37d560
Author: Brad King 
AuthorDate: Tue May 9 11:18:54 2017 -0400
Commit: Brad King 
CommitDate: Tue May 9 11:22:18 2017 -0400

Features: On SunPro link feature check with lang std flag

Follow up commit e17b179184 (Features: On SunPro link with language
standard compiler flag, 2017-04-28) to apply the same fix to the feature
checks.  The `try_compile` used for these is intentionally not using
`CXX_STANDARD`-based logic so that it can test the individual flags.

diff --git a/Modules/Internal/FeatureTesting.cmake 
b/Modules/Internal/FeatureTesting.cmake
index 50b8526..de336e7 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -22,9 +22,18 @@ macro(_record_compiler_features lang compile_flags 
feature_list)
   file(APPEND "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}"
 "\n};\n\nint main(int argc, char** argv) { (void)argv; return 
features[argc]; }\n")
 
+  if(CMAKE_${lang}_LINK_WITH_STANDARD_COMPILE_OPTION)
+# This toolchain requires use of the language standard flag
+# when linking in order to use the matching standard library.
+set(compile_flags_for_link "${compile_flags}")
+  else()
+set(compile_flags_for_link "")
+  endif()
+
   try_compile(CMAKE_${lang}_FEATURE_TEST
 ${CMAKE_BINARY_DIR} 
"${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}"
 COMPILE_DEFINITIONS "${compile_flags}"
+LINK_LIBRARIES "${compile_flags_for_link}"
 OUTPUT_VARIABLE _output
 COPY_FILE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin"
 COPY_FILE_ERROR _copy_error
@@ -35,6 +44,7 @@ macro(_record_compiler_features lang compile_flags 
feature_list)
 set(_result 255)
   endif()
   unset(CMAKE_${lang}_FEATURE_TEST CACHE)
+  unset(compile_flags_for_link)
 
   if (_result EQUAL 0)
 file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log

---

Summary of changes:
 Modules/Internal/FeatureTesting.cmake |   10 ++
 1 file changed, 10 insertions(+)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.8.1-1118-gd43eb3a

2017-05-10 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  d43eb3aec2419284c8491b0f8334ca47d0a6e334 (commit)
   via  882ef5f33f75b5315fe471a1b58a8c07c2b57dec (commit)
   via  8c2a3691054d16d070abdf3be8f8b61cfa2170f8 (commit)
   via  07e30f082c73fe9fbeadafb97ca479e03f46c9bb (commit)
   via  32400110fe7ea1b624d19625b5ae606f5f47814d (commit)
   via  776929b3c46ef593fc70cf792e0f4e99d6bc88b9 (commit)
   via  9b541aaeaa16204c3bf158fa88244c9b8d3d7d80 (commit)
   via  80ca9ac84b2a6b24e40306a9f8afedfe67511d30 (commit)
   via  ec5c6bc9bc9bd4e53f511f18cb2da569ea6508e2 (commit)
  from  8a19ce47679580445a5ae291ecfbb3e88c8c6aeb (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=d43eb3aec2419284c8491b0f8334ca47d0a6e334
commit d43eb3aec2419284c8491b0f8334ca47d0a6e334
Merge: 882ef5f 776929b
Author: Brad King 
AuthorDate: Wed May 10 13:27:04 2017 +
Commit: Kitware Robot 
CommitDate: Wed May 10 09:27:10 2017 -0400

Merge topic 'vs-project-guid'

776929b3 VS: Fix .vcxproj ProjectGuid element case

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=882ef5f33f75b5315fe471a1b58a8c07c2b57dec
commit 882ef5f33f75b5315fe471a1b58a8c07c2b57dec
Merge: 8c2a369 9b541aa
Author: Brad King 
AuthorDate: Wed May 10 13:26:05 2017 +
Commit: Kitware Robot 
CommitDate: Wed May 10 09:26:10 2017 -0400

Merge topic 'test-lang-fix'

9b541aae TestFindOpenMP,MPI: Disable default languages

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c2a3691054d16d070abdf3be8f8b61cfa2170f8
commit 8c2a3691054d16d070abdf3be8f8b61cfa2170f8
Merge: 07e30f0 80ca9ac
Author: Brad King 
AuthorDate: Wed May 10 13:25:43 2017 +
Commit: Kitware Robot 
CommitDate: Wed May 10 09:25:47 2017 -0400

Merge topic 'findopenmp-new-search'

80ca9ac8 FindOpenMP: Cache compilation results
ec5c6bc9 FindOpenMP: Refine list of flags to try

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07e30f082c73fe9fbeadafb97ca479e03f46c9bb
commit 07e30f082c73fe9fbeadafb97ca479e03f46c9bb
Merge: 8a19ce4 3240011
Author: Brad King 
AuthorDate: Wed May 10 13:25:03 2017 +
Commit: Kitware Robot 
CommitDate: Wed May 10 09:25:07 2017 -0400

Merge topic 'doc-HEADER_FILE_ONLY-use-case'

32400110 Help: Document HEADER_FILE_ONLY use case

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32400110fe7ea1b624d19625b5ae606f5f47814d
commit 32400110fe7ea1b624d19625b5ae606f5f47814d
Author: Roman Lebedev 
AuthorDate: Sun May 7 18:21:32 2017 +0300
Commit: Brad King 
CommitDate: Tue May 9 11:46:29 2017 -0400

Help: Document HEADER_FILE_ONLY use case

Describe how to get sources into IDE project files.

diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index 19ca658..c088796 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -40,6 +40,9 @@ the syntax ``$<...>``.  See the 
:manual:`cmake-generator-expressions(7)`
 manual for available expressions.  See the :manual:`cmake-buildsystem(7)`
 manual for more on defining buildsystem properties.
 
+See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are
+pre-processed, and you want to have the original sources reachable from
+within IDE.
 
 --
 
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index 3a76040..02788e3 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -59,6 +59,10 @@ the syntax ``$<...>``.  See the 
:manual:`cmake-generator-expressions(7)`
 manual for available expressions.  See the :manual:`cmake-buildsystem(7)`
 manual for more on defining buildsystem properties.
 
+See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are
+pre-processed, and you want to have the original sources reachable from
+within IDE.
+
 Imported Libraries
 ^^
 
diff --git a/Help/prop_sf/HEADER_FILE_ONLY.rst 
b/Help/prop_sf/HEADER_FILE_ONLY.rst
index b4fb2db..71d62ae 100644
--- 

[Cmake-commits] CMake branch, master, updated. v3.8.1-1109-g8a19ce4

2017-05-10 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  8a19ce47679580445a5ae291ecfbb3e88c8c6aeb (commit)
   via  53f1f55599808bf9771a32df35ac4d7a83f4007b (commit)
   via  5e0e03d953c03e1703708f4f579d903990edecb9 (commit)
   via  44c0b2b75a1c67a8bede285368f617f2c8e1dd77 (commit)
   via  da8faa8c7e54df0abbdfd50c29235320164453aa (commit)
   via  c3f41af2be49c1850c526eeac381b0c5989d7f15 (commit)
   via  c2c2bbb3d49837361ea02483e90e10a632975688 (commit)
   via  c36d63cd48fbfda57cd8cf25c029a3a175e10299 (commit)
   via  8986dec05dade19ee0f779c6c498dc0e04a8f8ee (commit)
  from  730cd10c64679bd0a8325bf7f0e9febda613bb8a (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=8a19ce47679580445a5ae291ecfbb3e88c8c6aeb
commit 8a19ce47679580445a5ae291ecfbb3e88c8c6aeb
Merge: 53f1f55 5e0e03d
Author: Brad King 
AuthorDate: Wed May 10 13:23:39 2017 +
Commit: Kitware Robot 
CommitDate: Wed May 10 09:23:43 2017 -0400

Merge topic 'ninja-windows-command-concat'

5e0e03d9 Ninja: Fix command concatenation on Windows

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53f1f55599808bf9771a32df35ac4d7a83f4007b
commit 53f1f55599808bf9771a32df35ac4d7a83f4007b
Merge: 730cd10 44c0b2b
Author: Brad King 
AuthorDate: Wed May 10 13:22:32 2017 +
Commit: Kitware Robot 
CommitDate: Wed May 10 09:22:46 2017 -0400

Merge topic 'separate-command-registration'

44c0b2b7 cmCommand: remove IsScriptable
da8faa8c cmState: remove RemoveUnscriptableCommands
c3f41af2 cmMakefile: don't check IsScriptable
c2c2bbb3 cmake: register fake project commands in -P mode
c36d63cd cmake: initialize with Role that controls which commands to 
register
8986dec0 ctest: remove unused cmake instance

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5e0e03d953c03e1703708f4f579d903990edecb9
commit 5e0e03d953c03e1703708f4f579d903990edecb9
Author: Bernhard Burgermeister 
AuthorDate: Thu May 4 17:57:20 2017 +0200
Commit: Brad King 
CommitDate: Tue May 9 11:34:42 2017 -0400

Ninja: Fix command concatenation on Windows

Put commands that contain `||` into brackets to avoid early abort of
execution by `cmd.exe` because `||` has higher precedence than `&&` in
`cmd.exe`.

Add test to check for command execution after `||` as part of a
parameter and as command separator.

Fixes: #16850

diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index e0e3e54..124bd80 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -322,7 +322,13 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
 } else if (cmdLines.size() > 1) {
   cmd << "cmd.exe /C \"";
 }
-cmd << *li;
+// Put current cmdLine in brackets if it contains "||" because it has
+// higher precedence than "&&" in cmd.exe
+if (li->find("||") != std::string::npos) {
+  cmd << "( " << *li << " )";
+} else {
+  cmd << *li;
+}
   }
   if (cmdLines.size() > 1) {
 cmd << "\"";
diff --git a/Tests/RunCMake/Ninja/CommandConcat.cmake 
b/Tests/RunCMake/Ninja/CommandConcat.cmake
new file mode 100644
index 000..790cf9d
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CommandConcat.cmake
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.7)
+project(concat_cmd NONE)
+set(output1 ${CMAKE_BINARY_DIR}/out1.txt)
+set(output2 ${CMAKE_BINARY_DIR}/out2.txt)
+file(REMOVE ${output1} ${output2})
+# Check that second command runs if first command contains "||" which has 
higher precedence than "&&" on Windows
+add_custom_target(concat_cmd ALL
+  COMMAND ${CMAKE_COMMAND} -E echo "Hello || pipe world" && ${CMAKE_COMMAND} 
-E touch ${output1} || exit 1
+  COMMAND ${CMAKE_COMMAND} -E touch ${output2})
+# Check output
+add_custom_target(check_output ALL
+  COMMAND ${CMAKE_COMMAND} -E copy ${output1} ${output1}.copy
+  COMMAND ${CMAKE_COMMAND} -E copy ${output2} ${output2}.copy)
+add_dependencies(check_output concat_cmd)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake 
b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 8c3bc20..b3720fb 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -40,6 +40,16 @@ run_CMP0058(NEW-by)
 
 run_cmake(CustomCommandDepfile)
 

[CMake] CMAKE_VS_PLATFORM_TOOLSET with Ninja generator

2017-05-10 Thread Mourad Boufarguine
Hi,

I am building a third party library (OpenSceneGraph) using ninja generator
and Visual c++ compiler.
Recently the build is failing because of the use of CMAKE_VS_PLATFORM_TOOLSET
[*] to query the VS toolset used. This variable seems not to be set when
using Ninja generator. My question is what is the recommended way to query
for the VS toolset version, that would work for both VS and Ninja
generators?

Thanks,
Mourad

[*]
https://github.com/openscenegraph/OpenSceneGraph/commit/67ef816da00441121f7b2cb606ee19bbb1f15e80
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] RPM package and relocation

2017-05-10 Thread Craig Scott
You probably need to show us the postinstall script for us to be able to
see the problem. Also, in case you haven't found it already, the MaximumRPM
manual may be helpful (although it seems you've already found the
essentials and that document could be getting a bit dated by now):

http://ftp.rpm.org/max-rpm/

specifically chapter 15: Making A Relocatable Package and chapter 13:
Scripts: RPM's Workhorse. You might also want to check you are not having
the problem described in this stackoverflow answer
 regarding when variables get
substituted.



On Wed, May 10, 2017 at 9:26 PM, Kristian 
wrote:

> Hi,
>
> I am creating an RPM package, which on a standard installation should
> install the file into /opt/ssp-suite directory. But I want to give the
> user the opportunity, to install the package into another directory.
>
> I am doing this with these lines:
>
> > set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/ssp-suite)
> > install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ssp/" DESTINATION
> ${INSTALL_DIR})
>
> and by running cmake with
>
> > cmake -DCMAKE_INSTALL_PREFIX=/opt -V --debug .
>
> But I also need to execute a post script, which runs after installation. I
> added
>
> > set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/
> postinstall")
>
> to my CMakeLists.txt and in that script, I am using the RPM variable
> $RPM_INSTALL_PREFIX. But during installation, I get this error message
>
> > chmod: cannot access '/usr/usr/bin/startssp': No such file or directory
> > warning: %post(ssp-suite-7.1-1.x86_64) scriptlet failed, exit status 1
> > Non-fatal POSTIN scriptlet failure in rpm package ssp-suite-7.1-1.x86_64
>
> Can someone give me some hints, how to change / add lines to
> CMakeListst.txt and my postinstall script, so that script can be fully
> relocatable?
> --
>
> 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:
> http://public.kitware.com/mailman/listinfo/cmake
>



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

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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] RPM package and relocation

2017-05-10 Thread Eric Noulard
2017-05-10 13:26 GMT+02:00 Kristian :

> Hi,
>
> I am creating an RPM package, which on a standard installation should
> install the file into /opt/ssp-suite directory. But I want to give the
> user the opportunity, to install the package into another directory.
>
> I am doing this with these lines:
>
> > set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/ssp-suite)
> > install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ssp/" DESTINATION
> ${INSTALL_DIR})
>

If you want to create relocatable package you should avoid install
directive with absolute destination but rather do:

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ssp" DESTINATION ssp-suite)

then in our CMakeLists.txt before including CPack

set(CPACK_RPM_PACKAGE_RELOCATABLE True)



>
> and by running cmake with
>
> > cmake -DCMAKE_INSTALL_PREFIX=/opt -V --debug .
>


CMAKE_INSTALL_PREFIX is not the prefix used by CPack.
You should use CPACK_PACKAGING_INSTALL_PREFIX:
https://cmake.org/cmake/help/v3.7/variable/CPACK_PACKAGING_INSTALL_PREFIX.html#variable:CPACK_PACKAGING_INSTALL_PREFIX

Whatever the value you used for CMAKE_INSTALL_PREFIX at CMake runtime you
may use another prefix for packaging when invoking CPack:

cpack -DCPACK_PACKAGING_INSTALL_PREFIX=/opt -G RPM

this will work for all files/target/dir installed with a **RELATIVE** path
if you installed with an absolute path then the absolute path will be kept
making the package "partially" or "not-at-all" relocatable.

Non relocatable file are commonly placed in /etc/...


>
> But I also need to execute a post script, which runs after installation. I
> added
>
> > set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/
> postinstall")
>
> to my CMakeLists.txt and in that script, I am using the RPM variable
> $RPM_INSTALL_PREFIX. But during installation, I get this error message
>
> > chmod: cannot access '/usr/usr/bin/startssp': No such file or directory
> > warning: %post(ssp-suite-7.1-1.x86_64) scriptlet failed, exit status 1
> > Non-fatal POSTIN scriptlet failure in rpm package ssp-suite-7.1-1.x86_64
>

I'm not quite up-to-date with CPack RPM and I guess Domen will step in for
that but
the specified script will be read and put into the RPM itself by CPackRPM.

However since you currently have absolute destination file the prefix may
well be "/usr" even if you installed somewhere else.

Try:
rpm -qi -p .rpm | grep Reloca

you'll get the relocations list unless the package is not relocatable.

If you want to investigate more about what CPack RPM is doing for you you
may try:

cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM

as indicated here:
https://cmake.org/cmake/help/v3.7/module/CPackRPM.html


> Can someone give me some hints, how to change / add lines to
> CMakeListst.txt and my postinstall script, so that script can be fully
> relocatable?
>

I don't remember what variables may be used in POST/PRE install script files
but you may have a look at the generated spec file which may gives you clue
about that.
The spec file generated by CPackRPM should be in:

/_CPack_Packages//RPM/SPECS

running CPack RPM with DEBUG var set to 1 will give you all file locaton.
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] RPM package and relocation

2017-05-10 Thread Kristian
Hi,

I am creating an RPM package, which on a standard installation should
install the file into /opt/ssp-suite directory. But I want to give the
user the opportunity, to install the package into another directory.

I am doing this with these lines:

> set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/ssp-suite)
> install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ssp/" DESTINATION 
> ${INSTALL_DIR})

and by running cmake with

> cmake -DCMAKE_INSTALL_PREFIX=/opt -V --debug .

But I also need to execute a post script, which runs after installation. I added

> set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE 
> "${CMAKE_CURRENT_SOURCE_DIR}/postinstall")

to my CMakeLists.txt and in that script, I am using the RPM variable
$RPM_INSTALL_PREFIX. But during installation, I get this error message

> chmod: cannot access '/usr/usr/bin/startssp': No such file or directory
> warning: %post(ssp-suite-7.1-1.x86_64) scriptlet failed, exit status 1
> Non-fatal POSTIN scriptlet failure in rpm package ssp-suite-7.1-1.x86_64

Can someone give me some hints, how to change / add lines to
CMakeListst.txt and my postinstall script, so that script can be fully
relocatable?
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake