[Cmake-commits] CMake branch, next, updated. v3.3.0-rc2-446-g870d434

2015-06-12 Thread Stephen Kelly
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  870d4341f25524a1c58a25e2289f8c00ed584845 (commit)
   via  d3f9a669e35cd7002bc481e04580bd26189e438c (commit)
  from  172a21790ba117af6a03e35c69213a89a5cb86f3 (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 -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=870d4341f25524a1c58a25e2289f8c00ed584845
commit 870d4341f25524a1c58a25e2289f8c00ed584845
Merge: 172a217 d3f9a66
Author: Stephen Kelly steve...@gmail.com
AuthorDate: Fri Jun 12 02:32:46 2015 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Fri Jun 12 02:32:46 2015 -0400

Merge topic 'fix-tests-ancient-policies' into next

d3f9a669 Revert Tests: Update the complex test for ancient policies.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3f9a669e35cd7002bc481e04580bd26189e438c
commit d3f9a669e35cd7002bc481e04580bd26189e438c
Author: Stephen Kelly steve...@gmail.com
AuthorDate: Fri Jun 12 08:32:22 2015 +0200
Commit: Stephen Kelly steve...@gmail.com
CommitDate: Fri Jun 12 08:32:22 2015 +0200

Revert Tests: Update the complex test for ancient policies.

This reverts commit 3159f3e09f9a7b241bc09c587a16b4ae0c402c51.

diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 1479a13..5e5eead 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -1,7 +1,7 @@
 #
 # A more complex test case
 #
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 2.4)
 project (Complex)
 
 # Try setting a new policy.  The IF test is for coverage.
@@ -21,7 +21,6 @@ foreach(p
 CMP0032
 CMP0033
 CMP0034
-CMP0035
 CMP0043
 CMP0050
 )
diff --git a/Tests/Complex/Executable/complex.cxx 
b/Tests/Complex/Executable/complex.cxx
index 9dccd84..ec222a5 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -838,6 +838,14 @@ int main()
 #endif
 #endif // defined(_WIN32)  !defined(__CYGWIN__)
 
+  if(strcmp(CMAKE_MINIMUM_REQUIRED_VERSION, 2.4) == 0)
+{
+cmPassed(CMAKE_MINIMUM_REQUIRED_VERSION is set to 2.4);
+}
+  else
+{
+cmFailed(CMAKE_MINIMUM_REQUIRED_VERSION is not set to the expected 2.4);
+}
 
   // --
   // Test REMOVE command
diff --git a/Tests/Complex/Library/test_preprocess.cmake 
b/Tests/Complex/Library/test_preprocess.cmake
index 5758ba8..4c8ec21 100644
--- a/Tests/Complex/Library/test_preprocess.cmake
+++ b/Tests/Complex/Library/test_preprocess.cmake
@@ -1,4 +1,4 @@
-set(TEST_FILE CMakeFiles/create_file.dir/create_file.cxx.i)
+set(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
 file(READ ${TEST_FILE} CONTENTS)
 if(${CONTENTS} MATCHES Unable to close)
   message(STATUS ${TEST_FILE} created successfully!)
diff --git a/Tests/ComplexOneConfig/Library/test_preprocess.cmake 
b/Tests/ComplexOneConfig/Library/test_preprocess.cmake
index 5758ba8..4c8ec21 100644
--- a/Tests/ComplexOneConfig/Library/test_preprocess.cmake
+++ b/Tests/ComplexOneConfig/Library/test_preprocess.cmake
@@ -1,4 +1,4 @@
-set(TEST_FILE CMakeFiles/create_file.dir/create_file.cxx.i)
+set(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
 file(READ ${TEST_FILE} CONTENTS)
 if(${CONTENTS} MATCHES Unable to close)
   message(STATUS ${TEST_FILE} created successfully!)

---

Summary of changes:
 Tests/Complex/CMakeLists.txt |3 +--
 Tests/Complex/Executable/complex.cxx |8 
 Tests/Complex/Library/test_preprocess.cmake  |2 +-
 Tests/ComplexOneConfig/Library/test_preprocess.cmake |2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)


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


Re: [CMake] output of add_custom_command as target in Makefile

2015-06-12 Thread Nagy-Egri Máté Ferenc via CMake
You’re doing it all wrong. You do not name source files as make targets, but 
the target name (or project name, I have no idea, because it rarely makes sense 
to name them differently). Try simply “foo” or “custom-command-target”. You 
would never say “make foo.cpp”, not even in an ordinary GNU Make script.






Feladó: Dave Yost
Elküldve: ‎péntek‎, ‎2015‎. ‎június‎ ‎12‎. ‎2‎:‎00
Címzett: cmake@cmake.org





In this example, how do I get

   make foo.cc

to work?






0 Thu 16:56:19 yost DaveBook ~/p/c++/cmake/custom-command-target

369 Z% bundle CMakeLists.txt genFoo

#!/usr/bin/env unbundle

# See http://yost.com/computers/bundle/

 CMakeLists.txt

cmake_minimum_required(VERSION 3.3.0)




project(custom-command-target)







add_custom_command (

  OUTPUT  foo.cc

  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo  foo.cc

  )




add_executable (foo foo.cc)




 genFoo

#!/bin/bash




echo 

int main() {

  return 0;

}



0 Thu 16:56:23 yost DaveBook ~/p/c++/cmake/custom-command-target

370 Z% cd build

0 Thu 16:56:36 yost DaveBook ~/p/c++/cmake/custom-command-target/build

371 Z% cmake ..

-- Configuring done

-- Generating done

-- Build files have been written to: 
/Users/yost/p/c++/cmake/custom-command-target/build

0 Thu 16:56:41 yost DaveBook ~/p/c++/cmake/custom-command-target/build

372 Z% make clean  

0 Thu 16:56:45 yost DaveBook ~/p/c++/cmake/custom-command-target/build

373 Z% make foo.cc 

make: *** No rule to make target 'foo.cc'.  Stop.

2 Thu 16:56:49 yost DaveBook ~/p/c++/cmake/custom-command-target/build

374 Z%-- 

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-developers] Problems when creating config files and add_dependencies

