Re: [cmake-developers] cmake server mode

2016-09-28 Thread Tobias Hunger
Hi Michele,

cmake -E server mode will always trigger something in cmake, so the
help will report that. I think it is nicer to report "Server mode
unavailable" when somebody attempts to run "cmake -E server" when that
is not available than to produce a "Unknown command".

To check whether or not server mode is available you can run "cmake -E
capabilities": That has a "serverMode" key with a boolean in its JSON
output. Easy to parse:-)

Gcc 4.8 should be new enough to enable it, there is only very light
C++11 usage, but I admit that I am not sure about MSVC2010.

Your build errors seem unrelated to server-mode.

Best Regards,
Tobias

On Thu, Sep 29, 2016 at 1:18 AM, michele pagot  wrote:
> I'm interested in the cmake server mode. I've started from
> https://steveire.wordpress.com/2016/01/24/cmake-daemon-for-user-tools/ and
> then to  https://github.com/steveire/CMake.git and finally to the cmake
> official  git master branch as it seems e
>
> I rebuilt it from scratch on Windows trying both VS2010 and MinGW. With this
> second one, using gcc4.8. Everything seems fine as the build works as
> expected and
>
> the inline help report server mode with both compilers.
>
>
>>> c:\..\cmake\cmake_master\build\buils_vs2010\bin\Debug\cmake.exe -E
>> CMake Error: cmake version 3.6.20160928-g9a9b9
>> Usage:
>> c:\...\cmake\cmake_master\build\buils_vs2010\bin\Debug\cmake.exe -E
>>  [arguments...]
>> Available commands:
>>   capabilities  - Report capabilities built into cmake in JSON
>> format
>>   chdir dir cmd [args...]   - run command in a given directory
>>   compare_files file1 file2 - check if file1 is same as file2
>>   copy ... destination  - copy files to destination (either file or
>> directory)
>>   copy_directory ... destination   - copy content of ...
>> directories to 'destination' directory
>>   copy_if_different ... destination  - copy files if it has changed
>>   echo [...]- displays arguments as text
>>   echo_append [...] - displays arguments as text but no new line
>>   env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...
>> - run command in a modified environment
>>   environment   - display the current environment
>>   make_directory ...   - create parent and  directories
>>   md5sum ...  - create MD5 checksum of files
>>   remove [-f] ... - remove the file(s), use -f to force it
>>   remove_directory dir  - remove a directory and its contents
>>   rename oldname newname- rename a file or directory (on one volume)
>>   server- start cmake in server mode
>>   sleep ... - sleep for given number of seconds
>
>
> but as I try to use it:
>
>>> cmake -E server
>> CMake Error: CMake was not built with server mode enabled
>>
> First issue: server reported in the help even if not included
>
>
> the  new feature seems to be activated only if some special compiler
> capability are fulfilled. So I've changed compiler to gcc5.3 and now I'm
> even nor able to build due to errors like:
>
>
> [  2%] Building CXX object
> Source/kwsys/CMakeFiles/cmsys.dir/RegularExpression.cxx.obj
>
> [  2%] Building CXX object
> Source/kwsys/CMakeFiles/cmsys.dir/SystemTools.cxx.obj
>
> c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx: In
> member function 'bool cmsys::SystemToolsPathCaseCmp::operator()(const
> string&, const string&) const':
>
> c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx:465:43:
> error: 'strcasecmp' was not declared in this scope
>
>  return strcasecmp(l.c_str(), r.c_str()) < 0;
>
>^
>
> c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx: In
> static member function 'static bool cmsys::SystemTools::ComparePath(const
> string&, const string&)':
>
> c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx:4289:43:
> error: 'strcasecmp' was not declared in this scope
>
>return strcasecmp(c1.c_str(), c2.c_str()) == 0;
>
>^
>
> make[2]: *** [Source/kwsys/CMakeFiles/cmsys.dir/SystemTools.cxx.obj] Error 1
>
> make[1]: *** [Source/kwsys/CMakeFiles/cmsys.dir/all] Error 2
>
> make: *** [all] Error 2
>
>
>
> Fixed by:
>
> #endif
>
> #include 
>
> #include 
>
> #include 
>
> #include 
>
> #include 
>
>
>
>
>
>
>
>
>
>
>
> c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive_read.c:825:1:
> error: conflicting types for 'archive_read_data'
>  archive_read_data(struct archive *_a, void *buff, size_t s)
>  ^
> In file included from
> c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive_read.c:51:0:
> c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive.h:581:24:
> note: previous declaration of 'archive_read_data' was here
>  __LA_DECL la_ssize_t   archive_read_data(struct archive *,
> ^
> 

[cmake-developers] cmake server mode

2016-09-28 Thread michele pagot
I'm interested in the cmake server mode. I've started from 
https://steveire.wordpress.com/2016/01/24/cmake-daemon-for-user-tools/ and then 
to  https://github.com/steveire/CMake.git and finally to the cmake official  
git master branch as it seems e

I rebuilt it from scratch on Windows trying both VS2010 and MinGW. With this 
second one, using gcc4.8. Everything seems fine as the build works as expected 
and

the inline help report server mode with both compilers.


>> c:\..\cmake\cmake_master\build\buils_vs2010\bin\Debug\cmake.exe -E
> CMake Error: cmake version 3.6.20160928-g9a9b9
> Usage: c:\...\cmake\cmake_master\build\buils_vs2010\bin\Debug\cmake.exe 
> -E  [arguments...]
> Available commands:
>   capabilities  - Report capabilities built into cmake in JSON 
> format
>   chdir dir cmd [args...]   - run command in a given directory
>   compare_files file1 file2 - check if file1 is same as file2
>   copy ... destination  - copy files to destination (either file or 
> directory)
>   copy_directory ... destination   - copy content of ... 
> directories to 'destination' directory
>   copy_if_different ... destination  - copy files if it has changed
>   echo [...]- displays arguments as text
>   echo_append [...] - displays arguments as text but no new line
>   env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...
> - run command in a modified environment
>   environment   - display the current environment
>   make_directory ...   - create parent and  directories
>   md5sum ...  - create MD5 checksum of files
>   remove [-f] ... - remove the file(s), use -f to force it
>   remove_directory dir  - remove a directory and its contents
>   rename oldname newname- rename a file or directory (on one volume)
>   server- start cmake in server mode
>   sleep ... - sleep for given number of seconds


but as I try to use it:

>> cmake -E server
> CMake Error: CMake was not built with server mode enabled
>
First issue: server reported in the help even if not included

the  new feature seems to be activated only if some special compiler capability 
are fulfilled. So I've changed compiler to gcc5.3 and now I'm even nor able to 
build due to errors like:

[  2%] Building CXX object 
Source/kwsys/CMakeFiles/cmsys.dir/RegularExpression.cxx.obj
[  2%] Building CXX object Source/kwsys/CMakeFiles/cmsys.dir/SystemTools.cxx.obj
c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx: In 
member function 'bool cmsys::SystemToolsPathCaseCmp::operator()(const string&, 
const string&) const':
c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx:465:43: 
error: 'strcasecmp' was not declared in this scope
 return strcasecmp(l.c_str(), r.c_str()) < 0;
   ^
