Re: [CMake] test depending on code compilation

2018-01-10 Thread Franck Houssen
OK, so I guess there is no way to do that like with autotools... 

- Mail original -

> De: "Franck Houssen" 
> À: "CMake Mail List" 
> Envoyé: Mercredi 10 Janvier 2018 12:22:39
> Objet: Re: [CMake] test depending on code compilation

> I tried to reduce the example:

> >> ls
> CMakeLists.txt main.cpp mytest.cpp mytest.sh

> >> more *
> ::
> CMakeLists.txt
> ::
> cmake_minimum_required(VERSION 3.7)
> enable_language(CXX)

> project(main)
> add_executable(main main.cpp)
> add_executable(mytestcpp mytest.cpp)

> include(CTest)
> enable_testing()
> configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mytest.sh"
> "${CMAKE_CURRENT_BINARY_DIR}/mytest.sh")
> add_test(NAME mytestsh COMMAND ./mytest.sh WORKING_DIRECTORY
> "${CMAKE_CURRENT_BINARY_DIR}")

> add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS mytestcpp)
> ::
> main.cpp
> ::
> int main() {return 0;}
> ::
> mytest.cpp
> ::
> int main() {return 0;}
> ::
> mytest.sh
> ::
> #!/bin/bash
> exit 0

> I want make to build only main => KO
> >> make
> [ 50%] Built target main
> [100%] Built target mytestcpp

> I want make check to build mytestcpp and run tests => OK but verbose is KO.
> >> make check ARGS="-V"
> [100%] Built target mytestcpp
> Test project /tmp/BUILD
> Start 1: mytestsh
> 1/1 Test #1: mytestsh . Passed 0.00 sec

> I want make test to run test only => OK and verbose is OK.

> - Mail original -

> > De: "Franck Houssen" 
> 
> > À: "CMake Mail List" 
> 
> > Envoyé: Mercredi 10 Janvier 2018 10:47:34
> 
> > Objet: [CMake] test depending on code compilation
> 

> > I need to design a test (= a bash script) such that :
> 
> > 1) run a dedicated executable for the test (to be compiled)
> 
> > 2) diff the run output with a reference log file
> 

> > The test is created with : add_test(mytest ./mytest.sh). The bash script
> > would look like:
> 
> > >> more mytest.sh
> 
> > /path/to/mytestexe > out.log
> 
> > diff out.log out.ref
> 

> > The dedicated executable for the test is created with :
> > add_executable(mytestexe mytestexe.cpp)
> 

> > Ideally, I would like mytestexe to be compiled when I type "make test"
> > (before to run the test) but not "make".
> 

> > Seems impossible to add a dependencie with : add_dependencies(mytest
> > mytestexe). I googled this and found
> > https://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests
> > but this was not really clear to me...I added : add_custom_target(check
> > COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS mytestexe).
> 

> > The 2 unexpected problems I have left are:
> 
> > 1) mytestexe is compiled everytime I type "make" which is a solution but is
> > not really what I am looking for (also compiled when I type "make check"
> > which is expected).
> 
> > => is there a way for make not to compile mytestexe (note I didn't added
> > ALL
> > in add_custom_target so I am not sure to know why make builds mytestexe)
> 
> > 2) Also the verbosity is broken with check : make test ARGS="-V" is verbose
> > ,
> > but, make check ARGS="-V" is not.
> 
> > => how to deal with that ?
> 

> > --
> 

> > Powered by www.kitware.com
> 

> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> 

> > Kitware offers various services to support the CMake community. For more
> > information on each offering, please visit:
> 

> > CMake Support: http://cmake.org/cmake/help/support.html
> 
> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
> 
> > CMake Training Courses: http://cmake.org/cmake/help/training.html
> 

> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> 

> > Follow this link to subscribe/unsubscribe:
> 
> > https://cmake.org/mailman/listinfo/cmake
> 

> --

> Powered by www.kitware.com

> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ

> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:

> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html

> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html

> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
-- 

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: 

[Cmake-commits] CMake branch, master, updated. v3.10.1-758-gb2369ad

