Re: [CMake] cpack generator variable

2016-02-28 Thread Petr Kmoch
Hi Tiago.

If you happen to know the directory for each configuration at CMake
configure time, you could do this:

install(DIRECTORY path/to/Debug/dir
  DESTINATION bin
  CONFIGURATIONS Debug
  COMPONENT files
)

install(DIRECTORY path/to/Release/dir
  DESTINATION bin
  CONFIGURATIONS Release
  COMPONENT files
)

# ...etc

Petr


On Fri, Feb 26, 2016 at 10:40 PM, Tiago Macarios 
wrote:

> Hi All,
>
> I have a cmake project which one of the install targets is a collection of
> files. This files change depending on the configuration (Release,
> Debug...). I would like to be able to install the files like so:
>
> install(DIRECTORY $
> DESTINATION bin
> COMPONENT files)
>
> From the docs I see that cmake does not support that. Generator variables
> do not apply to DIRECTORY. So I was wondering if there is a way to either
> save the directory information somewhere and pass it to cpack afterwards.
>
> So I guess the question is how to pass a variable from cmake to cpack?
>
> Best,
> Tiago
>
>
> --
>
> 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
>
-- 

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.5.0-rc3-154-g26d615a

2016-02-28 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  26d615ad9ff58e1cae3b605efeb0cd1b6823622a (commit)
  from  b500c98c91ce1ca90d152daab81b5761a6c480ee (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=26d615ad9ff58e1cae3b605efeb0cd1b6823622a
commit 26d615ad9ff58e1cae3b605efeb0cd1b6823622a
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Mon Feb 29 00:01:04 2016 -0500
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Mon Feb 29 00:01:04 2016 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ee5e22f..4f5eefe 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 5)
-set(CMake_VERSION_PATCH 20160228)
+set(CMake_VERSION_PATCH 20160229)
 #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


[cmake-developers] [CMake 0015993]: "NMake Makefiles" generator doesn't escape special characters (such as '#') in build directory name correctly

2016-02-28 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=15993 
== 
Reported By:Roy Ivy III
Assigned To:
== 
Project:CMake
Issue ID:   15993
Category:   CMake
Reproducibility:always
Severity:   major
Priority:   normal
Status: new
== 
Date Submitted: 2016-02-28 18:16 EST
Last Modified:  2016-02-28 18:16 EST
== 
Summary:"NMake Makefiles" generator doesn't escape special
characters (such as '#') in build directory name correctly
Description: 
When using `cmake -G "NMake Makefiles"` from a directory containing
nmake-special characters, such as '#', the special characters are not escaped
causing incorrect macro definitions and build executions.

The special characters should be escaped with '^'.

Steps to Reproduce: 
cd REPO
mkdir #build
cd #build
cmake -G "NMake Makefiles" REPO_SRC
nmake
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-02-28 18:16 Roy Ivy IIINew Issue
==

-- 

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] A function and its arguments

2016-02-28 Thread Kristian
You were right. Thank you!

2016-02-28 22:12 GMT+01:00 Nils Gladitz :
> On 28.02.2016 21:57, Kristian wrote:
>>
>> [...]
>>
>> 
>> test_me(1 2 3)
>> 
>>
>> Then I get this output:
>>
>> 
>> test_me
>>   -> 1
>>   -> 2
>>   -> Number of arguments: 3
>>   -> All arguments: 123
>>   -> 0. argument: 1
>>   -> 1. argument: 2
>>   -> 2. argument: 3
>>   -> Unexpected arguments: 3
>>
>> 
>>
>> I would expect, that the line "All arguments" would look like "All
>> arguments: 1 2 3", and not "All arguments: 123".
>>
>> What is the thought behind this behaviour?
>
>
> This is due to how you call message() which concatenates its arguments.
>
> Instead try e.g.
> message(" -> All arguments: ${ARGV}")
>
> Which should output " -> All arguments: 1;2;3" (CMake's internal list
> separator is semicolon).
>
> Nils
>
-- 

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] A function and its arguments

2016-02-28 Thread Nils Gladitz

On 28.02.2016 21:57, Kristian wrote:

[...]


test_me(1 2 3)


Then I get this output:


test_me
  -> 1
  -> 2
  -> Number of arguments: 3
  -> All arguments: 123
  -> 0. argument: 1
  -> 1. argument: 2
  -> 2. argument: 3
  -> Unexpected arguments: 3



I would expect, that the line "All arguments" would look like "All
arguments: 1 2 3", and not "All arguments: 123".

What is the thought behind this behaviour?


This is due to how you call message() which concatenates its arguments.

Instead try e.g.
message(" -> All arguments: ${ARGV}")

Which should output " -> All arguments: 1;2;3" (CMake's internal list 
separator is semicolon).


Nils

--

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] A function and its arguments

2016-02-28 Thread Kristian
Hey,

I have a question. I have read the article about functions:
https://cmake.org/cmake/help/v3.0/command/function.html

I tried to write myself a very simple function (nothing special)



function(test_me add1 add2)
message("test_me")
message(" -> " ${add1})
message(" -> " ${add2})
message(" -> Number of arguments: " ${ARGC})
message(" -> All arguments: " ${ARGV})
message(" -> 0. argument: " ${ARGV0})
message(" -> 1. argument: " ${ARGV1})
message(" -> 2. argument: " ${ARGV2})
message(" -> Unexpected arguments: " ${ARGN})
endfunction(test_me)



But when calling the function with


test_me("1" "2" "3")


or


test_me(1 2 3)


Then I get this output:


test_me
 -> 1
 -> 2
 -> Number of arguments: 3
 -> All arguments: 123
 -> 0. argument: 1
 -> 1. argument: 2
 -> 2. argument: 3
 -> Unexpected arguments: 3



I would expect, that the line "All arguments" would look like "All
arguments: 1 2 3", and not "All arguments: 123".

What is the thought behind this behaviour?
-- 

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-developers] [CMake 0015992]: Xcode generator's ReRunCMake.make fails if dependencies have been deleted

2016-02-28 Thread Gregor Jasny via cmake-developers
On 27/02/16 06:11, Mantis Bug Tracker wrote:
> Summary:Xcode generator's ReRunCMake.make fails if
> dependencies have been deleted
> Description: 
> Currently, if a file that a CMake script previously had a dependency on is
> deleted, the Xcode generator's ReRunCMake.make Makefile will fail with a "no
> rule to make target <…>" error. This happens pretty frequently if you have a
> CMake script that reads the ref file for your current git branch and you 
> delete
> branches regularly, and can also happen if you make other build system 
> changes.
> 
> This can be solved by wrapping each item in the list with `$(wildcard 
> )`,
> which effectively makes the dependencies optional.

Brad: I pushed and merged the xcode-regenerate-on-deleted-files topic
but I'm unsure about the test location itself and if this is a feature
all generators should provide. I tested it with Xcode, Make, and Ninja.

Thanks,
Gregor

-- 

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-commits] CMake branch, next, updated. v3.5.0-rc3-305-g5be433e

2016-02-28 Thread Gregor Jasny via Cmake-commits
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, next has been updated
   via  5be433e1cad0265f8e972c7a18f3f489878657fe (commit)
   via  aa4b5ea60018e38683fc8960c2e3534845c44a02 (commit)
   via  b500c98c91ce1ca90d152daab81b5761a6c480ee (commit)
   via  499be36a64e186a7426aae5ee4613b07a722827a (commit)
  from  d7b1a40b0f039ed46522d5c9f3c7c421833ba32c (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=5be433e1cad0265f8e972c7a18f3f489878657fe
commit 5be433e1cad0265f8e972c7a18f3f489878657fe
Merge: d7b1a40 aa4b5ea
Author: Gregor Jasny 
AuthorDate: Sun Feb 28 11:35:53 2016 -0500
Commit: CMake Topic Stage 
CommitDate: Sun Feb 28 11:35:53 2016 -0500

Merge topic 'xcode-regenerate-on-deleted-files' into next

aa4b5ea6 Xcode: ReRunCMake even if files disappeared (#15992)
b500c98c CMake Nightly Date Stamp
499be36a CMake Nightly Date Stamp


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa4b5ea60018e38683fc8960c2e3534845c44a02
commit aa4b5ea60018e38683fc8960c2e3534845c44a02
Author: Gregor Jasny 
AuthorDate: Sun Feb 28 17:27:17 2016 +0100
Commit: Gregor Jasny 
CommitDate: Sun Feb 28 17:35:15 2016 +0100

Xcode: ReRunCMake even if files disappeared (#15992)

diff --git a/Source/cmGlobalXCodeGenerator.cxx 
b/Source/cmGlobalXCodeGenerator.cxx
index ef18729..7844611 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -603,7 +603,8 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
   for(std::vector::const_iterator i = lfiles.begin();
   i !=  lfiles.end(); ++i)
 {
-makefileStream << "\\\n" << this->ConvertToRelativeForMake(i->c_str());
+makefileStream << "\\\n" << "$(wildcard "
+   << this->ConvertToRelativeForMake(i->c_str()) << ")";
 }
   makefileStream << "\n\t" <<
 this->ConvertToRelativeForMake(cmSystemTools::GetCMakeCommand().c_str())
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake 
b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index a07bbbe..274e13e 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -298,3 +298,37 @@ set(CMAKE_RELATIVE_PATH_TOP_BINARY 
\"${RunCMake_TEST_BINARY_DIR}\")
 )
 endfunction()
 run_cmake_depends()
+
+# test re-generation of project even if CMakeLists.txt files disappeared
+if(UNIX)
+  # Use a single build tree for a few tests without cleaning.
+  set(RunCMake_TEST_BINARY_DIR
+${RunCMake_BINARY_DIR}/regenerate-project-build)
+  set(RunCMake_TEST_SOURCE_DIR
+${RunCMake_BINARY_DIR}/regenerate-project-source)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+  file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
+  set(ProjectHeader [=[
+cmake_minimum_required(VERSION 3.5)
+project(regenerate-project NONE)
+  ]=])
+
+  file(WRITE "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" "${ProjectHeader}"
+"add_subdirectory(mysubdir)")
+  file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}/mysubdir")
+  file(WRITE "${RunCMake_TEST_SOURCE_DIR}/mysubdir/CMakeLists.txt" "# empty")
+
+  run_cmake(regenerate-project-create)
+
+  # now we delete the subdirectory and adjust the CMakeLists.txt
+  file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}/mysubdir")
+  file(WRITE "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" "${ProjectHeader}")
+
+  run_cmake_command(regenerate-project-should-work
+${CMAKE_COMMAND} --build "${RunCMake_TEST_BINARY_DIR}")
+
+  unset(RunCMake_TEST_BINARY_DIR)
+  unset(RunCMake_TEST_SOURCE_DIR)
+  unset(RunCMake_TEST_NO_CLEAN)
+endif()

---

Summary of changes:
 Source/CMakeVersion.cmake |2 +-
 Source/cmGlobalXCodeGenerator.cxx |3 ++-
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake |   34 +
 3 files changed, 37 insertions(+), 2 deletions(-)


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