2015-06-12 Thread Roman Wüger
Hello,

 

short description: I want to have a configuration header file per unit test.

 

For this purpose I wrote the following function, which creates a header file
in “${CURRENT_BINARY_DIR}” and copy all test files into the binary
directory.

Howewer, I got it to work when I use add_custom_target as pre_build target,
but this doesn’t work on *nix systems.

 

So here is the current function:

function(CopyUnitTestFiles projectName)

set(UnitTestConfigName ${projectName}UnitTestConfig)

set(UNITTESTCONFIGNAME ${projectName}UnitTestConfig)

set(PROJECT_NAME ${projectName})

set(OUTPUT_FILENAME
${CMAKE_CURRENT_BINARY_DIR}/${UnitTestConfigName}.cmake)

set(HEADER_INPUT_FILENAME
${CMAKE_SOURCE_DIR}/cmake/UnitTestConfig.h.in)

set(HEADER_OUTPUT_FILENAME
${CMAKE_CURRENT_BINARY_DIR}/${UnitTestConfigName}.h)

set(CURRENT_FILENAME ${OUTPUT_FILENAME})

set(RELATIVE_FILEPATH testfiles/${projectName})

set(INCLUDE_GUARD ${projectName}_UNITTESTCONFIG_H)

string(TOUPPER ${INCLUDE_GUARD} INCLUDE_GUARD)

 

set(TARGET_FILE_DIR $TARGET_FILE_DIR:${projectName})

set(CopyUnitTestFilesProjectName  CopyUnitTestFiles_${projectName})

configure_file(${CMAKE_SOURCE_DIR}/cmake/UnitTestConfig.cmake.in
${OUTPUT_FILENAME} @ONLY)

add_custom_target(${CopyUnitTestFilesProjectName}

  COMMAND ${CMAKE_COMMAND}
-DABSFILEPATH=${TARGET_FILE_DIR} -P ${OUTPUT_FILENAME}

  COMMAND ${CMAKE_COMMAND} -E remove_directory
${TARGET_FILE_DIR}/testfiles/${projectName}

  COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/data/testfiles
${TARGET_FILE_DIR}/testfiles/${projectName}

 )

set_property(TARGET ${CopyUnitTestFilesProjectName} PROPERTY FOLDER
Custom Targets/CopyUnitTestFiles)

add_dependencies(${projectName} ${CopyUnitTestFilesProjectName})

endfunction(CopyUnitTestFiles)

 

The function should be called like:

 

project(UnitTest1)

add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES})

target_link_libraries(${PROJECT_NAME} gtest gtest_main)

 

CopyUnitTestFiles(${PROJECT_NAME})

 

 

The error message which I get:

-- Configuring done

CMake Error: The inter-target dependency graph contains the following
strongly connected component (cycle):

  CopyUnitTestFiles_UnitTest1 of type UTILITY

depends on UnitTest1 (strong)

  UnitTest1 of type EXECUTABLE

depends on CopyUnitTestFiles_UnitTest1 (strong)

At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies
are allowed only among static libraries.

 

 

UnitTestConfig.cmake.in:

set(ProjectName @PROJECT_NAME@)

set(UnitTestConfigName @UNITTESTCONFIGNAME@)

set(NAMESPACE ${UnitTestConfigName})

set(UNITTESTNAME ${ProjectName})

set(RELATIVE_FILEPATH testfiles/${ProjectName})

set(ABSOLUTE_FILEPATH ${ABSFILEPATH}/testfiles/${ProjectName})

set(INCLUDE_GUARD ${ProjectName}_UNITTESTCONFIG_H)

string(TOUPPER ${INCLUDE_GUARD} INCLUDE_GUARD)

 

configure_file(@HEADER_INPUT_FILENAME@ @HEADER_OUTPUT_FILENAME@)

 

UnitTestConfig.h.in:

#ifndef @INCLUDE_GUARD@

#define @INCLUDE_GUARD@

 

namespace @NAMESPACE@ {

const char *const UnitTestName = @UNITTESTNAME@;

const char *const RelativeTestFilesPath = @RELATIVE_FILEPATH@;

const char *const AbsoluteTestFilesPath = @ABSOLUTE_FILEPATH@;

const wchar_t *const UnitTestNameW= L@UNITTESTNAME@;

const wchar_t *const RelativeTestFilesPathW = L@RELATIVE_FILEPATH@;

const wchar_t *const AbsoluteTestFilesPathW = L@ABSOLUTE_FILEPATH@;

}

 

#endif // @INCLUDE_GUARD@

 

It would be great if generator expressions can be used with configure_file
to avoid such overhead.

Does anyone have an idea on how to solve that?

 

Best Regards

Roman

-- 

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] [cmake-developers] Virtual folders in Visual studio get expanded on reload

2015-06-12 Thread Roman Wüger
@kgt: Thank you for this great hint. :-)
I had overlooked this button in Visual Studio

@mjklaim: I didn't see this behavior in older CMake versions.

