[Cmake-commits] CMake branch, master, updated. v3.5.2-469-g0a05b2b

2016-04-19 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  0a05b2bd41e63d3695e79efb20d0c19314abcb9c (commit)
  from  7d4c99a957b37e6905af3fe6ea96b7fdf2b8359c (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=0a05b2bd41e63d3695e79efb20d0c19314abcb9c
commit 0a05b2bd41e63d3695e79efb20d0c19314abcb9c
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Wed Apr 20 00:01:05 2016 -0400
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Wed Apr 20 00:01:05 2016 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 3304213..c23d20d 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 20160419)
+set(CMake_VERSION_PATCH 20160420)
 #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] CMake: how to use 'for cyclic sentence' in command add_custom_command(...)

2016-04-19 Thread Chuck Atkins
Hi Chao,
As Konstantin alluded to, trying to pass "srtingified" shell scripting
through the layers of cmake and makefile escaping is bound to be fraught
with problems.  The necessary escaping will very quickly become
unmaintainable.  You're really best suited to place these in a separate
shell script (or cmake script to make it os-portable) and just call the
script from add_custom_command.
Hi Mr. Atkins,

Thanks a lot for your reply, and it worked well and help me a lot, there
still are some confusions about "for cyclic sentence".
I have tested some other case as below:
add_custom_target(temp_target ALL)
add_custom_command(TARGET temp_target
   POST_BUILD
   COMMAND
   if [ "$(dir_name)" = "test_dir" ]\;
   then
echo $(dir_name)\;
 for x in $$\(cat
$(file_name).txt\)\;
do echo $$x \;
echo $(file_name)\;
   done\;
   fi)
 Confusions:
1. I should use $$x in "for cyclic sentence", but i can not use $$(x) or
$$\(x\). And i can use "$$\(cat $(file_name).txt\)" and it worked well.
Even it worked when i use "$$x"(withdouble quote ).
2. When i make makefile, i use "make dir_name=test_dir
file_name=test_file", and i can get the value of dir_name and file_name by
use $(dir_name), $(file_name).

Thanks again for your help,
Chao Zhang

2016-04-19 22:20 GMT+08:00 Chuck Atkins :

> Hi Chao,
>
>
>> I was using 'for cyclic sentence' in command add_custom_command(...), the
>> content of the CMakeLists.txt as below:
>> add_custom_command(TARGET temp_target
>> POST_BUILD
>> COMMAND for x in a b c\;
>> do echo $x \;
>> done\;)
>>
>
> The $x is getting parsed by the makefile so you need to escape it with the
> $ makefile escape sequence.  Try:
>
> add_custom_command(TARGET temp_target
> POST_BUILD
> COMMAND for x in a b c\;
> do echo $$x \;
> done\;)
>
> You can see the difference in a make VERBOSE=1 :
>
> [100%] Linking C static library libtemp_target.a
> /home/
> khq.kitware.com/chuck.atkins/Code/CMake/build/master-release/bin/cmake -P
> CMakeFiles/temp_target.dir/cmake_clean_target.cmake
> /home/
> khq.kitware.com/chuck.atkins/Code/CMake/build/master-release/bin/cmake -E
> cmake_link_script CMakeFiles/temp_target.dir/link.txt --verbose=1
> /usr/bin/ar qc libtemp_target.a  CMakeFiles/temp_target.dir/foo.c.o
> /usr/bin/ranlib libtemp_target.a
> *for x in a b c; do echo  ; done;*
>
>
>
> make[2]: Leaving directory '/home/khq.kitware.com/chuck.atkins/tmp/bld'
>
> Now becomes:
>
> [100%] Linking C static library libtemp_target.a
> /home/
> khq.kitware.com/chuck.atkins/Code/CMake/build/master-release/bin/cmake -P
> CMakeFiles/temp_target.dir/cmake_clean_target.cmake
> /home/
> khq.kitware.com/chuck.atkins/Code/CMake/build/master-release/bin/cmake -E
> cmake_link_script CMakeFiles/temp_target.dir/link.txt --verbose=1
> /usr/bin/ar qc libtemp_target.a  CMakeFiles/temp_target.dir/foo.c.o
> /usr/bin/ranlib libtemp_target.a
>
>
>
> *for x in a b c; do echo $x ; done;abc*
> make[2]: Leaving directory '/home/khq.kitware.com/chuck.atkins/tmp/bld'
>
> - Chuck
>
>
>
-- 

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] How to add dependency relations between libs and executable

2016-04-19 Thread vakano
Hi, Chuck,

Thanks for your great help! "Lib_B and Lib_C, build before A" that is
exactly what I need.

So for this parallel project structure, an upper level cmakelist used to
organize and setup 

relationship with lib A, B, C right?

One more question is, if use the upper level cmake list, lib_B , lib_C can
be invoked directly 

without import in proj_a?

Thanks,
Le


Chuck Atkins wrote
>> cmake, the old top layer project is proj_a, which at the same layer with
>> proj_b and proj_c, if I add an extra top layer as the root you mentioned,
> 
> the generated make file structure will be changed, top layer make file
> 
> will be root instead of proj_a.
>>
>> Is there any way to add the dependency at proj_a level?
>>
> 
> If you want proj_a, proj_b, and proj_c to all be built by the same make
> command, then it makes sense to have a top level organization that
> encompasses them all.  Also, if proj_a, proj_b and proj_c don't make sense
> on their own and only when paired with each-other, then I would take the
> "project(...)" command out of each of them and only leave the top level.
> Basically, anything that has a project(...) command can be configured and
> built all on it's own without the rest of the tree.  In this case, it may
> make sense to keep b and c as independent projects but a as not since it
> needs b and c.  So for example, similar to Anatoly's example:
> 
> *folder*
> CMakeLists.txt:
> project(root)
> add_subdirectory(proj_b)
> add_subdirectory(proj_c)
> add_subdirectory(proj_a)
> 
> *folder/proj_a*
> CMakeLists.txt:
> add_executable(*A *main.cpp)
> target_link_libraries(*A B C*)
> 
> *folder/proj_b*
> CMakeLists.txt:
> project(proj_b)
> add_library(B proj_b.cpp)
> 
> *folder/proj_c*
> CMakeLists.txt:
> project(proj_c)
> add_library(*C *proj_c.cpp)
> 
> 
> With this structure, you can configure and build just project b or c:
> 
> $ mkdir build_c
> $ cd build_c
> $ cmake /path/to/folder/proj_c
> ...
> $ make
> ...
> 
> You end up with libC.a .  Similarly, you could do that for proj_b and get
> libB.a.  Or, if you configure the top level project instead:
> 
> $ mkdir build_all
> $ cd build_all
> $ cmake /path/to/folder
> ...
> $ make
> Scanning dependencies of target B
> [ 16%] Building CXX object proj_b/CMakeFiles/B.dir/proj_b.o
> [ 33%] Linking CXX static library libB.a
> [ 33%] Built target B
> Scanning dependencies of target C
> [ 50%] Building CXX object proj_c/CMakeFiles/C.dir/proj_c.o
> [ 66%] Linking CXX static library libC.a
> [ 66%] Built target C
> Scanning dependencies of target A
> [ 83%] Building CXX object proj_a/CMakeFiles/A.dir/main.o
> [100%] Linking CXX executable A
> [100%] Built target A
> $
> 
> You end up with proj_b/libB.a, proj_c/libC.a, and proj_a/A which is linked
> with libB.a and libC.a.  You can also do a parallel make with make
> -j(whatever) adn the generated dependencies will make sure that targets
> and
> individual files are built in the right order.  Technically speaking, you
> don't *need* to have a CMakeLists.txt at each level and you could put it
> all in to one top level CMakeLists.txt but it's generally considered poor
> CMake code to do so.  A good rule of thumb is to have a CMakeLsits.txt
> file
> at each level that a target (i.e. a library or executable) is built and a
> top level CMakeLists.txt to tie it all together.  This is the same sort of
> approach you see with autoconf where it's typical to have a Makefile.am at
> each level.
> 
> -- 
> 
> 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