c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx: In 
static member function 'static bool cmsys::SystemTools::ComparePath(const 
string&, const string&)':
c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx:4289:43:
 error: 'strcasecmp' was not declared in this scope
   return strcasecmp(c1.c_str(), c2.c_str()) == 0;
   ^
make[2]: *** [Source/kwsys/CMakeFiles/cmsys.dir/SystemTools.cxx.obj] Error 1
make[1]: *** [Source/kwsys/CMakeFiles/cmsys.dir/all] Error 2
make: *** [all] Error 2

Fixed by:
#endif
#include 
#include 
#include 
#include 
#include 










c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive_read.c:825:1:
 error: conflicting types for 'archive_read_data'
 archive_read_data(struct archive *_a, void *buff, size_t s)
 ^
In file included from 
c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive_read.c:51:0:
c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive.h:581:24:
 note: previous declaration of 'archive_read_data' was here
 __LA_DECL la_ssize_t   archive_read_data(struct archive *,
^
make[2]: *** 
[Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_read.c.obj]
 Error 1
make[1]: *** 
[Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/all] Error 2
make: *** [all] Error 2


-- 

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] Remove RPATH on install

2016-09-28 Thread Ruslan Baratov via cmake-developers

On 28-Sep-16 23:34, Brad King wrote:

On 09/28/2016 04:09 PM, Ruslan Baratov via cmake-developers wrote:

` -Wl,-rpath,` to CMAKE_EXE_LINKER_FLAGS.

That adds it in a way that hides its presence from CMake.  CMake has its
own way to specify RPATH entries in the build tree.  It will replace the
build-tree-only entries with install-tree-only entries (if any) during
installation.
I'm not aware of any better ways to apply global settings for all 
targets without modifying CMakeLists.txt



   Any entries it doesn't know about are assumed to be added
by the toolchain and are thus preserved.

I can't save them because it's full path hence will be not relocatable.



If one uses target_link_libraries to link each executable explicitly
to the shared library via absolute path to the library file then IIRC
CMake will put the RPATH in the build tree for that and remove it on
installation.

Yep, I know.




adding new one, like CMAKE_INSTALL_DELETE_RPATH?

We don't actually define any kind of first-class RPATH-update operation.
It is only an implementation detail that we edit the RPATH on installation.
In principle the design is that there is a build tree RPATH and an install
tree RPATH.  On non-ELF platforms we actually need to re-run the linker
to produce the install tree version.  Therefore CMAKE_INSTALL_DELETE_RPATH
would not fit within our model.

Ok


Instead one could add a BUILD_RPATH target property with CMAKE_BUILD_RPATH
variable that specifies additional entries to put in the build tree RPATH.
This would be the build-tree equivalent to the INSTALL_PATH target property.


Should work too. I will do the tests and send a patch.

Ruslo

--

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] Remove RPATH on install

2016-09-28 Thread Brad King
On 09/28/2016 04:09 PM, Ruslan Baratov via cmake-developers wrote:
> ` -Wl,-rpath,` to CMAKE_EXE_LINKER_FLAGS.

That adds it in a way that hides its presence from CMake.  CMake has its
own way to specify RPATH entries in the build tree.  It will replace the
build-tree-only entries with install-tree-only entries (if any) during
installation.  Any entries it doesn't know about are assumed to be added
by the toolchain and are thus preserved.

If one uses target_link_libraries to link each executable explicitly
to the shared library via absolute path to the library file then IIRC
CMake will put the RPATH in the build tree for that and remove it on
installation.

> adding new one, like CMAKE_INSTALL_DELETE_RPATH?

We don't actually define any kind of first-class RPATH-update operation.
It is only an implementation detail that we edit the RPATH on installation.
In principle the design is that there is a build tree RPATH and an install
tree RPATH.  On non-ELF platforms we actually need to re-run the linker
to produce the install tree version.  Therefore CMAKE_INSTALL_DELETE_RPATH
would not fit within our model.

Instead one could add a BUILD_RPATH target property with CMAKE_BUILD_RPATH
variable that specifies additional entries to put in the build tree RPATH.
This would be the build-tree equivalent to the INSTALL_PATH target property.

-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-developers] Remove RPATH on install

2016-09-28 Thread Ruslan Baratov via cmake-developers

Hi,

I want to link the library to all executables in project so I'm adding 
` -Wl,-rpath,` to CMAKE_EXE_LINKER_FLAGS. That works 
fine however after install step this RPATH was not removed and full path 
to  remains as part of executable in LC_RPATH. As far as I 
understand there is no such variable for now in CMake that holds the 
list of RPATH directories that need to be removed on install step. If it 
is true what about adding new one, like CMAKE_INSTALL_DELETE_RPATH? Just 
for the record  is not a part of CMAKE_INSTALL_PREFIX or 
CMAKE_BINARY_DIR.


Ruslo
--

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] Sort list of files for aux_source_directory() and file(glob, *)

2016-09-28 Thread Brad King
On 09/27/2016 08:07 PM, Junghyun Kim wrote:
> 1) Add the same sort logic of the patch(#14491) to 
> cmAuxSourceDirectoryCommand.cxx
> 2) Apply my patch and remove the sort logic of patch #14491

Please patch cmAuxSourceDirectoryCommand.cxx directly.  KWSys Directory
is a low-level API whose clients may not all need sorting.

Thanks,
-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