Roman

 -Ursprüngliche Nachricht-
 Von: Thompson, KT [mailto:k...@lanl.gov]
 Gesendet: Dienstag, 02. Juni 2015 15:52
 An: Roman Wüger; CMake MailingList
 Betreff: RE: [cmake-developers] Virtual folders in Visual studio get expanded
 on reload
 
 Roman,
 
 I have the same complaint. My project has about 300 targets arranged in two
 dozen folders.  I use the collapse all  button in Visual Studio's Solution
 Explorer window (looks like a stack of 3 squares in VS2013).
 
 kt
 
 -Original Message-
 From: cmake-developers [mailto:cmake-developers-boun...@cmake.org]
 On Behalf Of Roman Wüger
 Sent: Monday, June 01, 2015 5:00 PM
 To: CMake Developer MailingList; CMake MailingList
 Subject: [cmake-developers] Virtual folders in Visual studio get expanded on
 reload
 
 Hi,
 
 I noticed that sometimes when a target is reloaded, that the virtual folders
 and targets for the complete visual studio solution get expanded.
 For a small project this isn't a problem, but in a large project (~ 100 
 targets)
 this is a really big problem to close all targets every time.
 
 Did anybody noticed this behavior and has a solution for it?
 
 Thanks
 
 Best Regards
 Roman
 --
 
 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

-- 

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] Virtual folders in Visual studio get expanded on reload

2015-06-12 Thread Roman Wüger
@kgt: Thank you for this great hint. :-)
I had overlooked this button in Visual Studio

@mjklaim: I didn't see this behavior in older CMake versions.

Roman

 -Ursprüngliche Nachricht-
 Von: Thompson, KT [mailto:k...@lanl.gov]
 Gesendet: Dienstag, 02. Juni 2015 15:52
 An: Roman Wüger; CMake MailingList
 Betreff: RE: [cmake-developers] Virtual folders in Visual studio get expanded
 on reload
 
 Roman,
 
 I have the same complaint. My project has about 300 targets arranged in two
 dozen folders.  I use the collapse all  button in Visual Studio's Solution
 Explorer window (looks like a stack of 3 squares in VS2013).
 
 kt
 
 -Original Message-
 From: cmake-developers [mailto:cmake-developers-boun...@cmake.org]
 On Behalf Of Roman Wüger
 Sent: Monday, June 01, 2015 5:00 PM
 To: CMake Developer MailingList; CMake MailingList
 Subject: [cmake-developers] Virtual folders in Visual studio get expanded on
 reload
 
 Hi,
 
 I noticed that sometimes when a target is reloaded, that the virtual folders
 and targets for the complete visual studio solution get expanded.
 For a small project this isn't a problem, but in a large project (~ 100 
 targets)
 this is a really big problem to close all targets every time.
 
 Did anybody noticed this behavior and has a solution for it?
 
 Thanks
 
 Best Regards
 Roman
 --
 
 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

-- 

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] [CMake 0015612]: ninja generator: The command line is too long

2015-06-12 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://www.itk.org/Bug/view.php?id=15612 
== 
Reported By:tim blechmann
Assigned To:
== 
Project:CMake
Issue ID:   15612
Category:   CMake
Reproducibility:always
Severity:   major
Priority:   normal
Status: new
== 
Date Submitted: 2015-06-12 06:38 EDT
Last Modified:  2015-06-12 06:38 EDT
== 
Summary:ninja generator: The command line is too long
Description: 
i'm adding many POST_BUILD steps via add_custom_command. at one point, ninja
builds fail with The command line is too long

apparently cmLocalNinjaGenerator::BuildCommandLine simply concatenates various
commands viawithout checking, whether the command line is too long.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2015-06-12 06:38 tim blechmann  New 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


[CMake] Problems when creating config files and add_dependencies

2015-06-12 Thread Roman Wüger
Hello,

 

short description: I want to have a configuration header file per unit test.

 

For this purpose I wrote the following function, which creates a header file
in “${CURRENT_BINARY_DIR}” and copy all test files into the binary
directory.

Howewer, I got it to work when I use add_custom_target as pre_build target,
but this doesn’t work on *nix systems.

 

So here is the current function:

function(CopyUnitTestFiles projectName)

set(UnitTestConfigName ${projectName}UnitTestConfig)

set(UNITTESTCONFIGNAME ${projectName}UnitTestConfig)

set(PROJECT_NAME ${projectName})

set(OUTPUT_FILENAME
${CMAKE_CURRENT_BINARY_DIR}/${UnitTestConfigName}.cmake)

set(HEADER_INPUT_FILENAME
${CMAKE_SOURCE_DIR}/cmake/UnitTestConfig.h.in)

set(HEADER_OUTPUT_FILENAME
${CMAKE_CURRENT_BINARY_DIR}/${UnitTestConfigName}.h)

set(CURRENT_FILENAME ${OUTPUT_FILENAME})

set(RELATIVE_FILEPATH testfiles/${projectName})

set(INCLUDE_GUARD ${projectName}_UNITTESTCONFIG_H)

string(TOUPPER ${INCLUDE_GUARD} INCLUDE_GUARD)

 

set(TARGET_FILE_DIR $TARGET_FILE_DIR:${projectName})

set(CopyUnitTestFilesProjectName  CopyUnitTestFiles_${projectName})

configure_file(${CMAKE_SOURCE_DIR}/cmake/UnitTestConfig.cmake.in
${OUTPUT_FILENAME} @ONLY)

add_custom_target(${CopyUnitTestFilesProjectName}

  COMMAND ${CMAKE_COMMAND}
-DABSFILEPATH=${TARGET_FILE_DIR} -P ${OUTPUT_FILENAME}

  COMMAND ${CMAKE_COMMAND} -E remove_directory
${TARGET_FILE_DIR}/testfiles/${projectName}

  COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/data/testfiles
${TARGET_FILE_DIR}/testfiles/${projectName}

 )

set_property(TARGET ${CopyUnitTestFilesProjectName} PROPERTY FOLDER
Custom Targets/CopyUnitTestFiles)