--
View this message in context: 
http://cmake.3232098.n2.nabble.com/How-to-add-dependency-relations-between-libs-and-executable-tp7593264p7593293.html
Sent from the CMake mailing list archive at Nabble.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


[cmake-developers] [PATCH] Always define Boost::boost imported target

2016-04-19 Thread Roger Leigh
For https://cmake.org/Bug/view.php?id=16057 I have merged the 
boost-import-default branch into next for testing.  This includes a unit 
test to verify that the basic boost headers work in the absence of 
COMPONENTS being specified with find_package.



Regards,
Roger

--
Dr Roger Leigh -- Open Microscopy Environment
Wellcome Trust Centre for Gene Regulation and Expression,
School of Life Sciences, University of Dundee, Dow Street,
Dundee DD1 5EH Scotland UK   Tel: (01382) 386364
--

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.2-1018-g5155d7b

2016-04-19 Thread Roger Leigh
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  5155d7b2854231156b66e2359742585ce7b38973 (commit)
   via  2c1b720e643aafd725a8c0be11913834704d7269 (commit)
  from  c6ab628a0bbcd23229537a00fddbbc7bd9c617e9 (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=5155d7b2854231156b66e2359742585ce7b38973
commit 5155d7b2854231156b66e2359742585ce7b38973
Merge: c6ab628 2c1b720
Author: Roger Leigh 
AuthorDate: Tue Apr 19 17:17:18 2016 -0400
Commit: CMake Topic Stage 
CommitDate: Tue Apr 19 17:17:18 2016 -0400

Merge topic 'boost-import-default' into next

2c1b720e FindBoost: Define Boost::boost for all boost versions


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c1b720e643aafd725a8c0be11913834704d7269
commit 2c1b720e643aafd725a8c0be11913834704d7269
Author: Roger Leigh 
AuthorDate: Sun Apr 17 16:24:51 2016 +0100
Commit: Roger Leigh 
CommitDate: Tue Apr 19 22:07:45 2016 +0100

FindBoost: Define Boost::boost for all boost versions

diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 9e6083d..38ccf78 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -1573,7 +1573,7 @@ endif()
 #  Add imported targets
 # 
 
-if(Boost_FOUND AND _Boost_IMPORTED_TARGETS)
+if(Boost_FOUND)
   # For header-only libraries
   if(NOT TARGET Boost::boost)
 add_library(Boost::boost INTERFACE IMPORTED)
@@ -1584,7 +1584,7 @@ if(Boost_FOUND AND _Boost_IMPORTED_TARGETS)
   endif()
 
   foreach(COMPONENT ${Boost_FIND_COMPONENTS})
-if(NOT TARGET Boost::${COMPONENT})
+if(_Boost_IMPORTED_TARGETS AND NOT TARGET Boost::${COMPONENT})
   string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
   if(Boost_${UPPERCOMPONENT}_FOUND)
 if(Boost_USE_STATIC_LIBS)
diff --git a/Tests/CFBundleTest/Localized.rsrc 
b/Tests/CFBundleTest/Localized.rsrc
index cbf3523..7973c1f 100644
Binary files a/Tests/CFBundleTest/Localized.rsrc and 
b/Tests/CFBundleTest/Localized.rsrc differ
diff --git a/Tests/FindBoost/CMakeLists.txt b/Tests/FindBoost/CMakeLists.txt
index 259ee26..0e9527d 100644
--- a/Tests/FindBoost/CMakeLists.txt
+++ b/Tests/FindBoost/CMakeLists.txt
@@ -8,3 +8,14 @@ add_test(NAME FindBoost.Test COMMAND
   --build-options ${build_options}
   --test-command ${CMAKE_CTEST_COMMAND} -V -C $
   )
+
+add_test(NAME FindBoost.TestHeaders COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindBoost/TestHeaders"
+  "${CMake_BINARY_DIR}/Tests/FindBoost/TestHeaders"
+  ${build_generator_args}
+  --build-project TestFindBoostHeaders
+  --build-options ${build_options}
+  --test-command ${CMAKE_CTEST_COMMAND} -V -C $
+  )
diff --git a/Tests/FindBoost/TestHeaders/CMakeLists.txt 
b/Tests/FindBoost/TestHeaders/CMakeLists.txt
new file mode 100644
index 000..d7be327
--- /dev/null
+++ b/Tests/FindBoost/TestHeaders/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.1)
+project(TestFindBoostHeaders CXX)
+include(CTest)
+
+find_package(Boost REQUIRED)
+
+add_executable(test_boost_headers_tgt main.cxx)
+target_link_libraries(test_boost_headers_tgt
+  Boost::boost)
+add_test(NAME test_boost_headers_tgt COMMAND test_boost_headers_tgt)
diff --git a/Tests/FindBoost/TestHeaders/main.cxx 
b/Tests/FindBoost/TestHeaders/main.cxx
new file mode 100644
index 000..0400d6d
--- /dev/null
+++ b/Tests/FindBoost/TestHeaders/main.cxx
@@ -0,0 +1,9 @@
+#include 
+
+int main() {
+  boost::any a;
+  a = 5;
+  a = std::string("A string");
+
+  return 0;
+}

---

Summary of changes:
 Modules/FindBoost.cmake|4 ++--
 Tests/CFBundleTest/Localized.rsrc  |  Bin 496 -> 472 bytes
 Tests/FindBoost/CMakeLists.txt |   11 +++
 Tests/FindBoost/TestHeaders/CMakeLists.txt |   10 ++
 Tests/FindBoost/TestHeaders/main.cxx   |9 +
 5 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 Tests/FindBoost/TestHeaders/CMakeLists.txt
 create mode 100644 Tests/FindBoost/TestHeaders/main.cxx


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


[Cmake-commits] CMake branch, next, updated. v3.5.2-1016-gc6ab628