2018-01-10 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  b2369ad4099fbd96ff66fa4a917fcc843ee3c55f (commit)
  from  ddc4f9a3c05fa24240fde1ba6c0ab28b7d2e91ea (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=b2369ad4099fbd96ff66fa4a917fcc843ee3c55f
commit b2369ad4099fbd96ff66fa4a917fcc843ee3c55f
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Thu Jan 11 00:01:51 2018 -0500
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Jan 11 00:01:51 2018 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 0a1834f..67f5df8 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 10)
-set(CMake_VERSION_PATCH 20180110)
+set(CMake_VERSION_PATCH 20180111)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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


[CMake] Creating a relocatable ProjectConfig.cmake when build uses absolute paths

2018-01-10 Thread Lucas Soltic
Hello,

I'm trying to create a relocatable package configuration file but I'm having a 
hard time with absolute paths that are used during the build.
Note that I use CMake 3.10.0.

First of all for the include path I'm using this:
target_include_directories(MyStaticTarget PUBLIC
   $
   $)

This does work but according to the doc it should not : 
https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html?highlight=build_interface#output-expressions
 

The doc of BUILD_INTERFACE says: "Content of ... when the property is exported 
using export(), or when the target is used by another target in the same 
buildsystem. Expands to the empty string otherwise."
So according to the doc, when compiling the target MyTarget, the include dir I 
gave should not be used. Which seems consistent with the other uses of 
INTERFACE wording in CMake language. But it actually behaves like PUBLIC rather 
than INTERFACE. This is fine to me but inconsistent… :)
When exporting the target, the include dir uses what's given in for 
INSTALL_INTERFACE so it works fine. No problem on that part.


The second point is about libraries to link when using my project. My project 
exports a static library that depends on other libraries. These libraries are 
found (when generating my project through cmake) through calls like 
find_package(OpenGL). This provides a variable that contains an absolute 
non-relocatable path.

I've tried doing things like this:
target_link_libraries(MyStaticTarget PRIVATE
  $
  $)

According to https://cmake.org/pipermail/cmake/2016-May/063400.html 
, for static libraries, 
PRIVATE link dependencies become "PUBLIC", which is ok. And I could see that 
the link flag for this "private" dependency got exported in the generated 
config. But the problem is that whatever I put for INSTALL_INTERFACE, it is 
ignored and not written to the generated cmake config file. The generated CMake 
config file just takes into account what I put for BUILD_INTERFACE. Contrary to 
what happened with include directories. And I don't want to use only 
${OpenGL_relocatable_link_flag} because MyStaticTarget can be configured to be 
a dynamic library, in which case the library is really used during link and 
really want to link against the exact library that's referenced.

How can I have ${OpenGL_relocatable_link_flag} be used in the generated cmake 
config file?
Any other solution that would make the generated config relocatable is also 
fine.

Best regards,
Lucas -- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[Cmake-commits] CMake branch, master, updated. v3.10.1-757-gddc4f9a

2018-01-10 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  ddc4f9a3c05fa24240fde1ba6c0ab28b7d2e91ea (commit)
   via  d08f3f551fa94b13a1d43338eaed68bcecb95cff (commit)
   via  0cfcea334b305d47f291f776be422b9d9362d019 (commit)
   via  d49986b3b8fc5079f689de58b8275036c5184346 (commit)
   via  1f4d7a0715dd33100c61bd51d0504840923300f6 (commit)
   via  48f7e2d3dc57c31d3e3ab81077950704a587 (commit)
  from  1be22978e0ec3766c457216af348c8dca4d7cca2 (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=ddc4f9a3c05fa24240fde1ba6c0ab28b7d2e91ea
commit ddc4f9a3c05fa24240fde1ba6c0ab28b7d2e91ea
Merge: d08f3f5 0cfcea3
Author: Brad King 
AuthorDate: Wed Jan 10 10:38:11 2018 -0500
Commit: Brad King 
CommitDate: Wed Jan 10 10:38:11 2018 -0500

Merge branch 'release-3.10'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d08f3f551fa94b13a1d43338eaed68bcecb95cff
commit d08f3f551fa94b13a1d43338eaed68bcecb95cff
Merge: 1be2297 1f4d7a0
Author: Brad King 
AuthorDate: Wed Jan 10 15:34:57 2018 +
Commit: Kitware Robot 
CommitDate: Wed Jan 10 10:35:04 2018 -0500

Merge topic 'unhardcode-configuration-types'

1f4d7a07 Help: Add references and backticks in LINK_FLAGS prop_tgt
48f7e2d3 Unhardcode the CMAKE_CONFIGURATION_TYPES values

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

diff --cc Modules/FindCUDA.cmake
index 9176db4,32aa454..321121c
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@@ -525,16 -524,10 +525,16 @@@ set(CUDA_GENERATED_OUTPUT_DIR "" CACHE 
  option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON)
  
  # Extra user settable flags
- set(CUDA_NVCC_FLAGS "" CACHE STRING "Semi-colon delimit multiple arguments.")
+ cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "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")
 +  set(_CUDA_MSVC_HOST_COMPILER 
"$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)")
 +  if(MSVC_VERSION LESS 1910)
 +   set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin")
 +  endif()
 +
 +  set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host 