add_dependencies(${projectName} ${CopyUnitTestFilesProjectName})

endfunction(CopyUnitTestFiles)

 

The function should be called like:

 

project(UnitTest1)

add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES})

target_link_libraries(${PROJECT_NAME} gtest gtest_main)

 

CopyUnitTestFiles(${PROJECT_NAME})

 

 

The error message which I get:

-- Configuring done

CMake Error: The inter-target dependency graph contains the following
strongly connected component (cycle):

  CopyUnitTestFiles_UnitTest1 of type UTILITY

depends on UnitTest1 (strong)

  UnitTest1 of type EXECUTABLE

depends on CopyUnitTestFiles_UnitTest1 (strong)

At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies
are allowed only among static libraries.

 

 

UnitTestConfig.cmake.in:

set(ProjectName @PROJECT_NAME@)

set(UnitTestConfigName @UNITTESTCONFIGNAME@)

set(NAMESPACE ${UnitTestConfigName})

set(UNITTESTNAME ${ProjectName})

set(RELATIVE_FILEPATH testfiles/${ProjectName})

set(ABSOLUTE_FILEPATH ${ABSFILEPATH}/testfiles/${ProjectName})

set(INCLUDE_GUARD ${ProjectName}_UNITTESTCONFIG_H)

string(TOUPPER ${INCLUDE_GUARD} INCLUDE_GUARD)

 

configure_file(@HEADER_INPUT_FILENAME@ @HEADER_OUTPUT_FILENAME@)

 

UnitTestConfig.h.in:

#ifndef @INCLUDE_GUARD@

#define @INCLUDE_GUARD@

 

namespace @NAMESPACE@ {

const char *const UnitTestName = @UNITTESTNAME@;

const char *const RelativeTestFilesPath = @RELATIVE_FILEPATH@;

const char *const AbsoluteTestFilesPath = @ABSOLUTE_FILEPATH@;

const wchar_t *const UnitTestNameW= L@UNITTESTNAME@;

const wchar_t *const RelativeTestFilesPathW = L@RELATIVE_FILEPATH@;

const wchar_t *const AbsoluteTestFilesPathW = L@ABSOLUTE_FILEPATH@;

}

 

#endif // @INCLUDE_GUARD@

 

It would be great if generator expressions can be used with configure_file
to avoid such overhead.

Does anyone have an idea on how to solve that?

 

Best Regards

Roman

-- 

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-developers] Custom commands with Ninja on Windows

2015-06-12 Thread Florent Castelli
Hi!

I'm having some issues with Ninja on Windows with long custom commands (or
actually a long succession of short commands appended to the same target).
The problem is that they get concatenated in one single command using  
 and it is pretty easy to go over the 8k command line size limit on
Windows.

So I've been thinking that on Windows, instead of concatenating everything,
we should be a script that is run using a response file that just runs all
the command with error checking. Eventually, we could reuse
cmLocalVisualStudioGenerator::ConstructScript() for that matter.

Any thought about this? Any hint for implementing this myself in the Ninja
generator? Do you think of another way to fix this issue?

Thanks,
/Florent
-- 

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] [CMake 0015611]: ExternalProject_Add and find_package commands

2015-06-12 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://public.kitware.com/Bug/view.php?id=15611 
== 
Reported By:Valerii Kanunik
Assigned To:
== 
Project:CMake
Issue ID:   15611
Category:   CMake
Reproducibility:have not tried
Severity:   feature
Priority:   normal
Status: new
== 
Date Submitted: 2015-06-12 06:35 EDT
Last Modified:  2015-06-12 06:35 EDT
== 
Summary:ExternalProject_Add and find_package commands
Description: 
The proposal is to add another step to find_package command. If command can't
find package or required version of installed package is different allow
find_package command look through the list of targets added by
ExternalProject_Add command (or new one special command) and if this library is
there perform its download, compile, install and others steps on this
(configure) step.


Actually the main goal is similar to 0015588 CMake issue.

== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2015-06-12 06:35 Valerii KanunikNew 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


[cmake-developers] [CMake 0015613]: Package generated by CPack/PackageMaker display incorrect version with pkgutil

2015-06-12 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://www.cmake.org/Bug/view.php?id=15613 
== 
Reported By:Xiaoming Wang
Assigned To:
== 
Project:CMake
Issue ID:   15613
Category:   CPack
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2015-06-12 15:02 EDT
Last Modified:  2015-06-12 15:02 EDT
== 
Summary:Package  generated by CPack/PackageMaker display
incorrect version with pkgutil
Description: 
CPACK_PACKAGE_VERSION is correctly set in CPackConfig.cmake but when the package
is installed on OS X 10.10.x and 10.9.x, etc (doesn't matter which version OS X)
pkgutil show the package version is 1.0 which is incorrect.

Steps to Reproduce: 
Just normal cmake/cpack configuration, i.e. CPACK_BINARY_PACKAGEMAKER is ON,
CPACK_PACKAGE_VERSION is defined.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2015-06-12 15:02 Xiaoming Wang  New 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] output of add_custom_command as target in Makefile

2015-06-12 Thread Dave Yost
Hooray! Thanks!

Could a future version of cmake provide a nicer way to do this, without these 
error messages?