2016-04-19 Thread Rolf Eike Beer
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  c6ab628a0bbcd23229537a00fddbbc7bd9c617e9 (commit)
   via  06a0fa869dd7acdba36695b708fd9afb84ce9bc2 (commit)
   via  d92e01128fd94fea7c3a978ffc1d63d9921c4253 (commit)
  from  7915a626cf12b63db199f34834f743b8724de8ad (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=c6ab628a0bbcd23229537a00fddbbc7bd9c617e9
commit c6ab628a0bbcd23229537a00fddbbc7bd9c617e9
Merge: 7915a62 06a0fa8
Author: Rolf Eike Beer 
AuthorDate: Tue Apr 19 17:08:24 2016 -0400
Commit: CMake Topic Stage 
CommitDate: Tue Apr 19 17:08:24 2016 -0400

Merge topic 'addcachedefinition-string' into next

06a0fa86 port to new version of cmMakefile::AddCacheDefinition() where 
possible
d92e0112 add an overload of cmMakefile::AddCacheDefinition() that takes a 
std::string


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06a0fa869dd7acdba36695b708fd9afb84ce9bc2
commit 06a0fa869dd7acdba36695b708fd9afb84ce9bc2
Author: Rolf Eike Beer 
AuthorDate: Tue Apr 19 21:59:23 2016 +0200
Commit: Rolf Eike Beer 
CommitDate: Tue Apr 19 22:54:22 2016 +0200

port to new version of cmMakefile::AddCacheDefinition() where possible

diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index 64d4fca..f1b326d 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -143,7 +143,7 @@ bool cmBuildCommand
 return true;
 }
   this->Makefile->AddCacheDefinition(define,
- makecommand.c_str(),
+ makecommand,
  "Command used to build entire project "
  "from the command line.",
  cmState::STRING);
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index 2733d76..86b8ef2 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -37,7 +37,7 @@ bool cmBuildNameCommand
   cmSystemTools::ReplaceString(cv,"(", "_");
   cmSystemTools::ReplaceString(cv,")", "_");
   this->Makefile->AddCacheDefinition(args[0],
- cv.c_str(),
+ cv,
  "Name of build.",
  cmState::STRING);
   }
@@ -72,7 +72,7 @@ bool cmBuildNameCommand
")", "_");
 
   this->Makefile->AddCacheDefinition(args[0],
- buildname.c_str(),
+ buildname,
  "Name of build.",
  cmState::STRING);
   return true;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx 
b/Source/cmExtraEclipseCDT4Generator.cxx
index 9e67301..ec5f296 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -241,7 +241,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& 
out,
 // The variable is in the env, but not in the cache. Use it and put it
 // in the cache
 valueToUse = envVarValue;
-mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
+mf->AddCacheDefinition(cacheEntryName, valueToUse,
cacheEntryName.c_str(), cmState::STRING,
true);
 mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
@@ -262,7 +262,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& 
out,
 if (valueToUse.find(envVarValue) == std::string::npos)
   {
   valueToUse = envVarValue;
-  mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
+  mf->AddCacheDefinition(cacheEntryName, valueToUse,
  cacheEntryName.c_str(), cmState::STRING,
  true);
   mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index e7696af..9e74efc 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -68,14 +68,14 @@ bool cmFindLibraryCommand
 {
 // Save the value in the cache
 this->Makefile->AddCacheDefinition(this->VariableName,
-   library.c_str(),
+   library,
this->VariableDocumentation.c_str(),
cmState::FILEPATH);
 return true;
 }
   std::string notfound = 

Re: [cmake-developers] Autogen subdirectories patches

2016-04-19 Thread Sebastian Holtermann

Am 19.04.2016 um 19:28 schrieb Brad King:

On 04/19/2016 11:09 AM, Sebastian Holtermann wrote:

https://cmake.org/Bug/view.php?id=12873
https://cmake.org/Bug/view.php?id=16068

They introduce
- same name collision checks during moc/qrc/ui generation
- moc/qrc generation in subdirectories to support
sources with the name in different subdirectories
- A test for equally named sources in different subdirectories

Please review.


Thanks!  I've applied them locally and merged the cleanup/refactoring
commits to 'next' for testing first.  Once those test cleanly I'll move
on to the rest.



Ok, thanks.

-Sebastian


--

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] Replace `ctest` command with `ctest --output-on-failure`

2016-04-19 Thread Muhammad Osama
Hi,

Is there a way I can replace ctest command with ctest --some-flag in
CMakeLists.txt? So, when my users run cmake, make and ctest. They are
actually performing cmake, make and ctest --some-flag? I don't want them to
worry about the flag and just type ctest.

Thank you,
-- 
*Muhammad Osama*
-- 

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] How to add dependency relations between libs and executable

2016-04-19 Thread Chuck Atkins
> cmake, the old top layer project is proj_a, which at the same layer with
> proj_b and proj_c, if I add an extra top layer as the root you mentioned,

the generated make file structure will be changed, top layer make file

will be root instead of proj_a.
>
> Is there any way to add the dependency at proj_a level?
>

If you want proj_a, proj_b, and proj_c to all be built by the same make
command, then it makes sense to have a top level organization that
encompasses them all.  Also, if proj_a, proj_b and proj_c don't make sense
on their own and only when paired with each-other, then I would take the
"project(...)" command out of each of them and only leave the top level.
Basically, anything that has a project(...) command can be configured and
built all on it's own without the rest of the tree.  In this case, it may
make sense to keep b and c as independent projects but a as not since it
needs b and c.  So for example, similar to Anatoly's example:

*folder*
CMakeLists.txt:
project(root)
add_subdirectory(proj_b)
add_subdirectory(proj_c)
add_subdirectory(proj_a)

*folder/proj_a*
CMakeLists.txt:
add_executable(*A *main.cpp)
target_link_libraries(*A B C*)

*folder/proj_b*
CMakeLists.txt:
project(proj_b)
add_library(B proj_b.cpp)

*folder/proj_c*
CMakeLists.txt:
project(proj_c)
add_library(*C *proj_c.cpp)


With this structure, you can configure and build just project b or c:

$ mkdir build_c
$ cd build_c
$ cmake /path/to/folder/proj_c
...
$ make
...

You end up with libC.a .  Similarly, you could do that for proj_b and get
libB.a.  Or, if you configure the top level project instead:

$ mkdir build_all
$ cd build_all
$ cmake /path/to/folder
...
$ make
Scanning dependencies of target B
[ 16%] Building CXX object proj_b/CMakeFiles/B.dir/proj_b.o
[ 33%] Linking CXX static library libB.a
[ 33%] Built target B
Scanning dependencies of target C
[ 50%] Building CXX object proj_c/CMakeFiles/C.dir/proj_c.o
[ 66%] Linking CXX static library libC.a
[ 66%] Built target C
Scanning dependencies of target A
[ 83%] Building CXX object proj_a/CMakeFiles/A.dir/main.o
[100%] Linking CXX executable A
[100%] Built target A
$

You end up with proj_b/libB.a, proj_c/libC.a, and proj_a/A which is linked
with libB.a and libC.a.  You can also do a parallel make with make
-j(whatever) adn the generated dependencies will make sure that targets and
individual files are built in the right order.  Technically speaking, you
don't *need* to have a CMakeLists.txt at each level and you could put it
all in to one top level CMakeLists.txt but it's generally considered poor
CMake code to do so.  A good rule of thumb is to have a CMakeLsits.txt file
at each level that a target (i.e. a library or executable) is built and a
top level CMakeLists.txt to tie it all together.  This is the same sort of
approach you see with autoconf where it's typical to have a Makefile.am at
each level.
-- 

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] Patch for BundleUtilities to ignore specified files

2016-04-19 Thread Brad King
On 04/19/2016 02:03 AM, Roman Wüger wrote:
> attached is an updated patch.

Thanks.  Applied:

 BundleUtilities: Add optional parameter to ignore specified files
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26c92d50

-Brad

-- 

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.5.2-1013-g7915a62