side compiler used by NVCC")
 +
  else()
if(APPLE
AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang"

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f4d7a0715dd33100c61bd51d0504840923300f6
commit 1f4d7a0715dd33100c61bd51d0504840923300f6
Author: Beren Minor 
AuthorDate: Mon Nov 27 19:22:16 2017 +0100
Commit: Beren Minor 
CommitDate: Mon Jan 8 21:15:16 2018 +0100

Help: Add references and backticks in LINK_FLAGS prop_tgt

diff --git a/Help/prop_tgt/LINK_FLAGS.rst b/Help/prop_tgt/LINK_FLAGS.rst
index 0940121..b09e7c1 100644
--- a/Help/prop_tgt/LINK_FLAGS.rst
+++ b/Help/prop_tgt/LINK_FLAGS.rst
@@ -4,5 +4,6 @@ LINK_FLAGS
 Additional flags to use when linking this target.
 
 The LINK_FLAGS property can be used to add extra flags to the link
-step of a target.  LINK_FLAGS_ will add to the configuration
-, for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO, ...
+step of a target.  :prop_tgt:`LINK_FLAGS_` will add to the
+configuration , for example, ``DEBUG``, ``RELEASE``,
+``MINSIZEREL``, ``RELWITHDEBINFO``, ...

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48f7e2d3dc57c31d3e3ab81077950704a587
commit 48f7e2d3dc57c31d3e3ab81077950704a587
Author: Beren Minor 
AuthorDate: Mon Nov 27 19:22:11 2017 +0100
Commit: Beren Minor 
CommitDate: Mon Jan 8 21:15:14 2018 +0100

Unhardcode the CMAKE_CONFIGURATION_TYPES values

This removes duplicated code for per-config variable initialization by
providing a `cmake_initialize_per_config_variable( )`
function.

This function initializes a `` cache variable from `_INIT`
and unless the `CMAKE_NOT_USING_CONFIG_FLAGS` variable is defined, does
the same with `_` from `__INIT` for every
`` in `CMAKE_CONFIGURATION_TYPES` for multi-config generators or
`CMAKE_BUILD_TYPE` for single-config generators.

diff --git a/Help/manual/cmake-variables.7.rst 
b/Help/manual/cmake-variables.7.rst
index 735b93b..3f57612 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -414,6 +414,8 @@ Variables for Languages

[Cmake-commits] CMake branch, release, updated. v3.10.1-8-g0cfcea3

2018-01-10 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, release has been updated
   via  0cfcea334b305d47f291f776be422b9d9362d019 (commit)
   via  d49986b3b8fc5079f689de58b8275036c5184346 (commit)
  from  9559eb7aa7bcb267f49bb304075ef952660753ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
---

Summary of changes:
 Utilities/KWIML/include/kwiml/abi.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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


[Cmake-commits] CMake branch, master, updated. v3.10.1-751-g1be2297

2018-01-10 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  1be22978e0ec3766c457216af348c8dca4d7cca2 (commit)
   via  e9237334a6beab7090cc702ca8d4e0914f5bfe07 (commit)
   via  8a53242df98be391070d7a34590e127c28e2e985 (commit)
   via  6e921648d292c81f2d0e62803f45a4f79aa892ca (commit)
   via  2c1ecab64da6a8c7738770316ddf8a72bbf8eb1f (commit)
  from  89ec1aacd781dcaf4aa0c6899bface518ac6afca (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=1be22978e0ec3766c457216af348c8dca4d7cca2
commit 1be22978e0ec3766c457216af348c8dca4d7cca2
Merge: e923733 2c1ecab
Author: Brad King 
AuthorDate: Wed Jan 10 15:34:09 2018 +
Commit: Kitware Robot 
CommitDate: Wed Jan 10 10:34:24 2018 -0500

Merge topic 'serverTestInfoExpandVariables'

2c1ecab6 server: Expand generator expressions for test info

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e9237334a6beab7090cc702ca8d4e0914f5bfe07
commit e9237334a6beab7090cc702ca8d4e0914f5bfe07
Merge: 89ec1aa 8a53242
Author: Brad King 
AuthorDate: Wed Jan 10 15:32:08 2018 +
Commit: Kitware Robot 
CommitDate: Wed Jan 10 10:32:16 2018 -0500

Merge topic 'update-kwiml'

8a53242d Merge branch 'upstream-KWIML' into update-kwiml
6e921648 KWIML 2018-01-09 (9c2d6cae)

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a53242df98be391070d7a34590e127c28e2e985
commit 8a53242df98be391070d7a34590e127c28e2e985
Merge: 2c089d8 6e92164
Author: Brad King 
AuthorDate: Tue Jan 9 08:51:59 2018 -0500
Commit: Brad King 
CommitDate: Tue Jan 9 08:51:59 2018 -0500

Merge branch 'upstream-KWIML' into update-kwiml

* upstream-KWIML:
  KWIML 2018-01-09 (9c2d6cae)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e921648d292c81f2d0e62803f45a4f79aa892ca
commit 6e921648d292c81f2d0e62803f45a4f79aa892ca
Author: KWIML Upstream 
AuthorDate: Tue Jan 9 08:49:07 2018 -0500
Commit: Brad King 
CommitDate: Tue Jan 9 08:51:58 2018 -0500

KWIML 2018-01-09 (9c2d6cae)

Code extracted from:

https://gitlab.kitware.com/utils/kwiml.git

at commit 9c2d6caecd8cd937b891009c681f90748df85dfd (master).

Upstream Shortlog
-

Brad King (5):
  fc9d607a Use static_cast when compiling as C++
  ea9336bc Update copyright year
  7db8b884 Suppress MSVC static_cast warnings in verification and test 
code
  340af24d Update copyright year
  9c2d6cae Fix compilation on Borland C++ 5.8

Richard W.M. Jones (1):
  6fc81d88 abi.h: Update RISC-V support for revised macro names

diff --git a/Copyright.txt b/Copyright.txt
index 515c4eb..fffd6d1 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -1,5 +1,5 @@
 Kitware Information Macro Library
-Copyright 2010-2016 Kitware, Inc.
+Copyright 2010-2018 Kitware, Inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/include/kwiml/abi.h b/include/kwiml/abi.h
index 5ffd542..da525fd 100644
--- a/include/kwiml/abi.h
+++ b/include/kwiml/abi.h
@@ -1,6 +1,6 @@
 /*
   Kitware Information Macro Library
-  Copyright 2010-2016 Kitware, Inc.
+  Copyright 2010-2018 Kitware, Inc.
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without
@@ -468,7 +468,7 @@ suppression macro KWIML_ABI_NO_VERIFY was defined.
 # define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_LITTLE
 
 /* RISC-V */
-#elif defined(__riscv__)
+#elif defined(__riscv) || defined(__riscv__)
 # define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_LITTLE
 
 /* Unknown CPU */
@@ -484,9 +484,16 @@ suppression macro KWIML_ABI_NO_VERIFY was defined.
 
 #if defined(_MSC_VER)
 # pragma warning (push)
+# pragma warning (disable:4309) /* static_cast trunction of constant value */
 # pragma warning (disable:4310) /* cast truncates constant value */
 #endif
 
+#if defined(__cplusplus) && !defined(__BORLANDC__)
+#define KWIML_ABI_private_STATIC_CAST(t,v) static_cast(v)
+#else
+#define KWIML_ABI_private_STATIC_CAST(t,v) (t)(v)
+#endif
+
 #define KWIML_ABI_private_VERIFY(n, x, y) 
KWIML_ABI_private_VERIFY_0(KWIML_ABI_private_VERSION, n, x, y)
 #define 

[CMake] Is a there a mean to check that all target are installed?

2018-01-10 Thread Eric Noulard
Is there a way to programmatically check whether
all (or some) CMake targets are installed?

I want to be able to check that all defined targets of a particular project
(at least libraries or executable) are installed.

I can recursively retrieve all targets using
https://cmake.org/cmake/help/v3.9/prop_dir/BUILDSYSTEM_TARGETS.html
directory property.

But then I want to know if a target has been installed or not by some
install(...) rules.

Is it possible?

-- 
Eric
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake support for MYS2

2018-01-10 Thread Mojca Miklavec
On 10 January 2018 at 11:56, Konstantin Tokarev  wrote:
> 10.01.2018, 11:40, "Mojca Miklavec" :
>> On 8 January 2018 at 17:38, Konstantin Tokarev wrote:
>>>  08.01.2018, 14:35, "Mojca Miklavec":
  Dear CMake developers,

  I installed msys2 from http://www.msys2.org/ and (after updating etc)
  installed cmake via
  pacman -S cmake
>>>
>>>  You should install mingw-w64-x86_64-cmake (or i686).
>>
>> Thank you very much. That package is missing ccmake though
>
> Please report it as a bug. cmake package should provide ccmake, or
> there should be a separate package if ncurses dependency is undesirable
> in the main package.

I can create a bug report, but I would like to clarify with CMake
developers first before I know what exactly to report in the first
place.

I'm pretty sure that this is a side-effect of CMake's own build
figuring out that it's being built on and for Windows, so it probably
skips building ccmake and builds cmake-gui.exe instead.

This all makes perfect sense for distributing the standalone
executable on Windows, but it's less suitable in the context of MSYS2.

>>, so I can
>> only run cmake directly and even then it strangely(?) defaults to
>> Visual Studio when I would expect it to go for Unix Makefiles.
>
> This is behavior of vanilla cmake, so it's reasonable that it is not altered.

I assume it belongs "to the same category" as the lack of ccmake.

I can imagine that it would make sense to offer to ways of building
cmake on Windows: the "standalone" mode without ccmake, with cmake-gui
and defaulting to Visual Studio. And the "command-line" mode with
ccmake and defaulting to "Unix Makefiles". Of course one could build
both ccmake and cmake-gui at the same time if desired.

We often have this problem with a Mac package manager. Many software
builds do "if this is mac, then standard unix tools don't exist, so do
something completely different" and they would create the app bundle,
but skip the rest of command-line friendliness and completely ignore
the fact that those unix tools may exist after all.

> You can use msys2 like a generic Windows software repository, not only
> for MinGW- or MSYS-based development.

I admit that I don't totally understand how exactly it's supposed to
work, but further discussion would be too off-topic for this list, I
assume.

>> (The "ccmake" from /usr/bin/ccmake is not helping in any way either, I
>> was hoping it would perhaps use mingw-w64-x86_64-cmake.)
>>
>> I later noticed that there is /mingw64/bin/cmake-gui.exe, but that one
>> doesn't really work either:
>>
>> $ cmake-gui
>> C:/msys/msys64/mingw64/bin/cmake-gui.exe: error while loading shared
>> libraries: librhash.dll: cannot open shared object file: No such file
>> or directory
>>
>>>  You've installed
>>>  package that targets MSYS environment, not native Windows.
>>
>> I still assume that others might run into exactly the same isuse in
>> the future. Since it's explicitly suggesting to write to the mailing
>> list, the reports might repeat.
>
> This is a packaging problem, so it should be reported to msys2
> maintainers first.

OK.

> in the meanwhile, you can edit CMakeCache.txt file directly, gui tools
> don't really add much :)

Well, I can always use
cmake -G "..." -Dwhatever ../source
but ccmake is useful to show what configuration options the program is
offering. Editing CMakeCache is a feasible workaround, but I would
like to have a proper fix at the end.

Thanks a lot for all the useful insights.

Mojca
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] test depending on code compilation

2018-01-10 Thread Franck Houssen
I tried to reduce the example: 

>> ls 
CMakeLists.txt main.cpp mytest.cpp mytest.sh 

>> more * 
:: 
CMakeLists.txt 
:: 
cmake_minimum_required(VERSION 3.7) 
enable_language(CXX) 

project(main) 
add_executable(main main.cpp) 
add_executable(mytestcpp mytest.cpp) 

include(CTest) 
enable_testing() 
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mytest.sh" 
"${CMAKE_CURRENT_BINARY_DIR}/mytest.sh") 
add_test(NAME mytestsh COMMAND ./mytest.sh WORKING_DIRECTORY 
"${CMAKE_CURRENT_BINARY_DIR}") 