0 Fri 12:29:25 yost DaveBook ~/p/c++/cmake/custom-command-target/build
391 Z% make foo.cc
Scanning dependencies of target foo.cc
make[3]: Circular CMakeFiles/foo.cc - foo.cc dependency dropped.
make[3]: Circular foo.cc - foo.cc dependency dropped.
[100%] Generating foo.cc
[100%] Built target foo.cc
0 Fri 12:29:27 yost DaveBook ~/p/c++/cmake/custom-command-target/build
392 Z% 

 On 2015-06-12, at 8:40 AM, Glenn Coombs glenn.coo...@gmail.com wrote:
 
 If you run make help it will list targets it understands.  And as you 
 pointed out there is no target for foo.cc.  You can make foo but if you 
 really want a target for foo.cc you can add one yourself:
 
 cmake_minimum_required(VERSION 3.0.0)
 
 project(custom-command-target)
 
 add_custom_command (
   OUTPUT  foo.cc
   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo  foo.cc
   )
 
 add_custom_target(foo.cc DEPENDS ${CMAKE_BINARY_DIR}/foo.cc)
 
 add_executable (foo foo.cc)
 
 That should create a foo.cc target that you can run that will do the right 
 thing.
 
 --
 Glenn
 
 On 12 June 2015 at 14:20, Dave Yost d...@yost.com mailto:d...@yost.com 
 wrote:
 I’m not doing it wrong. Remember, this is a simplified example.
 
 We want to be able to make foo.cc http://foo.cc/ so we can look at it and 
 compare it. Yes, we could make foo and then look at foo.cc http://foo.cc/, 
 but until foo.cc http://foo.cc/ is right, we will suffer a lot of compiler 
 error clutter. When foo.cc http://foo.cc/ looks right, then we will make 
 foo.
 
 BTW, changing add_custom_command to add_custom_target has no apparent effect 
 and doesn’t help.
 
 On 2015-06-12, at 12:24 AM, Nagy-Egri Máté Ferenc csiga.b...@aol.com 
 mailto:csiga.b...@aol.com wrote:
 
 You’re doing it all wrong. You do not name source files as make targets, but 
 the target name (or project name, I have no idea, because it rarely makes 
 sense to name them differently). Try simply “foo” or 
 “custom-command-target”. You would never say “make foo.cpp”, not even in an 
 ordinary GNU Make script.
 
 Feladó: Dave Yost mailto:d...@yost.com
 Elküldve: ‎péntek‎, ‎2015‎. ‎június‎ ‎12‎. ‎2‎:‎00
 Címzett: cmake@cmake.org mailto:cmake@cmake.org
 
 In this example, how do I get