2016-04-19 Thread Zack Galbreath
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  7915a626cf12b63db199f34834f743b8724de8ad (commit)
   via  5de122dfa4a1f60dae736d9f29e588cfd5ce0416 (commit)
   via  7d4c99a957b37e6905af3fe6ea96b7fdf2b8359c (commit)
  from  fd11289f48d52302cf433cfe2a800120a4766f35 (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=7915a626cf12b63db199f34834f743b8724de8ad
commit 7915a626cf12b63db199f34834f743b8724de8ad
Merge: fd11289 5de122d
Author: Zack Galbreath 
AuthorDate: Tue Apr 19 13:36:40 2016 -0400
Commit: CMake Topic Stage 
CommitDate: Tue Apr 19 13:36:40 2016 -0400

Merge topic 'coverage_collect_delete' into next

5de122df CTestCoverageCollectGCOV: improve DELETE option
7d4c99a9 CMake Nightly Date Stamp


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5de122dfa4a1f60dae736d9f29e588cfd5ce0416
commit 5de122dfa4a1f60dae736d9f29e588cfd5ce0416
Author: Zack Galbreath 
AuthorDate: Tue Apr 19 13:19:10 2016 -0400
Commit: Zack Galbreath 
CommitDate: Tue Apr 19 13:19:10 2016 -0400

CTestCoverageCollectGCOV: improve DELETE option

The DELETE option to ctest_coverage_collect_gcov now properly
removes all the .gcov files that were created by this function.
Previously it left behind any files that were excluded by
CTEST_CUSTOM_COVERAGE_EXCLUDE.

This option now also deletes the following files/directory that
are created by ctest_coverage_collect_gcov:
  data.json
  coverage_file_list.txt
  the uncovered/ directory

diff --git a/Modules/CTestCoverageCollectGCOV.cmake 
b/Modules/CTestCoverageCollectGCOV.cmake
index 31c4fef..a04d340 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -287,10 +287,14 @@ ${uncovered_files_for_tar}
 WORKING_DIRECTORY ${binary_dir})
 
   if (GCOV_DELETE)
-string(REPLACE "\n" ";" gcov_files "${gcov_files}")
-foreach(gcov_file ${gcov_files})
+foreach(gcov_file ${unfiltered_gcov_files})
   file(REMOVE ${binary_dir}/${gcov_file})
 endforeach()
+file(REMOVE ${coverage_dir}/coverage_file_list.txt)
+file(REMOVE ${coverage_dir}/data.json)
+if (EXISTS ${binary_dir}/uncovered)
+  file(REMOVE ${binary_dir}/uncovered)
+endif()
   endif()
 
 endfunction()

---

Summary of changes:
 Modules/CTestCoverageCollectGCOV.cmake |8 ++--
 Source/CMakeVersion.cmake  |2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)


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


[Cmake-commits] CMake branch, next, updated. v3.5.2-1010-gfd11289

2016-04-19 Thread Brad King
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  fd11289f48d52302cf433cfe2a800120a4766f35 (commit)
   via  26c92d50fd79eada348aaf7ff4190db2b8c47028 (commit)
  from  e2559d1d4c41819cb3e1f1353249b19f041e3732 (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=fd11289f48d52302cf433cfe2a800120a4766f35
commit fd11289f48d52302cf433cfe2a800120a4766f35
Merge: e2559d1 26c92d5
Author: Brad King 
AuthorDate: Tue Apr 19 13:26:52 2016 -0400
Commit: CMake Topic Stage 
CommitDate: Tue Apr 19 13:26:52 2016 -0400

Merge topic 'BundleUtilities-optional-exclude' into next

26c92d50 BundleUtilities: Add optional parameter to ignore specified files


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26c92d50fd79eada348aaf7ff4190db2b8c47028
commit 26c92d50fd79eada348aaf7ff4190db2b8c47028
Author: Roman Wüger 
AuthorDate: Tue Apr 19 07:59:06 2016 +0200
Commit: Brad King 
CommitDate: Tue Apr 19 13:20:15 2016 -0400

BundleUtilities: Add optional parameter to ignore specified files

diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 4b52afa..cfb6450 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -52,6 +52,9 @@
 # Then clear all the keys and call verify_app on the final bundle to
 # ensure that it is truly standalone.
 #
+# As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
+# which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
+#
 # ::
 #
 #   COPY_AND_FIXUP_BUNDLE(   )
@@ -67,6 +70,9 @@
 # analysis tools on it.  Calls "message(FATAL_ERROR" if the application
 # is not verified.
 #
+# As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
+# which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
+#
 # ::
 #
 #   GET_BUNDLE_MAIN_EXECUTABLE( )
@@ -140,6 +146,9 @@
 # all of them and copy prerequisite libs into the bundle and then do
 # appropriate install_name_tool fixups.
 #
+# As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
+# which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
+#
 # ::
 #
 #   COPY_RESOLVED_ITEM_INTO_BUNDLE( )
@@ -196,6 +205,9 @@
 # bundle are contained within the bundle or are "system" libraries,
 # presumed to exist everywhere.
 #
+# As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
+# which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
+#
 # ::
 #
 #   VERIFY_BUNDLE_SYMLINKS(  )
@@ -525,6 +537,11 @@ endfunction()
 function(get_bundle_keys app libs dirs keys_var)
   set(${keys_var} PARENT_SCOPE)
 
+  set(options)
+  set(oneValueArgs)
+  set(multiValueArgs IGNORE_ITEM)
+  cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" 
${ARGN} )
+
   get_bundle_and_executable("${app}" bundle executable valid)
   if(valid)
 # Always use the exepath of the main bundle executable for @executable_path
@@ -554,10 +571,24 @@ function(get_bundle_keys app libs dirs keys_var)
   set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" 
"${dirs}" 0 "${main_rpaths}")
 
   set(prereqs "")
-  get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}" 
"${main_rpaths}")
-  foreach(pr ${prereqs})
-set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" 
"${dirs}" 1 "${main_rpaths}")
-  endforeach()
+  set(ignoreFile FALSE)
+  get_filename_component(prereq_filename ${lib} NAME)
+  if(NOT "${CFG_IGNORE_ITEM}" STREQUAL "" )
+foreach(item ${CFG_IGNORE_ITEM})
+if("${item}" STREQUAL "${prereq_filename}")
+  set(ignoreFile TRUE)
+endif()
+endforeach()
+  endif()
+
+  if(NOT ignoreFile)
+get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}" 
"${main_rpaths}")
+foreach(pr ${prereqs})
+  set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" 
"${dirs}" 1 "${main_rpaths}")
+endforeach()
+  else()
+message(STATUS "Ignoring file: ${prereq_filename}")
+  endif()
 endforeach()
 
 # For each executable found in the bundle, accumulate keys as we go.
@@ -583,10 +614,24 @@ function(get_bundle_keys app libs dirs keys_var)
   # Add each prerequisite to the keys:
   #
   set(prereqs "")
-  get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}" 
"${exe_rpaths}")
-  foreach(pr ${prereqs})
-set_bundle_key_values(${keys_var} "${exe}" 

Re: [cmake-developers] Autogen subdirectories patches

2016-04-19 Thread Brad King
On 04/19/2016 11:09 AM, Sebastian Holtermann wrote:
> https://cmake.org/Bug/view.php?id=12873
> https://cmake.org/Bug/view.php?id=16068
> 
> They introduce
> - same name collision checks during moc/qrc/ui generation
> - moc/qrc generation in subdirectories to support
>sources with the name in different subdirectories
> - A test for equally named sources in different subdirectories
> 
> Please review.

Thanks!  I've applied them locally and merged the cleanup/refactoring
commits to 'next' for testing first.  Once those test cleanly I'll move
on to the rest.

-Brad

-- 

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] Patch for BundleUtilities to ignore specified files