add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS mytestcpp) 
:: 
main.cpp 
:: 
int main() {return 0;} 
:: 
mytest.cpp 
:: 
int main() {return 0;} 
:: 
mytest.sh 
:: 
#!/bin/bash 
exit 0 

I want make to build only main => KO 
>> make 
[ 50%] Built target main 
[100%] Built target mytestcpp 

I want make check to build mytestcpp and run tests => OK but verbose is KO. 
>> make check ARGS="-V" 
[100%] Built target mytestcpp 
Test project /tmp/BUILD 
Start 1: mytestsh 
1/1 Test #1: mytestsh . Passed 0.00 sec 

I want make test to run test only => OK and verbose is OK. 

- Mail original -

> De: "Franck Houssen" 
> À: "CMake Mail List" 
> Envoyé: Mercredi 10 Janvier 2018 10:47:34
> Objet: [CMake] test depending on code compilation

> I need to design a test (= a bash script) such that :
> 1) run a dedicated executable for the test (to be compiled)
> 2) diff the run output with a reference log file

> The test is created with : add_test(mytest ./mytest.sh). The bash script
> would look like:
> >> more mytest.sh
> /path/to/mytestexe > out.log
> diff out.log out.ref

> The dedicated executable for the test is created with :
> add_executable(mytestexe mytestexe.cpp)