make foo.cc http://foo.cc/
 to work?
 
 0 Thu 16:56:19 yost DaveBook ~/p/c++/cmake/custom-command-target
 369 Z% bundle CMakeLists.txt genFoo
 #!/usr/bin/env unbundle
 # See http://yost.com/computers/bundle/ http://yost.com/computers/bundle/
  CMakeLists.txt
 cmake_minimum_required(VERSION 3.3.0)
 
 project(custom-command-target)
 
 
 add_custom_command (
   OUTPUT  foo.cc http://foo.cc/
   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo  foo.cc http://foo.cc/
   )
 
 add_executable (foo foo.cc http://foo.cc/)
 
  genFoo
 #!/bin/bash
 
 echo 
 int main() {
   return 0;
 }
 
 0 Thu 16:56:23 yost DaveBook ~/p/c++/cmake/custom-command-target
 370 Z% cd build
 0 Thu 16:56:36 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 371 Z% cmake ..
 -- Configuring done
 -- Generating done
 -- Build files have been written to: 
 /Users/yost/p/c++/cmake/custom-command-target/build
 0 Thu 16:56:41 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 372 Z% make clean  
 0 Thu 16:56:45 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 373 Z% make foo.cc http://foo.cc/  

 make: *** No rule to make target 'foo.cc http://foo.cc/'.  Stop.
 2 Thu 16:56:49 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 374 Z% 
 
 
 --
 
 Powered by www.kitware.com http://www.kitware.com/
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ 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 
 http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html 
 http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html 
 http://cmake.org/cmake/help/training.html
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html 
 http://www.kitware.com/opensource/opensource.html
 
 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/mailman/listinfo/cmake 
 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 

[cmake-developers] [CMake 0015614]: add_custom_target/command: Can't give Target the same name as one of the Outputs

2015-06-12 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://www.cmake.org/Bug/view.php?id=15614 
== 
Reported By:FlorianM
Assigned To:
== 
Project:CMake
Issue ID:   15614
Category:   CCMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2015-06-12 16:03 EDT
Last Modified:  2015-06-12 16:03 EDT
== 
Summary:add_custom_target/command: Can't give Target  the
same name as one of the Outputs
Description: 
Let's say you want to transfer the following makefile into a CMake equivalent:

foo_in: foo.c
$(CC) $ -o $@

foo_out: foo_in
post_process $  $@   

And you don't want to add the second step as a post-build step. You still want
to be able to build foo_in or foo_out separately.


Steps to Reproduce: 
I'm using the MSYS Makefiles generator with the following test script:

---

cmake_minimum_required(VERSION 2.8)
project(MakeTargetTest C)

file(WRITE foo.c #include windows.h\nint main() {})
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/post_process echo Process something)

add_executable(foo_in foo.c)
set_target_properties(foo_in PROPERTIES SUFFIX )

add_custom_command(
OUTPUT foo_out 
COMMAND post_process foo_in  foo_out
DEPENDS foo_in
)
add_custom_target(foo_out DEPENDS foo_out)

---

$ make foo_out
Built target foo_out

---

[build.make]
...
CMakeFiles/foo_out:

foo_out: CMakeFiles/foo_out
foo_out: CMakeFiles/foo_out.dir/build.make
.PHONY : foo_out

---

If I rename the custom target to something like foo_out_test it works
correctly:

$ make foo_out_test
Scanning dependencies of target foo_in
[ 50%] Building C object CMakeFiles/foo_in.dir/foo.c.obj
Linking C executable foo_in.
[ 50%] Built target foo_in
[100%] Generating foo_out
[100%] Built target foo_out_test

---

[build.make]
...
CMakeFiles/foo_out_test: foo_out

foo_out: foo_in.
$(CMAKE_COMMAND) -E cmake_progress_report CMakeFiles $(CMAKE_PROGRESS_1)
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold
Generating foo_out
post_process foo_in  foo_out

foo_out_test: CMakeFiles/foo_out_test
foo_out_test: foo_out
foo_out_test: CMakeFiles/foo_out_test.dir/build.make
.PHONY : foo_out_test


Additional Information: 
I understand that the Makefile generator could get confused by dependency that
could be a file and a target dependency, but why should this be possible for
executables and not for custom commands? And why could I not at least get a
warning or error by CMake during generation (since the rule generated is just
empty, see Steps to Reproduce)?

I can see 3 possible solutions:

1. The generator detects that there is a file and a target with the same name
and does add a suffix or prefix to its internal build rules for that file.

2. The add_custom_target() command is extended to allow to define its final
output which is then handled the same way a and add_executable() command output
file. 

3. Add an GENERIC (linker) language. So you could use files with any extensions
with add_executable() that are directly given to a definable linker.

== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2015-06-12 16:03 FlorianM   New 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


[CMake] Accessing source directory of a target

2015-06-12 Thread Robert Dailey
Hello,

Is there a SOURCE_DIR property for targets? I wasn't able to find
anything in the documentation on this, however I thought I saw
something similar to this a few years ago. I'm using CMake 3.2.
Basically I want the equivalent of CMAKE_CURRENT_SOURCE_DIR, but for a
specific project.

Documentation states you can do TARGET_SOURCE_DIR, but this value is
empty for me. Unless this is for projects, not targets (i.e. the value
passed to the project() command).

Thanks in advance.
-- 

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.3.0-rc2-148-g98133d3

2015-06-12 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  98133d3d4db5fe4cf5dbb0cd16235e19b753b55e (commit)
  from  03e22481886c6ea97440f54ef84df84969e5969f (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 -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98133d3d4db5fe4cf5dbb0cd16235e19b753b55e
commit 98133d3d4db5fe4cf5dbb0cd16235e19b753b55e
Author: Kitware Robot kwro...@kitware.com
AuthorDate: Sat Jun 13 00:01:05 2015 -0400
Commit: Kitware Robot kwro...@kitware.com
CommitDate: Sat Jun 13 00:01:05 2015 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ae16656..65b5f1f 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 3)
-set(CMake_VERSION_PATCH 20150612)
+set(CMake_VERSION_PATCH 20150613)
 #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 0015615]: ctest --output-on-failure doesn't work

2015-06-12 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=15615 
== 
Reported By:vinipsmaker
Assigned To:
== 
Project:CMake
Issue ID:   15615
Category:   CTest
Reproducibility:always
Severity:   major
Priority:   normal
Status: new
== 
Date Submitted: 2015-06-12 22:37 EDT
Last Modified:  2015-06-12 22:37 EDT
== 
Summary:ctest --output-on-failure doesn't work
Description: 
According to the documentation[1], the --output-on-failure argument will
instruct ctest to show the tests output when they fail. A second approach is to
set the env var CTEST_OUTPUT_ON_FAILURE. Neither option work for me.

As you can see on appveyor[2], some tests fail, but no output is given.

On GNU/Linux, setting the CTEST_OUTPUT_ON_FAILURE does work for me.

[1] http://www.cmake.org/cmake/help/v3.3/manual/ctest.1.html
[2]
https://ci.appveyor.com/project/vinipsmaker/boost-http/build/1.0.63/job/71vy3hxrx9clstju#L1028
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2015-06-12 22:37 vinipsmakerNew 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-developers] Generator expressions for output directory/name (and install?)

2015-06-12 Thread Robert Goulet
Here's the updated patch file with tests added. Let me know if it's good to go.

-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Thursday, June 11, 2015 8:55 AM
To: Robert Goulet
Cc: cmake-developers@cmake.org
Subject: Re: [cmake-developers] Generator expressions for output directory/name 
(and install?)

On 06/10/2015 01:43 PM, Robert Goulet wrote:
 Ok I think I got something nicely integrated now.

Thanks.  Here are some comments:

 +  std::string GetDestination(const char* config=nullptr) const;

Please avoid C++11 constructs.

 +std::string cmInstallGenerator::GetDestination(const char* config) 
 +const {
 +  std::string configName = config ? config : ConfigurationName;

This should be able to use std::string const as the argument type instead.  
Just have the call sites pass ConfigurationName themselves or create an 
argument-less overload that passes it for them.

Also please look at updating the test suite to cover this.  The 
Tests/ExportImport test has Export and Import sub-projects that test 
installation of all kinds of targets.  That may be a good place to add tests 
for DESTINATION.

Thanks,
-Brad



more-generator-expressions.patch
Description: more-generator-expressions.patch
-- 

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] Installing systemd service files that point to my installed location

2015-06-12 Thread Hendrik Sattler


Am 12. Juni 2015 16:46:47 MESZ, schrieb Matthew Karas mkarasc...@gmail.com:
This is probably and XY problem but...

I'm trying to install a systemd file in my cmake.

The service file needs to point at the installed destination of my
build after I make install.

I was trying to use  CONFIGURE_FILE

When I tried to do this - the variable is blank because the configure
file occurs during the cmake setup part - not the make install
DESTDIR=~/blah part.

Is there any way to configure files while I'm installing them, or to
configure a file as part of a post install script?

You should  not base generated file content on DESTDIR as this should be used 
e.g. for packaging to an intermediate directory. Use only CMAKE_INSTALL_PREFIX. 
You can use configure_file() for this.

HS



-- 

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] Installing systemd service files that point to my installed location