2016-04-19 Thread Brad King
On 04/19/2016 02:03 AM, Roman Wüger wrote:
> attached is an updated patch.

Thanks.  Applied:

 BundleUtilities: Add optional parameter to ignore specified files
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26c92d50

-Brad

-- 

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.2-1008-ge2559d1

2016-04-19 Thread Brad King
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  e2559d1d4c41819cb3e1f1353249b19f041e3732 (commit)
   via  840b830bc6a76afe207bc08ca164eaabb731acaf (commit)
   via  bc4c7751ab4ae28770f5bcf3595e632c40026be2 (commit)
   via  47e60bc5a09f5b3a71ce015025cd93af4270afb5 (commit)
   via  cf679ea8dcd04c1217cd7c664117439fdd370f10 (commit)
   via  3ea1d09082de6b5ed4fbb7f9be04a0172c01c0be (commit)
   via  8ced8bb95aee78ece751259f9cce23786fe4a1b2 (commit)
   via  95064a6d35c93557c9bb87bc8eeff8555d7295a2 (commit)
   via  7a73c404dd63aef0e68da9ef70ac706a6339c476 (commit)
  from  7faf4c230e2915fb670f395d981fa69ada9fc327 (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=e2559d1d4c41819cb3e1f1353249b19f041e3732
commit e2559d1d4c41819cb3e1f1353249b19f041e3732
Merge: 7faf4c2 840b830
Author: Brad King 
AuthorDate: Tue Apr 19 13:13:55 2016 -0400
Commit: CMake Topic Stage 
CommitDate: Tue Apr 19 13:13:55 2016 -0400

Merge topic 'autogen-cleanups' into next

840b830b Autogen: Qrc processing: Generate single map with final input / 
output names
bc4c7751 Autogen: Ui processing: Generate single map with final input / 
output names
47e60bc5 Autogen: Split out UI file generation code to dedicated method
cf679ea8 Autogen: Split out moc file generation code to dedicated method
3ea1d090 Autogen: Rename method GenerateQrc{ => Files}
8ced8bb9 Autogen: New logCommand method. It prints commands using std::cout.
95064a6d Autogen: Rename header extension Join method to JoinExts
7a73c404 Autogen: Use SystemTools string functions instead of rolling out 
own


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=840b830bc6a76afe207bc08ca164eaabb731acaf
commit 840b830bc6a76afe207bc08ca164eaabb731acaf
Author: Sebastian Holtermann 
AuthorDate: Mon Apr 18 17:52:00 2016 +0200
Commit: Brad King 
CommitDate: Tue Apr 19 12:59:13 2016 -0400

Autogen: Qrc processing: Generate single map with final input / output names

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index b75868e..c07a0a6 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1351,64 +1351,92 @@ bool cmQtAutoGenerators::InputFilesNewerThanQrc(const 
std::string& qrcFile,
 
 bool cmQtAutoGenerators::GenerateQrcFiles()
 {
+  // generate single map with input / output names
+  std::map qrcGenMap;
   for(std::vector::const_iterator si = this->RccSources.begin();
   si != this->RccSources.end(); ++si)
 {
-std::string ext = cmsys::SystemTools::GetFilenameLastExtension(*si);
-
-if (ext != ".qrc")
+const std::string ext = cmsys::SystemTools::GetFilenameLastExtension(*si);
+if (ext == ".qrc")
   {
-  continue;
+  std::string basename = cmsys::SystemTools::
+GetFilenameWithoutLastExtension(*si);
+  std::string qrcOutputFile = "CMakeFiles/" + this->OriginTargetName
++ ".dir/qrc_" + basename + ".cpp";
+  qrcGenMap[*si] = qrcOutputFile;
   }
-std::vector command;
-command.push_back(this->RccExecutable);
+}
 
-std::string basename = cmsys::SystemTools::
-  GetFilenameWithoutLastExtension(*si);
+  // generate qrc files
+  for(std::map::const_iterator
+  si = qrcGenMap.begin(); si != qrcGenMap.end(); ++si)
+{
+if (!this->GenerateQrc( si->first, si->second))
+  {
+  if (this->RunRccFailed)
+{
+return false;
+}
+  }
+}
+  return true;
+}
 
-std::string rcc_output_file = this->Builddir
-+ "CMakeFiles/" + this->OriginTargetName
-+ ".dir/qrc_" + basename + ".cpp";
+bool cmQtAutoGenerators::GenerateQrc (
+  const std::string& qrcInputFile,
+  const std::string& qrcOutputFile )
+{
+  const std::string basename = cmsys::SystemTools::
+GetFilenameWithoutLastExtension(qrcInputFile);
+  const ::std::string qrcBuildFile = this->Builddir + qrcOutputFile;
+
+  int sourceNewerThanQrc = 0;
+  bool generateQrc = !cmsys::SystemTools::FileTimeCompare(qrcInputFile,
+  qrcBuildFile,
+  );
+  generateQrc = generateQrc || (sourceNewerThanQrc >= 0);
+  generateQrc = generateQrc || this->InputFilesNewerThanQrc(qrcInputFile,
+qrcBuildFile);
+
+  if 

Re: [CMake] CMakeLists.txt: How to print a message if ctest fails?

2016-04-19 Thread Muhammad Osama
Hi Miroslav,

That makes sense, is there a way I can make  ctest -S CTestScript.cmake command
replace the regular ctest? I don't want users who run ctest type the whole
thing.

Thank you,

On Tue, Apr 19, 2016 at 1:18 AM, Matějů Miroslav, Ing. <
mateju.miros...@azd.cz> wrote:

> Hi Muhammad,
>
>
>
> You need to add this code to a separate CTest script (CTestScript.cmake,
> for example) and then run it using ctest -S CTestScript.cmake. Since the
> wiki page I linked yesterday provides only some complex examples, I am
> sending the key part of my CTest script. As you can see, its operation
> strongly depends on environment variables (some of them are provided by
> Windows). You’ll probably need to remove most of my if’s.
>
>
>
> set(CTEST_SOURCE_DIRECTORY "$ENV{SCRIPT_FOLDER}")
>
> set(CTEST_BINARY_DIRECTORY "$ENV{BINARY_PROJECT_FOLDER}")
>
>
>
> set(CTEST_SITE  $ENV{COMPUTERNAME})
>
> set(CTEST_BUILD_NAME$ENV{TEST_CASE_NAME})
>
>
>
> ctest_start()
>
>
>
> ctest_configure(RETURN_VALUE configure_failed)
>
>
>
> if($ENV{DO_UPDATE})
>
>   ctest_update()
>
> endif($ENV{DO_UPDATE})
>
>
>
> if($ENV{DO_BUILD})
>
>   ctest_build(RETURN_VALUE build_failed)
>
> endif($ENV{DO_BUILD})
>
>
>
> if   (($ENV{DO_TEST}) AND NOT (configure_failed OR build_failed))
>
>   ctest_test(RETURN_VALUE test_failed)
>
> endif(($ENV{DO_TEST}) AND NOT (configure_failed OR build_failed))
>
>
>
> if($ENV{DO_DASHBOARD})
>
>   ctest_submit()
>
> endif($ENV{DO_DASHBOARD})
>
>
>
> if   (configure_failed OR build_failed OR test_failed)
>
>   message(FATAL_ERROR "Test ${CTEST_BUILD_NAME} failed.")  # sets return
> value to -1
>
> endif(configure_failed OR build_failed OR test_failed)
>
>
>
> Best regards,
>
> Miroslav
>
>
>
> *From:* Muhammad Osama [mailto:osam...@gmail.com]
> *Sent:* Monday, April 18, 2016 8:33 PM
> *To:* Matějů Miroslav, Ing.
> *Cc:* cmake@cmake.org
> *Subject:* Re: [CMake] CMakeLists.txt: How to print a message if ctest
> fails?
>
>
>
> Hi Miroslav,
>
>
>
> Thank you for replying! I added this in my root CMakeLists.txt, purposely
> made the ctest's test fail but didn't get the output message.
>
> Is this script suppose to be added inside CMakeLists.txt? Or am I doing
> this incorrectly?
>
>
>
> Thanks again,
>
>
>
> On Mon, Apr 18, 2016 at 6:30 AM, Matějů Miroslav, Ing. <
> mateju.miros...@azd.cz> wrote:
>
> Hi Muhammad,
>
> you can use a CTest script, see
> https://cmake.org/Wiki/CMake_Scripting_Of_CTest for details. I use the
> following code in my CTest script:
>
>
>
> if(configure_failed OR build_failed OR test_failed)
>
> message(FATAL_ERROR "Test ${CTEST_BUILD_NAME} failed.")
>
> endif()
>
>
>
> Best regards,
>
> Miroslav
>
>
>
> *From:* CMake [mailto:cmake-boun...@cmake.org] *On Behalf Of *Muhammad
> Osama
> *Sent:* Friday, April 15, 2016 8:53 PM
> *To:* cmake@cmake.org
> *Subject:* [CMake] CMakeLists.txt: How to print a message if ctest fails?
>
>
>
> Is there a way I can setup CMakeLists.txt to print a message if ctest
> tests fail? For example:
>
> cmake ..
> make
> ctest // fails
> message output: Please contact x...@mail.com to resolve testing problems.
>
> ​Note the message output is not for cmake but for ctest.​
>
>
>
> --​​
>
> Muhammad
>
>
>
>
>
> --
>
> *Muhammad*
>



-- 
*Muhammad*
-- 

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] [CMake 0016071]: CMake should map /Fd to COMPILE_PDB_NAME for static libraries

2016-04-19 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://cmake.org/Bug/view.php?id=16071 
== 
Reported By:Itai Seggev
Assigned To:
== 
Project:CMake
Issue ID:   16071
Category:   CMake
Reproducibility:always
Severity:   feature
Priority:   normal
Status: new
== 
Date Submitted: 2016-04-19 13:02 EDT
Last Modified:  2016-04-19 13:02 EDT
== 
Summary:CMake should map /Fd to COMPILE_PDB_NAME for static
libraries
Description: 
This is a follow up to https://cmake.org/Bug/view.php?id=14763 and its
predecessors https://cmake.org/Bug/view.php?id=14060 /
https://cmake.org/Bug/view.php?id=14062

/Fd was separated from PDB_NAME, because normally what we want is the linker
pdb.  However, if our final product is the static library, then we do want to
the compiler PDB file, so COMPILE_PDB_NAME was added.  Yet, a mapping was not
added between COMPILE_PDB_NAME and /Fd.  The result is /Fd is added to compile
flags but COMPILE_PDB_NAME remains at its default value, and an inconsistency is
created between Visual Studio and NMake generators.  For the former, the flag is
honored, but for the latter it is overridden by the NMake file's own
specification of /Fd.  Thus, for dlls and exes, you can simply add /PDB to the
link flags, but for static libraries you must manually manipulate the
COMPILE_PDB_NAME property for the target.  I think that /Fd, certainly for
static libraries which have no link step, should be mapped to COMPILE_PDB_NAME.

Steps to Reproduce: 
Create a minimal CMakeLists.txt like the following:

project(foo)
add_library(myLib STATIC myLib.c)
target_compile_options(myLib PUBLIC $<$:/Zi /FdmyLib.pdb>)

Generate a NMake Makefiles build system and build.  You will see

cl : Command line warning D9025 : overriding '/FdmyLib.pdb' with
'/FdCMakeFiles\myLib.dir/' 

and the PDB file is indeed CMakeFiles\myLib.dir\vc120.pdb.  If you generate a
Visual Studio project and build, there is no warning and the pdb file is
.\myLib.pdb.

And indeed the pdb file will be 
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-04-19 13:02 Itai SeggevNew 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] Autogen subdirectories patches

2016-04-19 Thread Sebastian Holtermann

Hello again,
I've prepared a set of patches that address

https://cmake.org/Bug/view.php?id=12873
https://cmake.org/Bug/view.php?id=16068

They introduce
- same name collision checks during moc/qrc/ui generation
- moc/qrc generation in subdirectories to support
  sources with the name in different subdirectories
- A test for equally named sources in different subdirectories

Please review.

-Sebastian


autogen_patches_2016-04-19-1.tar.gz
Description: application/gzip
-- 

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: how to use 'for cyclic sentence' in command add_custom_command(...)

2016-04-19 Thread Konstantin Tokarev


19.04.2016, 16:21, "Chaos Zhang" :
> Hi,
>
> I was using 'for cyclic sentence' in command add_custom_command(...), the
> content of the CMakeLists.txt as below:
> add_custom_command(TARGET temp_target
> POST_BUILD
> COMMAND for x in a b c\;
> do echo $x \;
> done\;)
>
> The result of execution was not like as below:
> a
> b
> c
> But like this:
>
> Just print 3 blank lines. So how to use it correctly?

I'd recommended you to move your command into script file and call it instead. 
It will be easier to maintain because you won't need to think of escaping 
issues, and about keeping it as a one-liner

>
> Thanks for your help,
> Chao Zhang
>
> --
> View this message in context: 
> http://cmake.3232098.n2.nabble.com/CMake-how-to-use-for-cyclic-sentence-in-command-add-custom-command-tp7593286.html
> Sent from the CMake mailing list archive at Nabble.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

-- 
Regards,
Konstantin
-- 

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] CMake: how to use 'for cyclic sentence' in command add_custom_command(...)