> Ideally, I would like mytestexe to be compiled when I type "make test"
> (before to run the test) but not "make".

> Seems impossible to add a dependencie with : add_dependencies(mytest
> mytestexe). I googled this and found
> https://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests
> but this was not really clear to me...I added : add_custom_target(check
> COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS mytestexe).

> The 2 unexpected problems I have left are:
> 1) mytestexe is compiled everytime I type "make" which is a solution but is
> not really what I am looking for (also compiled when I type "make check"
> which is expected).
> => is there a way for make not to compile mytestexe (note I didn't added ALL
> in add_custom_target so I am not sure to know why make builds mytestexe)
> 2) Also the verbosity is broken with check : make test ARGS="-V" is verbose ,
> but, make check ARGS="-V" is not.
> => how to deal with that ?

> --

> Powered by www.kitware.com

> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ

> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:

> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html

> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html

> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake support for MYS2

2018-01-10 Thread Konstantin Tokarev


10.01.2018, 11:40, "Mojca Miklavec" :
> On 8 January 2018 at 17:38, Konstantin Tokarev wrote:
>>  08.01.2018, 14:35, "Mojca Miklavec":
>>>  Dear CMake developers,
>>>
>>>  I installed msys2 from http://www.msys2.org/ and (after updating etc)
>>>  installed cmake via
>>>  pacman -S cmake
>>
>>  You should install mingw-w64-x86_64-cmake (or i686).
>
> Thank you very much. That package is missing ccmake though