2015-06-12 Thread Matthew Karas
This is probably and XY problem but...

I'm trying to install a systemd file in my cmake.

The service file needs to point at the installed destination of my
build after I make install.

I was trying to use  CONFIGURE_FILE

When I tried to do this - the variable is blank because the configure
file occurs during the cmake setup part - not the make install
DESTDIR=~/blah part.

Is there any way to configure files while I'm installing them, or to
configure a file as part of a post install script?

Thanks,
Matt
-- 

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] output of add_custom_command as target in Makefile

2015-06-12 Thread Glenn Coombs
If you run make help it will list targets it understands.  And as you
pointed out there is no target for foo.cc.  You can make foo but if you
really want a target for foo.cc you can add one yourself:

cmake_minimum_required(VERSION 3.0.0)

project(custom-command-target)

add_custom_command (
  OUTPUT  foo.cc
  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo  foo.cc
  )

add_custom_target(foo.cc DEPENDS ${CMAKE_BINARY_DIR}/foo.cc)

add_executable (foo foo.cc)

That should create a foo.cc target that you can run that will do the right
thing.

--
Glenn

On 12 June 2015 at 14:20, Dave Yost d...@yost.com wrote:

 I’m not doing it wrong. Remember, this is a simplified example.

 We want to be able to make foo.cc so we can look at it and compare it.
 Yes, we could make foo and then look at foo.cc, but until foo.cc is
 right, we will suffer a lot of compiler error clutter. When foo.cc looks
 right, then we will make foo.

 BTW, changing add_custom_command to add_custom_target has no apparent
 effect and doesn’t help.

 On 2015-06-12, at 12:24 AM, Nagy-Egri Máté Ferenc csiga.b...@aol.com
 wrote:

 You’re doing it all wrong. You do not name source files as make targets,
 but the target name (or project name, I have no idea, because it rarely
 makes sense to name them differently). Try simply “foo”
 or “custom-command-target”. You would never say “make foo.cpp”, not even in
 an ordinary GNU Make script.

 *Feladó:* Dave Yost d...@yost.com
 *Elküldve:* ‎péntek‎, ‎2015‎. ‎június‎ ‎12‎. ‎2‎:‎00
 *Címzett:* cmake@cmake.org

 In this example, how do I get
make foo.cc
 to work?

 0 Thu 16:56:19 yost DaveBook ~/p/c++/cmake/custom-command-target
 369 Z% bundle CMakeLists.txt genFoo
 #!/usr/bin/env unbundle
 # See http://yost.com/computers/bundle/
  CMakeLists.txt
 cmake_minimum_required(VERSION 3.3.0)

 project(custom-command-target)


 add_custom_command (
   OUTPUT  foo.cc
   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo  foo.cc
   )

 add_executable (foo foo.cc)

  genFoo
 #!/bin/bash

 echo 
 int main() {
   return 0;
 }
 
 0 Thu 16:56:23 yost DaveBook ~/p/c++/cmake/custom-command-target
 370 Z% cd build
 0 Thu 16:56:36 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 371 Z% cmake ..
 -- Configuring done
 -- Generating done
 -- Build files have been written to:
 /Users/yost/p/c++/cmake/custom-command-target/build
 0 Thu 16:56:41 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 372 Z% make clean
 0 Thu 16:56:45 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 373 Z% make foo.cc
 make: *** No rule to make target 'foo.cc'.  Stop.
 2 Thu 16:56:49 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 374 Z%



 --

 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] option for gcov coverage and overriding optimization flag

2015-06-12 Thread Zaak Beekman
I’m having trouble determining the right way to enforce `-O0` optimization
level when the user selects a boolean cache entry to  enable code coverage
with gcov. I tried something like:

if ( ENABLE_CODE_COVERAGE )
  set ( CMAKE_Fortran_FLAGS “${CMAKE_Fortran_FLAGS} -fprofile-arcs
-ftest-coverage -O0” )

but the issue is that the CMAKE_Fortran_FLAGS_RELEASE|DEBUG|… flags get
appended to the compiler flags so gfortran gets passed something like:

`gfortran -fprofile-arcs -ftest-coverage -O0 … -O3 …`

and since the `-O3` the right-most optimization option it takes precedent
over `-O0`.

What is the correct way to either ensure that `-O0` comes after `-O3` when
the user selects ENABLE_CODE_COVERAGE=TRUE or remove `-O3` entirely? Note
that CMAKE_Fortran_FLAGS_… are all (advanced) cache variables, and I
would like to let advanced users have the option to re-enable optimization
here should they so choose…
-- 

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, next, updated. v3.3.0-rc2-449-g0753c59