2016-04-19 Thread Chuck Atkins
Hi Chao,


> I was using 'for cyclic sentence' in command add_custom_command(...), the
> content of the CMakeLists.txt as below:
> add_custom_command(TARGET temp_target
> POST_BUILD
> COMMAND for x in a b c\;
> do echo $x \;
> done\;)
>

The $x is getting parsed by the makefile so you need to escape it with the
$ makefile escape sequence.  Try:

add_custom_command(TARGET temp_target
POST_BUILD
COMMAND for x in a b c\;
do echo $$x \;
done\;)

You can see the difference in a make VERBOSE=1 :

[100%] Linking C static library libtemp_target.a
/home/khq.kitware.com/chuck.atkins/Code/CMake/build/master-release/bin/cmake
-P CMakeFiles/temp_target.dir/cmake_clean_target.cmake
/home/khq.kitware.com/chuck.atkins/Code/CMake/build/master-release/bin/cmake
-E cmake_link_script CMakeFiles/temp_target.dir/link.txt --verbose=1
/usr/bin/ar qc libtemp_target.a  CMakeFiles/temp_target.dir/foo.c.o
/usr/bin/ranlib libtemp_target.a
*for x in a b c; do echo  ; done;*



make[2]: Leaving directory '/home/khq.kitware.com/chuck.atkins/tmp/bld'