Please report it as a bug. cmake package should provide ccmake, or
there should be a separate package if ncurses dependency is undesirable
in the main package.

>, so I can
> only run cmake directly and even then it strangely(?) defaults to
> Visual Studio when I would expect it to go for Unix Makefiles.

This is behavior of vanilla cmake, so it's reasonable that it is not altered.
You can use msys2 like a generic Windows software repository, not only
for MinGW- or MSYS-based development.

> (The "ccmake" from /usr/bin/ccmake is not helping in any way either, I
> was hoping it would perhaps use mingw-w64-x86_64-cmake.)
>
> I later noticed that there is /mingw64/bin/cmake-gui.exe, but that one
> doesn't really work either:
>
> $ cmake-gui
> C:/msys/msys64/mingw64/bin/cmake-gui.exe: error while loading shared
> libraries: librhash.dll: cannot open shared object file: No such file
> or directory
>
>>  You've installed
>>  package that targets MSYS environment, not native Windows.
>
> I still assume that others might run into exactly the same isuse in
> the future. Since it's explicitly suggesting to write to the mailing
> list, the reports might repeat.

This is a packaging problem, so it should be reported to msys2
maintainers first.

in the meanwhile, you can edit CMakeCache.txt file directly, gui tools
don't really add much :)

> (OK, I don't expect so many people to use the strange unix toolchains
> on windows platforms, but still.)
>
> Thank you,
> Mojca
>
>>>  as well as some other packages like "make", the gcc compiler etc.
>>>
>>>  But "ccmake" complains:
>>>
>>>   System is unknown to cmake, create:
>>>   Platform/MINGW32_NT-6.1 to use this system, please send your config file 
>>> to
>>>   cm...@www.cmake.org so it can be added to cmake
>>>
>>>   Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please
>>>  send that file to
>>>   cm...@www.cmake.org.
>>>
>>>  I believe I should additional set the compiler somehow, but I guess I
>>>  should be able to cope with that part. I just wanted to report the
>>>  failure to identify the platform while fighting with other problems.
>>>  (Meson works correctly out of the box.)
>>>
>>>  CopyOfCMakeCache is in attachment.
>>>
>>>  Thank you very much,
>>>  Mojca
>>
>>  --
>>  Regards,
>>  Konstantin