2015-06-12 Thread Bill Hoffman
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  0753c59f4551e65b9f6d422def093f55da338ad9 (commit)
   via  3dfe9c05dfd7eb52e3ff6dc8da0d258070bb5fbd (commit)
   via  03e22481886c6ea97440f54ef84df84969e5969f (commit)
  from  870d4341f25524a1c58a25e2289f8c00ed584845 (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 -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0753c59f4551e65b9f6d422def093f55da338ad9
commit 0753c59f4551e65b9f6d422def093f55da338ad9
Merge: 870d434 3dfe9c0
Author: Bill Hoffman bill.hoff...@kitware.com
AuthorDate: Fri Jun 12 14:24:37 2015 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Fri Jun 12 14:24:37 2015 -0400

Merge topic 'fix_cuda_for_ccache' into next

3dfe9c05 Fix FindCUDA to only realpath the host compiler if it is clang 
linked to cc.
03e22481 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3dfe9c05dfd7eb52e3ff6dc8da0d258070bb5fbd
commit 3dfe9c05dfd7eb52e3ff6dc8da0d258070bb5fbd
Author: Bill Hoffman bill.hoff...@kitware.com
AuthorDate: Fri Jun 12 14:16:09 2015 -0400
Commit: Bill Hoffman bill.hoff...@kitware.com
CommitDate: Fri Jun 12 14:16:09 2015 -0400

Fix FindCUDA to only realpath the host compiler if it is clang linked to cc.

This fixes ccache on all other platforms.  CUDA with ccache failed because
it followed the symlink for ccache to cc and tried to use ccache directly
as a compiler.

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index e8e1fb1..f4b0783 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -468,17 +468,31 @@ set(CUDA_NVCC_FLAGS  CACHE STRING Semi-colon delimit 
multiple arguments.)
 if(CMAKE_GENERATOR MATCHES Visual Studio)
   set(CUDA_HOST_COMPILER $(VCInstallDir)bin CACHE FILEPATH Host side 
compiler used by NVCC)
 else()
-  # Using cc which is symlink to clang may let NVCC think it is GCC and issue
-  # unhandled -dumpspecs option to clang. Also in case neither
-  # CMAKE_C_COMPILER is defined (project does not use C language) nor
-  # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let
-  # nvcc use its own default C compiler.
-  if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER)
-get_filename_component(c_compiler_realpath ${CMAKE_C_COMPILER} REALPATH)
+  if(APPLE
+  AND ${CMAKE_C_COMPILER_ID} MATCHES Clang
+  AND ${CMAKE_C_COMPILER} MATCHES /cc$)
+# Using cc which is symlink to clang may let NVCC think it is GCC and issue
+# unhandled -dumpspecs option to clang. Also in case neither
+# CMAKE_C_COMPILER is defined (project does not use C language) nor
+# CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let
+# nvcc use its own default C compiler.
+# Only care about this on APPLE with clang to avoid
+# following symlinks to things like ccache
+if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER)
+  get_filename_component(c_compiler_realpath ${CMAKE_C_COMPILER} 
REALPATH)
+  # if the real path does not end up being clang then
+  # go back to using CMAKE_C_COMPILER
+  if(NOT ${c_compiler_realpath} MATCHES /clang$)
+set(c_compiler_realpath ${CMAKE_C_COMPILER})
+  endif()
+else()
+  set(c_compiler_realpath )
+endif()
+set(CUDA_HOST_COMPILER ${c_compiler_realpath} CACHE FILEPATH Host side 
compiler used by NVCC)
   else()
-set(c_compiler_realpath )
+set(CUDA_HOST_COMPILER ${CMAKE_C_COMPILER}
+  CACHE FILEPATH Host side compiler used by NVCC)
   endif()
-  set(CUDA_HOST_COMPILER ${c_compiler_realpath} CACHE FILEPATH Host side 
compiler used by NVCC)
 endif()
 
 # Propagate the host flags to the host compiler via -Xcompiler

---

Summary of changes:
 Modules/FindCUDA.cmake|   32 +++-
 Source/CMakeVersion.cmake |2 +-
 2 files changed, 24 insertions(+), 10 deletions(-)


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


Re: [CMake] output of add_custom_command as target in Makefile

2015-06-12 Thread Dave Yost
I’m not doing it wrong. Remember, this is a simplified example.

We want to be able to make foo.cc so we can look at it and compare it. Yes, we 
could make foo and then look at foo.cc, but until foo.cc is right, we will 
suffer a lot of compiler error clutter. When foo.cc looks right, then we will 
make foo.

BTW, changing add_custom_command to add_custom_target has no apparent effect 
and doesn’t help.

 On 2015-06-12, at 12:24 AM, Nagy-Egri Máté Ferenc csiga.b...@aol.com wrote:
 
 You’re doing it all wrong. You do not name source files as make targets, but 
 the target name (or project name, I have no idea, because it rarely makes 
 sense to name them differently). Try simply “foo” or “custom-command-target”. 
 You would never say “make foo.cpp”, not even in an ordinary GNU Make script.
 
 Feladó: Dave Yost mailto:d...@yost.com
 Elküldve: ‎péntek‎, ‎2015‎. ‎június‎ ‎12‎. ‎2‎:‎00
 Címzett: cmake@cmake.org mailto:cmake@cmake.org
 
 In this example, how do I get
make foo.cc http://foo.cc/
 to work?
 
 0 Thu 16:56:19 yost DaveBook ~/p/c++/cmake/custom-command-target
 369 Z% bundle CMakeLists.txt genFoo
 #!/usr/bin/env unbundle
 # See http://yost.com/computers/bundle/ http://yost.com/computers/bundle/
  CMakeLists.txt
 cmake_minimum_required(VERSION 3.3.0)
 
 project(custom-command-target)
 
 
 add_custom_command (
   OUTPUT  foo.cc http://foo.cc/
   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo  foo.cc http://foo.cc/
   )
 
 add_executable (foo foo.cc http://foo.cc/)
 
  genFoo
 #!/bin/bash
 
 echo 
 int main() {
   return 0;
 }
 
 0 Thu 16:56:23 yost DaveBook ~/p/c++/cmake/custom-command-target
 370 Z% cd build
 0 Thu 16:56:36 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 371 Z% cmake ..
 -- Configuring done
 -- Generating done
 -- Build files have been written to: 
 /Users/yost/p/c++/cmake/custom-command-target/build
 0 Thu 16:56:41 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 372 Z% make clean  
 0 Thu 16:56:45 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 373 Z% make foo.cc http://foo.cc/   
   
 make: *** No rule to make target 'foo.cc http://foo.cc/'.  Stop.
 2 Thu 16:56:49 yost DaveBook ~/p/c++/cmake/custom-command-target/build
 374 Z% 

-- 

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