Now becomes:

[100%] Linking C static library libtemp_target.a
/home/khq.kitware.com/chuck.atkins/Code/CMake/build/master-release/bin/cmake
-P CMakeFiles/temp_target.dir/cmake_clean_target.cmake
/home/khq.kitware.com/chuck.atkins/Code/CMake/build/master-release/bin/cmake
-E cmake_link_script CMakeFiles/temp_target.dir/link.txt --verbose=1
/usr/bin/ar qc libtemp_target.a  CMakeFiles/temp_target.dir/foo.c.o
/usr/bin/ranlib libtemp_target.a



*for x in a b c; do echo $x ; done;abc*
make[2]: Leaving directory '/home/khq.kitware.com/chuck.atkins/tmp/bld'

- Chuck
-- 

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] CMake: how to use 'for cyclic sentence' in command add_custom_command(...)

2016-04-19 Thread Chaos Zhang
Hi,

I was using 'for cyclic sentence' in command add_custom_command(...), the
content of the CMakeLists.txt as below:
add_custom_command(TARGET temp_target
POST_BUILD
COMMAND for x in a b c\; 
do echo $x \;
done\;)

The result of execution was not like as below:
a
b
c
But like this:



Just print 3 blank lines. So how to use it correctly?

Thanks for your help,
Chao Zhang



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/CMake-how-to-use-for-cyclic-sentence-in-command-add-custom-command-tp7593286.html
Sent from the CMake mailing list archive at Nabble.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

[CMake] How to convert global and local link option from make to cmake

2016-04-19 Thread vakano
Hi, 

I got a global and local link options mixed project which need to convert
from make to cmake,

eg as below(option with Bold): 

${LINK.cc} -Wl,-E -o dist/main ${OBJECTFILES} ${LDLIBSOPTIONS}

LDLIBOPTIONS= *-Wl,-rpath,* {PROJECT_TOP}/dist/Debug_64/GNU-linux-x86
../proj_a/lib_a.a

../proj_b/lib_b.a *-lsuperlu_4.0 ${MKLBLAS} -Wl, --whole-archive*
../proj_c/lib_c.a  

*-lSuiteSparse -lsobol*

How to convert the whole link option to cmake with these global and local
link option?

Thanks,
vakano



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/How-to-convert-global-and-local-link-option-from-make-to-cmake-tp7593285.html
Sent from the CMake mailing list archive at Nabble.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] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-19 Thread Clark Wang
On Tue, Apr 19, 2016 at 4:55 PM, Chaos Zhang  wrote:

> I have read the description of PRE_BUILD before in CMake doc, but when i
> use it, i found something confuesed.
> (1) In CMakeLists.txt, the content as below:
>
> ​(2)After i make the makefile generated by this CMakeLists.txt, i get
> result as below:
> "3_pre_build" is behind "1_pre_link", if POST_BUILD gets treated as
> PRE_LINK, why "3_pre_build" was printed before "1_pre_link"?
>

It's not the order of the "add_custom_command" commands in CMakeLists.txt
which determines in which order they will be invoked. According to the doc:

  PRE_BUILD − run before all other dependencies
  PRE_LINK − run after other dependencies
  POST_BUILD − run after the target has been built

So PRE_BUILD comes first and then PRE_LINK and at last POST_BUILD.

-clark

>
> Thanks for you reply,
> Chaos Zhang
> ​
>
> 2016-04-19 15:50 GMT+08:00 Craig Scott-3 [via CMake] <[hidden email]
> >:
>
>> In case it matters, in Clark's suggested code, note that PRE_BUILD is
>> only fully honoured with Visual Studio generators. For everything else, it
>> gets treated as PRE_LINK, which occurs later (i.e. after compiling all the
>> sources rather than before). So it depends on what your "if" test is trying
>> to do whether or not this matters in your case.
>>
>> On Tue, Apr 19, 2016 at 5:24 PM, Clark Wang <[hidden email]
>> > wrote:
>>
>> On Tue, Apr 19, 2016 at 1:15 PM, Chaos Zhang <[hidden email]
>>> > wrote:
>>>
 Hi,

 Is there a way to use Linux command 'if' like this :
 
 For i need to execute 'if condition' in make phase rather than cmake
 phase.

>>>
>>> Try like this:
>>>
>>> % cat CMakeLists.txt
>>> add_custom_target(foo ALL)
>>> add_custom_command(TARGET foo
>>> PRE_BUILD
>>> COMMAND if [ -f bar ]\; then echo yes\; else echo no\; fi)
>>> % cmake .
>>> % make
>>> no
>>> Built target foo
>>> % touch bar
>>> % make
>>> yes
>>> Built target foo
>>> %
>>>
>>>
 Thanks a lot
 Chaos Zhang



 --
 View this message in context:
 http://cmake.3232098.n2.nabble.com/CMake-how-to-use-if-condition-in-command-add-custom-command-tp7593278.html
 Sent from the CMake mailing list archive at Nabble.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

>>>
>>>
>>> --
>>>
>>> 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
>> http://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
>>
>> --
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cmake.3232098.n2.nabble.com/CMake-how-to-use-if-condition-in-command-add-custom-command-tp7593278p7593281.html
>> To unsubscribe from CMake: how to use 'if condition' in command
>> add_custom_command(...), click here.
>> NAML
>> 

Re: [CMake] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-19 Thread Chaos Zhang
I have read the description of PRE_BUILD before in CMake doc, but when i
use it, i found something confuesed.
(1) In CMakeLists.txt, the content as below:

​(2)After i make the makefile generated by this CMakeLists.txt, i get
result as below:
"3_pre_build" is behind "1_pre_link", if POST_BUILD gets treated as
PRE_LINK, why "3_pre_build" was printed before "1_pre_link"?

Thanks for you reply,
Chaos Zhang
​

2016-04-19 15:50 GMT+08:00 Craig Scott-3 [via CMake] <
ml-node+s3232098n7593281...@n2.nabble.com>:

> In case it matters, in Clark's suggested code, note that PRE_BUILD is only
> fully honoured with Visual Studio generators. For everything else, it gets
> treated as PRE_LINK, which occurs later (i.e. after compiling all the
> sources rather than before). So it depends on what your "if" test is trying
> to do whether or not this matters in your case.
>
> On Tue, Apr 19, 2016 at 5:24 PM, Clark Wang <[hidden email]
> > wrote:
>
> On Tue, Apr 19, 2016 at 1:15 PM, Chaos Zhang <[hidden email]
>> > wrote:
>>
>>> Hi,
>>>
>>> Is there a way to use Linux command 'if' like this :
>>> 
>>> For i need to execute 'if condition' in make phase rather than cmake
>>> phase.
>>>
>>
>> Try like this:
>>
>> % cat CMakeLists.txt
>> add_custom_target(foo ALL)
>> add_custom_command(TARGET foo
>> PRE_BUILD
>> COMMAND if [ -f bar ]\; then echo yes\; else echo no\; fi)
>> % cmake .
>> % make
>> no
>> Built target foo
>> % touch bar
>> % make
>> yes
>> Built target foo
>> %
>>
>>
>>> Thanks a lot
>>> Chaos Zhang
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://cmake.3232098.n2.nabble.com/CMake-how-to-use-if-condition-in-command-add-custom-command-tp7593278.html
>>> Sent from the CMake mailing list archive at Nabble.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
>>>
>>
>>
>> --
>>
>> 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
> http://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
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cmake.3232098.n2.nabble.com/CMake-how-to-use-if-condition-in-command-add-custom-command-tp7593278p7593281.html
> To unsubscribe from CMake: how to use 'if condition' in command
> add_custom_command(...), click here
> 
> .
> NAML
> 
>