-- 
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:
https://cmake.org/mailman/listinfo/cmake


[CMake] test depending on code compilation

2018-01-10 Thread Franck Houssen
I need to design a test (= a bash script) such that : 
1) run a dedicated executable for the test (to be compiled) 
2) diff the run output with a reference log file 

The test is created with : add_test(mytest ./mytest.sh). The bash script would 
look like: 
>> more mytest.sh 
/path/to/mytestexe > out.log 
diff out.log out.ref 

The dedicated executable for the test is created with : 
add_executable(mytestexe mytestexe.cpp) 

Ideally, I would like mytestexe to be compiled when I type "make test" (before 
to run the test) but not "make". 

Seems impossible to add a dependencie with : add_dependencies(mytest 
mytestexe). I googled this and found 
https://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests
 but this was not really clear to me...I added : add_custom_target(check 
COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS mytestexe). 

The 2 unexpected problems I have left are: 
1) mytestexe is compiled everytime I type "make" which is a solution but is not 
really what I am looking for (also compiled when I type "make check" which is 
expected). 
=> is there a way for make not to compile mytestexe (note I didn't added ALL in 
add_custom_target so I am not sure to know why make builds mytestexe) 
2) Also the verbosity is broken with check : make test ARGS="-V" is verbose , 
but, make check ARGS="-V" is not. 
=> how to deal with that ? 
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake support for MYS2

2018-01-10 Thread Mojca Miklavec
On 8 January 2018 at 17:38, Konstantin Tokarev wrote:
> 08.01.2018, 14:35, "Mojca Miklavec":
>> Dear CMake developers,
>>
>> I installed msys2 from http://www.msys2.org/ and (after updating etc)
>> installed cmake via
>> pacman -S cmake
>
> You should install mingw-w64-x86_64-cmake (or i686).

Thank you very much. That package is missing ccmake though, so I can
only run cmake directly and even then it strangely(?) defaults to
Visual Studio when I would expect it to go for Unix Makefiles.
(The "ccmake" from /usr/bin/ccmake is not helping in any way either, I
was hoping it would perhaps use mingw-w64-x86_64-cmake.)

I later noticed that there is /mingw64/bin/cmake-gui.exe, but that one
doesn't really work either:

$ cmake-gui
C:/msys/msys64/mingw64/bin/cmake-gui.exe: error while loading shared
libraries: librhash.dll: cannot open shared object file: No such file
or directory

> You've installed
> package that targets MSYS environment, not native Windows.

I still assume that others might run into exactly the same isuse in
the future. Since it's explicitly suggesting to write to the mailing
list, the reports might repeat.
(OK, I don't expect so many people to use the strange unix toolchains
on windows platforms, but still.)

Thank you,
Mojca

>> as well as some other packages like "make", the gcc compiler etc.
>>
>> But "ccmake" complains:
>>
>>  System is unknown to cmake, create:
>>  Platform/MINGW32_NT-6.1 to use this system, please send your config file to
>>  cm...@www.cmake.org so it can be added to cmake
>>
>>  Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please
>> send that file to
>>  cm...@www.cmake.org.
>>
>> I believe I should additional set the compiler somehow, but I guess I
>> should be able to cope with that part. I just wanted to report the
>> failure to identify the platform while fighting with other problems.
>> (Meson works correctly out of the box.)
>>
>> CopyOfCMakeCache is in attachment.
>>
>> Thank you very much,
>> Mojca
>
> --
> 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:
https://cmake.org/mailman/listinfo/cmake