1.png (9K) 
2.png (5K) 

Re: [CMake] CMakeLists.txt: How to print a message if ctest fails?

2016-04-19 Thread Matějů Miroslav , Ing .
Hi Muhammad,

You need to add this code to a separate CTest script (CTestScript.cmake, for 
example) and then run it using ctest -S CTestScript.cmake. Since the wiki page 
I linked yesterday provides only some complex examples, I am sending the key 
part of my CTest script. As you can see, its operation strongly depends on 
environment variables (some of them are provided by Windows). You’ll probably 
need to remove most of my if’s.

set(CTEST_SOURCE_DIRECTORY "$ENV{SCRIPT_FOLDER}")
set(CTEST_BINARY_DIRECTORY "$ENV{BINARY_PROJECT_FOLDER}")

set(CTEST_SITE  $ENV{COMPUTERNAME})
set(CTEST_BUILD_NAME$ENV{TEST_CASE_NAME})

ctest_start()

ctest_configure(RETURN_VALUE configure_failed)

if($ENV{DO_UPDATE})
  ctest_update()
endif($ENV{DO_UPDATE})

if($ENV{DO_BUILD})
  ctest_build(RETURN_VALUE build_failed)
endif($ENV{DO_BUILD})

if   (($ENV{DO_TEST}) AND NOT (configure_failed OR build_failed))
  ctest_test(RETURN_VALUE test_failed)
endif(($ENV{DO_TEST}) AND NOT (configure_failed OR build_failed))

if($ENV{DO_DASHBOARD})
  ctest_submit()
endif($ENV{DO_DASHBOARD})

if   (configure_failed OR build_failed OR test_failed)
  message(FATAL_ERROR "Test ${CTEST_BUILD_NAME} failed.")  # sets return value 
to -1
endif(configure_failed OR build_failed OR test_failed)

Best regards,
Miroslav

From: Muhammad Osama [mailto:osam...@gmail.com]
Sent: Monday, April 18, 2016 8:33 PM
To: Matějů Miroslav, Ing.
Cc: cmake@cmake.org
Subject: Re: [CMake] CMakeLists.txt: How to print a message if ctest fails?

Hi Miroslav,

Thank you for replying! I added this in my root CMakeLists.txt, purposely made 
the ctest's test fail but didn't get the output message.
Is this script suppose to be added inside CMakeLists.txt? Or am I doing this 
incorrectly?

Thanks again,

On Mon, Apr 18, 2016 at 6:30 AM, Matějů Miroslav, Ing. 
> wrote:
Hi Muhammad,
you can use a CTest script, see https://cmake.org/Wiki/CMake_Scripting_Of_CTest 
for details. I use the following code in my CTest script:

if(configure_failed OR build_failed OR test_failed)
message(FATAL_ERROR "Test ${CTEST_BUILD_NAME} failed.")
endif()

Best regards,
Miroslav

From: CMake [mailto:cmake-boun...@cmake.org] On 
Behalf Of Muhammad Osama
Sent: Friday, April 15, 2016 8:53 PM
To: cmake@cmake.org
Subject: [CMake] CMakeLists.txt: How to print a message if ctest fails?

Is there a way I can setup CMakeLists.txt to print a message if ctest tests 
fail? For example:

cmake ..
make
ctest // fails
message output: Please contact x...@mail.com to resolve 
testing problems.
​Note the message output is not for cmake but for ctest.​

--​​
Muhammad


--
Muhammad
-- 

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] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-19 Thread Craig Scott
In case it matters, in Clark's suggested code, note that PRE_BUILD is only
fully honoured with Visual Studio generators. For everything else, it gets
treated as PRE_LINK, which occurs later (i.e. after compiling all the
sources rather than before). So it depends on what your "if" test is trying
to do whether or not this matters in your case.

On Tue, Apr 19, 2016 at 5:24 PM, Clark Wang  wrote:

> On Tue, Apr 19, 2016 at 1:15 PM, Chaos Zhang  wrote:
>
>> Hi,
>>
>> Is there a way to use Linux command 'if' like this :
>> 
>> For i need to execute 'if condition' in make phase rather than cmake
>> phase.
>>
>
> Try like this:
>
> % cat CMakeLists.txt
> add_custom_target(foo ALL)
> add_custom_command(TARGET foo
> PRE_BUILD
> COMMAND if [ -f bar ]\; then echo yes\; else echo no\; fi)
> % cmake .
> % make
> no
> Built target foo
> % touch bar
> % make
> yes
> Built target foo
> %
>
>
>> Thanks a lot
>> Chaos Zhang
>>
>>
>>
>> --
>> View this message in context:
>> http://cmake.3232098.n2.nabble.com/CMake-how-to-use-if-condition-in-command-add-custom-command-tp7593278.html
>> Sent from the CMake mailing list archive at Nabble.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
>>
>
>
> --
>
> 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
http://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] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-19 Thread Clark Wang
On Tue, Apr 19, 2016 at 1:15 PM, Chaos Zhang  wrote:

> Hi,
>
> Is there a way to use Linux command 'if' like this :
> 
> For i need to execute 'if condition' in make phase rather than cmake phase.
>

Try like this:

% cat CMakeLists.txt
add_custom_target(foo ALL)
add_custom_command(TARGET foo
PRE_BUILD
COMMAND if [ -f bar ]\; then echo yes\; else echo no\; fi)
% cmake .
% make
no
Built target foo
% touch bar
% make
yes
Built target foo
%


> Thanks a lot
> Chaos Zhang
>
>
>
> --
> View this message in context:
> http://cmake.3232098.n2.nabble.com/CMake-how-to-use-if-condition-in-command-add-custom-command-tp7593278.html
> Sent from the CMake mailing list archive at Nabble.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
>
-- 

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] Patch for BundleUtilities to ignore specified files

2016-04-19 Thread Roman Wüger
Hello Brad,

attached is an updated patch.

Regards
Roman



0001-BundleUtilities-Add-optional-parameter-to-ignore-spe.patch
Description: Binary data


> Am 18.04.2016 um 17:28 schrieb Brad King :
> 
>> On 04/18/2016 10:20 AM, Roman Wüger wrote:
>> attached is a patch with which files can be specified which should not be 
>> resolved.
> 
> Thanks.  Please include a documentation update too.
> 
> -Brad
> 
-- 

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] Patch for BundleUtilities to ignore specified files

2016-04-19 Thread Roman Wüger
Hello Brad,

attached is an updated patch.

Regards
Roman



0001-BundleUtilities-Add-optional-parameter-to-ignore-spe.patch
Description: Binary data


> Am 18.04.2016 um 17:28 schrieb Brad King :
> 
>> On 04/18/2016 10:20 AM, Roman Wüger wrote:
>> attached is a patch with which files can be specified which should not be 
>> resolved.
> 
> Thanks.  Please include a documentation update too.
> 
> -Brad
> 
-- 

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