Re: [CMake] Generating MSVS solution files that can be passed around

2018-04-19 Thread Konstantin Tokarev


19.04.2018, 18:46, "Zaak Beekman" :
> Greetings fellow CMake users!
>
> While I know this topic has been discussed intermittently over the years I 
> was wondering if anyone had any further insight.
>
> The situation is that we have a client who works with other contractors who 
> use almost exclusively windows and MSVS. This client wants to distribute MSVS 
> solution files with the source code so that other contractors don’t have to 
> install cmake. (There are some restrictions/red tape for installing 
> additional software on the contractor machines…)

Then your best choice is probably Premake (http://premake.github.io/)

>
> I know the official party line is “CMake must use absolute paths, rerun CMake 
> to regenerate the MSVS solution files.” I also know that 
> CMAKE_USE_RELATIVE_PATHS was abandoned.
>
> Does anyone have any updated insight on this issue? Is there any mechanism, 
> other than either manually or automatically editing the solution files to 
> cause them to use relative paths?
>
> Another thought might be to include a statically linked CMake windows binary 
> with the source, but I need to investigate whether the CMake licensing allows 
> for that.
>
> Thanks,
> Zaak
>
> Izaak "Zaak" Beekman
>
> ---
> HPC Scientist
> ParaTools Inc.
> ibeek...@paratools.com
> 1509 16th St, NW
> Washington, DC 20036
> mobile: (917) 797-3239
> ---
> ​
>
> ,--
>
> 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


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


Re: [CMake] Parallel build setup question

2018-02-16 Thread Konstantin Tokarev


16.02.2018, 21:32, "Cornelis Bockemühl" <corne...@bockemuehl.ch>:
> Thanks - that did the trick!
>
> And indeed by entering -j4 in the "Tool arguments" field, the build command 
> changes "magically" into "cmake --build . --target all -- -j4" - with the 
> "--" to pass the argument further to gmake.
>
> Actually compile time of my project after a "clean" went down from 23 to 14 
> min, thus reduction factor 1.6 with 4 processors: I tend to attribute the 
> diffference to "almost 4" to the nature of my project where gmake seems not 
> to see too many opportunities for parallel processing. Maybe it works always 
> module by module, or whatever.
>
> Anyway, my question is answered - thanks again!

Note that if you used Ninja generator, it would use all cores by default.

>
> Regards,
> Cornelis
>
> Am Freitag, den 16.02.2018, 20:25 +0300 schrieb Konstantin Tokarev:
>> 16.02.2018, 20:20, "Cornelis Bockemühl" <corne...@bockemuehl.ch>:
>>> Thanks for your hints! And you are right: it is still interesting to know 
>>> how QtCreator is actually invoking and using cmake.
>>
>> You should go to project settings and change cmake --build arguments there
>>
>>> This is the beginning of a log that the QtCreator was generating during a 
>>> build. Actually with two modules where nothing had to be done, but still 
>>> showing how cmake and gmake are being invoked - and all a bit above my 
>>> understanding of the two tools:
>>>
>>> ===
>>> /usr/bin/cmake -H/Sources/GitLinux/RMT -B/BinariesLinux/RMT/Debug 
>>> --check-build-system CMakeFiles/Makefile.cmake 0
>>> /usr/bin/cmake -E cmake_progress_start /BinariesLinux/RMT/Debug/CMakeFiles 
>>> /BinariesLinux/RMT/Debug/CMakeFiles/progress.marks
>>> /usr/bin/gmake -f CMakeFiles/Makefile2 all
>>> gmake[1]: Entering directory '/BinariesLinux/RMT/Debug'
>>> /usr/bin/gmake -f CMakeFiles/FirstModule.dir/build.make 
>>> CMakeFiles/FirstModule.dir/depend
>>> gmake[2]: Entering directory '/BinariesLinux/RMT/Debug'
>>> cd /BinariesLinux/RMT/Debug && /usr/bin/cmake -E cmake_depends "Unix 
>>> Makefiles" /Sources/GitLinux/RMT /Sources/GitLinux/RMT 
>>> /BinariesLinux/RMT/Debug /BinariesLinux/RMT/Debug 
>>> /BinariesLinux/RMT/Debug/CMakeFiles/FirstModule.dir/DependInfo.cmake 
>>> --color=
>>> gmake[2]: Leaving directory '/BinariesLinux/RMT/Debug'
>>> /usr/bin/gmake -f CMakeFiles/FirstModule.dir/build.make 
>>> CMakeFiles/FirstModule.dir/build
>>> gmake[2]: Entering directory '/BinariesLinux/RMT/Debug'
>>> gmake[2]: Nothing to be done for 'CMakeFiles/FirstModule.dir/build'.
>>> gmake[2]: Leaving directory '/BinariesLinux/RMT/Debug'
>>> [  3%] Built target FirstModule
>>> /usr/bin/gmake -f CMakeFiles/SecondModule.dir/build.make 
>>> CMakeFiles/SecondModule.dir/depend
>>> gmake[2]: Entering directory '/BinariesLinux/RMT/Debug'
>>> cd /BinariesLinux/RMT/Debug && /usr/bin/cmake -E cmake_depends "Unix 
>>> Makefiles" /Sources/GitLinux/RMT /Sources/GitLinux/RMT 
>>> /BinariesLinux/RMT/Debug /BinariesLinux/RMT/Debug 
>>> /BinariesLinux/RMT/Debug/CMakeFiles/SecondModule.dir/DependInfo.cmake 
>>> --color=
>>> gmake[2]: Leaving directory '/BinariesLinux/RMT/Debug'
>>> /usr/bin/gmake -f CMakeFiles/SecondModule.dir/build.make 
>>> CMakeFiles/SecondModule.dir/build
>>> gmake[2]: Entering directory '/BinariesLinux/RMT/Debug'
>>> gmake[2]: Nothing to be done for 'CMakeFiles/SecondModule.dir/build'.
>>> gmake[2]: Leaving directory '/BinariesLinux/RMT/Debug'
>>> [  6%] Built target SecondModule
>>> ...
>>> ===
>>>
>>> For example I do not really understand all the parameters that are passed 
>>> to cmake - and I do not find them in the documentation either (like -H, -B 
>>> or --check-build-system...
>>>
>>> Regards,
>>> Cornelis
>>>
>>> Am Freitag, den 16.02.2018, 08:59 -0800 schrieb Michael Ellery:
>>>> I don’t know anything about QTCreator, but the question really boils down 
>>>> to how to get your IDE to pass extra args to the build tool - it’s not 
>>>> really a cmake issue except to the extent that CMake can be used to invoke 
>>>> the build step (after it has been used to generate the build). It sounds 
>>>> like QT uses “cmake --build” to do the build phase (which makes sens

Re: [CMake] Parallel build setup question

2018-02-16 Thread Konstantin Tokarev
  16.02.2018, 20:20, "Cornelis Bockemühl" :Thanks for your hints! And you are right: it is still interesting to know how QtCreator is actually invoking and using cmake.You should go to project settings and change cmake --build arguments there  This is the beginning of a log that the QtCreator was generating during a build. Actually with two modules where nothing had to be done, but still showing how cmake and gmake are being invoked - and all a bit above my understanding of the two tools: ===/usr/bin/cmake -H/Sources/GitLinux/RMT -B/BinariesLinux/RMT/Debug --check-build-system CMakeFiles/Makefile.cmake 0/usr/bin/cmake -E cmake_progress_start /BinariesLinux/RMT/Debug/CMakeFiles /BinariesLinux/RMT/Debug/CMakeFiles/progress.marks/usr/bin/gmake -f CMakeFiles/Makefile2 allgmake[1]: Entering directory '/BinariesLinux/RMT/Debug'/usr/bin/gmake -f CMakeFiles/FirstModule.dir/build.make CMakeFiles/FirstModule.dir/dependgmake[2]: Entering directory '/BinariesLinux/RMT/Debug'cd /BinariesLinux/RMT/Debug && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /Sources/GitLinux/RMT /Sources/GitLinux/RMT /BinariesLinux/RMT/Debug /BinariesLinux/RMT/Debug /BinariesLinux/RMT/Debug/CMakeFiles/FirstModule.dir/DependInfo.cmake --color=gmake[2]: Leaving directory '/BinariesLinux/RMT/Debug'/usr/bin/gmake -f CMakeFiles/FirstModule.dir/build.make CMakeFiles/FirstModule.dir/buildgmake[2]: Entering directory '/BinariesLinux/RMT/Debug'gmake[2]: Nothing to be done for 'CMakeFiles/FirstModule.dir/build'.gmake[2]: Leaving directory '/BinariesLinux/RMT/Debug'[  3%] Built target FirstModule/usr/bin/gmake -f CMakeFiles/SecondModule.dir/build.make CMakeFiles/SecondModule.dir/dependgmake[2]: Entering directory '/BinariesLinux/RMT/Debug'cd /BinariesLinux/RMT/Debug && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /Sources/GitLinux/RMT /Sources/GitLinux/RMT /BinariesLinux/RMT/Debug /BinariesLinux/RMT/Debug /BinariesLinux/RMT/Debug/CMakeFiles/SecondModule.dir/DependInfo.cmake --color=gmake[2]: Leaving directory '/BinariesLinux/RMT/Debug'/usr/bin/gmake -f CMakeFiles/SecondModule.dir/build.make CMakeFiles/SecondModule.dir/buildgmake[2]: Entering directory '/BinariesLinux/RMT/Debug'gmake[2]: Nothing to be done for 'CMakeFiles/SecondModule.dir/build'.gmake[2]: Leaving directory '/BinariesLinux/RMT/Debug'[  6%] Built target SecondModule...=== For example I do not really understand all the parameters that are passed to cmake - and I do not find them in the documentation either (like -H, -B or --check-build-system... Regards,Cornelis Am Freitag, den 16.02.2018, 08:59 -0800 schrieb Michael Ellery:I don’t know anything about QTCreator, but the question really boils down to how to get your IDE to pass extra args to the build tool - it’s not really a cmake issue except to the extent that CMake can be used to invoke the build step (after it has been used to generate the build).  It sounds like QT uses “cmake --build” to do the build phase (which makes sense), so you just need to add your “-j N” argument to the build step invocation. If you believe this:  https://doc.qt.io/qtcreator/creator-build-settings.html, then it sounds like maybe “Tool Arguments” is what you want (see “CMake Build Steps”) ?  BTW, the way I do this myself (since I don’t use an IDE) is something like “cmake --build . -- -j 8”  where the double dash stops shell argument processing and effectively passes everything else on to the build tool that cmake ultimately invokes (e.g. make or ninja or msbuild, etc.)

HTH,
Mike


On Feb 16, 2018, at 8:31 AM, Cornelis Bockemühl  wrote:

Hello,

Somehow I seem to miss some crucial point regarding setup for parallel build with CMake, so I would be happy if somebody can push me the last few millimeters to hit my target!

My configuration is on OpenSuse Linux (Leap - 64-bit), working with QtCreator and CMake, using the "make" configuration.

I learned from "the internet" that actually I would have to pass a -jN option to make or gmake (with N being the max number of processors I want to use). Or even more elegant: go for a -lN option to somehow balance the load. Sounds good!

But what I do not see is how to pass these nice options to make through CMake and QtCreator! One attempt was to specify CMAKE_CXX_FLAGS=-j4 or the like because some comment "in the internet" seemed to suggest this. However, like I already feared: this passes the option to the compiler call - and that is the wrong address for it, so I get an error message.

Basically I think that it is 99% a CMake question and maximum 1% a QtCreator problem, so I am asking this question here.

And now I am stuck - if not some friendly and knowing person can help me out of this!

Thanks for any helpful hint!
Cornelis
-- 

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 

Re: [CMake] how to detect architecture ?

2018-01-19 Thread Konstantin Tokarev


19.01.2018, 21:22, "Chuck Atkins" <chuck.atk...@kitware.com>:
> Hi Franck,
>
> I'd suggest going a little more robust by using both 
> CMAKE_SHARED_LIBRARY_PREFIX and CMAKE_SHARED_LIBRARY_SUFFIX to generate a 
> function at configure time to resolve the correct filename.
>
> For example, util.h.in:
>
> #ifndef _UTIL_H_
> #define _UTIL_H_
>
> #include 
>
> static inline
> void get_library_filename(char* filename, const char* libname)
> {
>   sprintf(filename, 
> "@CMAKE_SHARED_LIBRARY_PREFIX@%s@CMAKE_SHARED_LIBRARY_SUFFIX@", libname);
> }
>
> #endif /* _UTIL_H_ */
>
> Then your CMakeLists.txt:
>
> configure_file(
>   ${CMAKE_CURRENT_SOURCE_DIR}/util.h.in
>   ${CMAKE_CURRENT_BINARY_DIR}/util.h
>   @ONLY
> )
> add_executable(foo main.c ${CMAKE_CURRENT_BINARY_DIR}/util.h)
> target_include_directories(foo PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
>
> And finally main.c:
>
> #include 
> #include 
>
> int main(int argc, char **argv)
> {
>   char filename[256];
>
>   get_library_filename(filename, "foo");
>
>   printf("Library foo uses file %s\n", filename);
>
>   return 0;
> }
>
> This will give you "libfoo.so" on Linux, "libfoo.dylib" on Apple, and 
> "foo.dll" on Windows.

Note that Windows DLLs may also happen to have to lib prefix (e.g. CMake adds 
them
by default when building projects with MinGW).

>
> ------
> Chuck Atkins
> Staff R Engineer, Scientific Computing
> Kitware, Inc.
>
> On Tue, Jan 9, 2018 at 10:04 AM, Franck Houssen <franck.hous...@inria.fr> 
> wrote:
>> Thanks !
>>
>> - Mail original -
>>> De: "Konstantin Tokarev" <annu...@yandex.ru>
>>> À: "Franck Houssen" <franck.hous...@inria.fr>, "CMake Mail List" 
>>> <cmake@cmake.org>
>>> Envoyé: Mardi 9 Janvier 2018 16:00:55
>>> Objet: Re: [CMake] how to detect architecture ?
>>>
>>>
>>>
>>> 09.01.2018, 17:58, "Franck Houssen" <franck.hous...@inria.fr>:
>>> > Is there a way to detect architecture ?
>>> >
>>> > Seems there is nothing simple since these old threads :
>>> > https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake/12024211#12024211
>>> > https://stackoverflow.com/questions/16796629/cmake-create-architecture-aware-makefile
>>> >
>>> > Is there a solution now ?
>>> >
>>> > My need is quite simple: I have an executable who needs dlopen. To test 
>>> > it,
>>> > I planned to write a bash script that would have done "./exe
>>> > /path/to/lib.so" on linux (debian, ...) OR "./exe /path/to/lib.dylib" on
>>> > osx. To replace correctly so/dylib in the bash script I need to know the
>>> > architecture. Any idea how to do this ?
>>>
>>> ${CMAKE_SHARED_LIBRARY_SUFFIX}
>>>
>>
>> Oh man ! Didn't know this one : exactly what I was looking for
>>
>>> > Franck
>>> > ,--
>>> >
>>> > 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
>>>
>>>
>>> --
>>> 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


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


Re: [CMake] Using CMake to compile non-standard languages

2018-01-16 Thread Konstantin Tokarev


16.01.2018, 13:39, "Jakob van Bethlehem" :
> Dear all,
>
> Currently I'm trying to make a case to convert the pure makefile-based build 
> environment at my company into cmake. This is a rather extensive build 
> environment, which takes care of many things automatically through a whole 
> set of internally created tools. I still believe we can do better with CMake, 
> but I need to make a strong case.
>
> The main problem is that we have (very old) code in an obsure languange 
> called 'Ratfor'. How can I tell CMake how to compile files written in that 
> language?

1. Create variable with list of source files
2. Iterate through it in cycle and use add_custom_command for each file, 
defining compilation rule

Note that unlike Make, CMake doesn't have any counterpart of suffix or template 
user-defined rules, so you have to use cycles.

>
> Sincerely,
> Jakob van Bethlehem
>
> ,--
>
> 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


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


Re: [CMake] Querying CMake variables of external CMake projects

2018-01-13 Thread Konstantin Tokarev


13.01.2018, 06:26, "Saad Khattak" :
> Hi,
>
> Say I find LibA using find_package(LibA) and I now have access to LibA_DIR, 
> which is the build folder of LibA. Is there a way I can query additional 
> variables, such as LibA's source directory, install directory etc. i.e. 
> variables that are defined by CMake when LibA was being generated/built by 
> CMake?

If  find_package(LibA) provides you target "LibA" (i.e., cmake code under "if 
(TARGET LibA)"
condition is being executed), you can query various properties from it and 
expect them to
have sane values. See documentation on cmake properties.

If there is no LibA target, it probably means that find_package(LibA) is 
implemented via
FindLibA.cmake module, and you can only use variables that it sets (usually 
documented in
the beginning of module)

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


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


Re: [CMake] Do any CMake back ends have support for parallel builds that efficiently use clusters?

2018-01-12 Thread Konstantin Tokarev


12.01.2018, 12:58, "Alan W. Irwin" :
> I am looking into the practicality of using clusters containing ~5
> cheap ARM 8-core computers (such as the Banana Pi M3) to rapidly build
> and test software (since even with ccache I am currently spending a
> lot of my time waiting for tests to complete as I develop my
> software). Such clusters would give you ~40 cores which is a lot of
> computer power for ~$500 or so. But, of course, the issue with
> clusters is how to use them efficiently?

1. For compilation you often need good single-core performance more
than parallelism, and I doubt that embedded-grade ARMv8 can provide it

I guess exception is compiling projects written in C which don't have huge
source files. Still, overhead of passing data between nodes may be
substanital.

2. You should probably use icecc or distcc, unless you have MPI as a
requirement.

>
> For one 8-core M3 you would expect
>
> make -j target
>
> to scale linearly with NNN up to the saturation limit of roughly NNN=8
> (where target depends on ~hundreds of different and mostly independent
> tests). But my understanding from recent Google searching is that the
> -j option for GNU Make is not MPI-aware, i.e., only works for the
> cores for a single computer (node) in a cluster. So in a cluster you
> would have to assign the above task to just one node and simply accept
> that you cannot scale NNN up to the total number of cores in that
> cluster.
>
> I did find one reference to an effort (called the pmake project at
> Lawrence Livermore, see )
> to modify GNU make to become MPI-aware so the above command would
> roughly scale NNN up to the number of cores in the cluster. But the
> single developer of the project seemed unable to overcome a bug in the
> result so that parallel make project was abandoned.
>
> I hope someone here can point me to a make variant (does Ninja
> qualify?) that does have the capability of scaling NNN up to the
> number of cores in the cluster since that would make clusters with a
> large number of cores become extremely useful for the purpose of quick
> testing by software developers.
>
> Alan
> __
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state
> implementation for stellar interiors (freeeos.sf.net); the Time
> Ephemerides project (timeephem.sf.net); PLplot scientific plotting
> software package (plplot.sf.net); the libLASi project
> (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
> and the Linux Brochure Project (lbproject.sf.net).
> __
>
> Linux-powered Science
> __
> --
>
> 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

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


Re: [CMake] CMake support for MYS2

2018-01-10 Thread Konstantin Tokarev


10.01.2018, 11:40, "Mojca Miklavec" <mojca.miklavec.li...@gmail.com>:
> 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


Re: [CMake] how to detect architecture ?

2018-01-09 Thread Konstantin Tokarev


09.01.2018, 17:58, "Franck Houssen" :
> Is there a way to detect architecture ?
>
> Seems there is nothing simple since these old threads :
> https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake/12024211#12024211
> https://stackoverflow.com/questions/16796629/cmake-create-architecture-aware-makefile
>
> Is there a solution now ?
>
> My need is quite simple: I have an executable who needs dlopen. To test it, I 
> planned to write a bash script that would have done "./exe /path/to/lib.so" 
> on linux (debian, ...) OR "./exe /path/to/lib.dylib" on osx. To replace 
> correctly so/dylib in the bash script I need to know the architecture. Any 
> idea how to do this ?

${CMAKE_SHARED_LIBRARY_SUFFIX}

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


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


Re: [CMake] how to port to cmake a project using gnulib

2018-01-09 Thread Konstantin Tokarev
Alfred: Gnulib isn't library in usual sense, AFAIK it's a bunch of source files 
some of which
may be added to the project if needed

Cosimo: I think you should stay with autotools, otherwsie it might be a can of 
worms.
Or get rid of gnulib.


09.01.2018, 15:55, "Cosimo Lupo" :
> This is from the gnulib mailing list in reply to a similar question on how to 
> use gnulib without autotools:
>
> https://lists.gnu.org/archive/html/bug-gnulib/2010-02/msg00248.html
>
> "Gnulib depends heavily on autoconf and automake.
> You could manually extract the portions you think you need
> and attempt to use them without the requisite glue, but that is
> very error-prone."
>
> :,(
>
> On Tue, Jan 9, 2018 at 12:50 PM Cosimo Lupo  wrote:
>> Thanks for your help, Alfred.
>>
>> The problem is that very concept of "external dependency" seems to be at 
>> odds with the way gnulib is supposed to work.
>>
>> And the docs are clear that "Gnulib assumes that your project uses Autoconf. 
>> When using Gnulib, you will need to have Autoconf among your build tools."
>>
>> https://www.gnu.org/software/gnulib/manual/html_node//Initial-import.html#Initial-import
>>
>> Anyway, let's see if others have any more clues.
>>
>> Cheers
>>
>> Cosimo
>>
>> On Tue, Jan 9, 2018 at 12:36 PM Alfred Sawaya  wrote:
>>> Sorry, I did not got this hint.
>>>
>>> Well, you might still use gnulib as an external dependency 
>>> (https://www.gnu.org/software/gnulib/manual/html_node/POSIX-Substitutes-Library.html#POSIX-Substitutes-Library).
>>>  Maybe be it worth considering a better separation if the build tool is 
>>> different.
>>>
>>> I need to read more about gnulib to give you a better answer. Maybe someone 
>>> already has a clue on the list.
>>>
>>> Regards,
>>>
>>> Cordialement,
>>>
>>> Alfred Sawaya
>>>
>>> De: cos...@anthrotype.com
>>> Envoyé: 9 janvier 2018 1:17 PM
>>> À: alf...@huji.fr
>>> Cc: cmake@cmake.org
>>> Objet: Re: [CMake] how to port to cmake a project using gnulib
>>> Thanks.
>>> However, that's not exactly what I was looking for. The gnulib, by design, 
>>> is not an external library that you link with, but a collection of modules 
>>> that are meant to be copied into one's project.
>>> I would like to build ttfautohint with cmake (and ninja), not just adding 
>>> ttfautohint as an external project built with autotools and GNU make.
>>>
>>> On Tue, Jan 9, 2018 at 12:10 PM Alfred Sawaya  wrote:
 Hello,

 I have some CMake projects that depend on autotools bases libs.
 I compile them as External project.

 https://cmake.org/cmake/help/latest/module/ExternalProject.html

 Regards

 Cordialement,

 Alfred Sawaya

 De: cos...@anthrotype.com
 Envoyé: 9 janvier 2018 1:01 PM
 À: cmake@cmake.org
 Objet: [CMake] how to port to cmake a project using gnulib
 Hello,

 I'm new to Cmake.

 I would like to port to cmake a project that is currently built with the 
 Autotools and depends on gnulib, the GNU Portability Library: 
 https://www.gnu.org/software/gnulib/

 (The project in question is https://www.freetype.org/ttfautohint/)

 It appears that gnulib itself is very much tied with 
 autoconf/automake/libtool.

 In fact I couldn't find any examples of other CMake based projects that 
 use gnulib.

 Does anyone has any tips or examples on how I could proceed?

 Thank you,

 Cosimo Lupo

 --
 Cosimo Lupo
>>>
>>> --
>>> Cosimo Lupo
>>
>> --
>> Cosimo Lupo
>
> --
> Cosimo Lupo
> ,--
>
> 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


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


Re: [CMake] CMake support for MYS2

2018-01-08 Thread Konstantin Tokarev


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). You've installed
package that targets MSYS environment, not native Windows.

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

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


Re: [CMake] CMake: using dlopen

2018-01-07 Thread Konstantin Tokarev


07.01.2018, 21:13, "Franck Houssen" :
> 
>> De: "Roger Leigh" 
>> À: "Franck Houssen" 
>> Cc: cmake@cmake.org
>> Envoyé: Dimanche 7 Janvier 2018 18:14:04
>> Objet: Re: [CMake] CMake: using dlopen
>>
>>  Original message 
>> From: Franck Houssen 
>> Date: 07/01/2018 13:58 (GMT+00:00)
>> To: Roger Leigh 
>> Cc: cmake@cmake.org
>> Subject: Re: [CMake] CMake: using dlopen
>>
>>> OK, thanks. So, I go with: target_link_libraries(main PUBLIC ... 
>>> ${CMAKE_DL_LIBS})
>>
>> Use PRIVATE if it is not used in any headers--it's an internal 
>> implementation detail.
>
> Difference between PUBLIC/PRIVATE has never been clear to me (usually I 
> always use PUBLIC).
> main.cpp includes dlfcn.h and uses it: not sure to get what you meant 
> (PRIVATE is for templates ? when a header include headers ?)

You should use target_link_libraries(A PUBLIC B) if and only if anything that 
links with library A must also link with library B (usually because B's types 
are used in public API of A). If A is not a library, there is no difference.

>
>> Regards,
>> Roger
>
> ,--
>
> 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


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


Re: [CMake] CMake: using dlopen

2018-01-07 Thread Konstantin Tokarev


07.01.2018, 19:36, "Franck Houssen" <franck.hous...@inria.fr>:
> - Mail original -
>>  De: "Konstantin Tokarev" <annu...@yandex.ru>
>>  À: "Franck Houssen" <franck.hous...@inria.fr>
>>  Cc: cmake@cmake.org, "Roger Leigh" <rle...@codelibre.net>
>>  Envoyé: Dimanche 7 Janvier 2018 15:20:08
>>  Objet: Re: [CMake] CMake: using dlopen
>>
>>  > - Mail original -
>>  >
>>  >> De: "Roger Leigh" <rle...@codelibre.net>
>>  >> À: cmake@cmake.org
>>  >> Envoyé: Samedi 6 Janvier 2018 18:42:11
>>  >> Objet: Re: [CMake] CMake: using dlopen
>>  >>
>>  >> On 06/01/18 17:01, J Decker wrote:
>>  >>> CMake/shared/modules will define the CMAKE_DL_LIBS which a very high
>>  >>> percentage of the time will just be library 'dl' .
>>  >
>>  > OK. I didn't know that. But if so, why don't you see CMAKE_DL_LIBS when 
>> you
>>  > run "cmake -LA ." and/or when you toggle adanced mode in ccmake ? What's
>>  > the correct way to see all variables ?
>>
>>  Because cmake -L shows only cached variables, not all variables
>
> How to see all variables ?

See first part of https://stackoverflow.com/a/9328525

>
>>  >
>>  >>>
>>  >>> Pretty much any man page on dlopen defines 'dl'
>>  >>
>>  >> On Linux. On MaxOSX and FreeBSD not at all, where the dl functions are
>>  >> in libSystem and libc, respectively. Using CMAKE_DL_LIBS does the right
>>  >> thing on all platforms (though I wish it was an imported target to make
>>  >> exports a bit nicer).
>>  >
>>  > OK, thanks. So, I go with: target_link_libraries(main PUBLIC ...
>>  > ${CMAKE_DL_LIBS})
>>  >
>>  >> Regards,
>>  >> Roger
>>  >> --
>>  >>
>>  >> 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
>>  --
>>  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


Re: [CMake] CMake: using dlopen

2018-01-07 Thread Konstantin Tokarev


> - Mail original -
> 
>> De: "Roger Leigh" 
>> À: cmake@cmake.org
>> Envoyé: Samedi 6 Janvier 2018 18:42:11
>> Objet: Re: [CMake] CMake: using dlopen
>>
>> On 06/01/18 17:01, J Decker wrote:
>>> CMake/shared/modules will define the CMAKE_DL_LIBS which a very high
>>> percentage of the time will just be library 'dl' .
> 
> OK. I didn't know that. But if so, why don't you see CMAKE_DL_LIBS when you 
> run "cmake -LA ." and/or when you toggle adanced mode in ccmake ? What's the 
> correct way to see all variables ?

Because cmake -L shows only cached variables, not all variables

> 
>>>
>>> Pretty much any man page on dlopen defines 'dl'
>>
>> On Linux. On MaxOSX and FreeBSD not at all, where the dl functions are
>> in libSystem and libc, respectively. Using CMAKE_DL_LIBS does the right
>> thing on all platforms (though I wish it was an imported target to make
>> exports a bit nicer).
> 
> OK, thanks. So, I go with: target_link_libraries(main PUBLIC ... 
> ${CMAKE_DL_LIBS})
> 
>> Regards,
>> Roger
>> --
>>
>> 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
-- 
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


Re: [CMake] ExternalProject_Add and Git Update? How do I make these work?

2017-12-22 Thread Konstantin Tokarev


> ExternalProject_Add(${extProjectName}
> GIT_REPOSITORY "git://github.com/BlueQuartzSoftware/discount.git"
> GIT_PROGRESS 1
> #GIT_TAG master
> 
> TMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/tmp/${CMAKE_BUILD_TYPE}"
> STAMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Stamp"
> DOWNLOAD_DIR ${DREAM3D_SDK}/superbuild/${extProjectName}/Download
> SOURCE_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Source"
> BINARY_DIR 
> "${DREAM3D_SDK}/superbuild/${extProjectName}/Build/${CMAKE_BUILD_TYPE}"
> INSTALL_DIR 
> "${DREAM3D_SDK}/${extProjectName}-${discount_VERSION}-${CMAKE_BUILD_TYPE}"
> 
> #UPDATE_COMMAND "${GIT_EXECUTABLE} pull --rebase origin master"
> PATCH_COMMAND ""
> 
> CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
> 
> LOG_DOWNLOAD 1
> LOG_UPDATE 1
> LOG_CONFIGURE 1
> LOG_BUILD 1
> LOG_TEST 1
> LOG_INSTALL 1
> )
> 
> The above is my cmake code. This worked great the first time through. Then I 
> discovered an issue in the project that I was cloning (discount) and fixed it 
> and pushed it. Now the repository at GitHub is a few commits ahead of what I 
> have. 

If you want to make modifications in projects that you build with 
ExternalProject, you might want to use
git submodules instead of specifying GIT_REPOSITORY in ExternalProject_Add

>So I rerun CMake and then "ninja" and I get an error when the "update" command 
>is run:
> 
> Cannot rebase: You have unstaged changes.
> Please commit or stash them.
> No rebase in progress?
> CMake Error at 
> /Users/Shared/DREAM3D_SDK/superbuild/discount/tmp/Debug/discount-gitupdate.cmake:105
>  (message):
> 
> Failed to rebase in:
> '/Users/Shared/DREAM3D_SDK/superbuild/discount/Source/'.
> 
> You will have to resolve the conflicts manually
> 
> Doing a "git status" in the "Source" directory gives this:
> 
> [mjackson@ferb:Source]$ git status
> On branch master
> Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
> (use "git pull" to update your local branch)
> Untracked files:
> (use "git add ..." to include in what will be committed)
> 
> "tests/mu\303\261oz.t"
> 
> nothing added to commit but untracked files present (use "git add" to track)
> 
> There was something funning with the file that is untracked. Not sure if this 
> is causing the issues?
> 
> --
> Michael Jackson | Owner, President
> BlueQuartz Software
> [e] mike.jack...@bluequartz.net
> [w] www.bluequartz.net
> 
> --
> 
> 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
-- 
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


Re: [CMake] CMake fixup_bundle for ubuntu 16.04

2017-12-14 Thread Konstantin Tokarev


13.12.2017, 23:08, "Daniel Schepler" :
> You would need to set the INSTALL_RPATH property of the targets to something 
> like "$ORIGIN/../lib" .
>
> You might also need to add "-Wl,--disable-new-dtags" to the 
> CMAKE_*_LINK_FLAGS variables - otherwise, the RPATH settings will only take 
> effect for direct dependencies of the executables (and any plugins or shared 
> libraries) you build but not for dependencies of these dependencies.
>
> (We also tend not to include copies of glibc or OpenGL libraries - for the 
> former, that tends to have issues if there are any mismatches between the 
> exact build of glibc included in the installer and the NSS modules from the 
> system.  For the latter, the OpenGL libraries vary too much between Mesa and 
> the NVidia and AMD proprietary driver versions for any one of them to work on 
> all systems.)

Note that if your application loads at least one library from the host system, 
you must use system libc.

(Also, bundling libc requires rewriting of loader (INTERP ELF header), it can 
be done with patchelf --set-interpreter)

> --
> Daniel Schepler
> 
> From: CMake [cmake-boun...@cmake.org] on behalf of Waldo Valenzuela via CMake 
> [cmake@cmake.org]
> Sent: Wednesday, December 13, 2017 11:15 AM
> To: Miklos Espak
> Cc: cmake@cmake.org
> Subject: Re: [CMake] CMake fixup_bundle for ubuntu 16.04
>
> Dear Miklos,
>
> thanks for the email, and your suggestions, but the problem with fixup_bundle 
> in ubuntu is that is not fixing the libraries locations from the executables 
> meaning:
>
> if I execute the idd command like this “ idd ./app” where “app” is the 
> executable, the locations of the library is still is “no found", that should 
> be in the location that was copy after running the INSTALL.
>
> when you set LD_LIBRARY_PATH is for a temporally solution, or permanent if I 
> modified the environment configuration of O.S.. The idea is that I want to 
> create a standalone application.
>
> Under this scenario, if I have an executable called “app” and a shared 
> library call “lib.so”, fixup_bundle should fix the location of the “lib.so” 
> in the same folder where is “app”.
>
> Then if I run the command "idd ./app” the output should be:
>
> lib.so => “”, where  is folder where is located “app"
>
> Cheers,
>
> Waldo.
>
>> On 13 Dec 2017, at 03:58, Miklos Espak  wrote:
>>
>> Hi,
>>
>> you need to add the directory where the Qt libs have been installed (along 
>> with your application binaries) to the LD_LIBRARY_PATH. In your case it is 
>> '/home/waldo/Developer/install/Release/bratumia/bin/', as I see.
>>
>> Also, you do *not* need to add the Qt plugin directories to the library 
>> path. The plugins are loaded at run-time. So that they can be found, you 
>> need to install a qt.conf file in the bin directory with the following 
>> contents:
>>
>> [Paths]
>> Prefix=.
>>
>> You also do *not* need to add "/usr/lib" and "/usr/lib/x86-..." to the 
>> library path. These libraries are searched for by default. If you did it 
>> because your Qt installation is there, that's wrong. The fixup_bundle 
>> function should have copied the necessary Qt libs in the install bin folder, 
>> so you just need to add that folder to the path.
>>
>> Also, make sure that the DIRS variable contains all the directories where 
>> there are libraries to install, including dependencies.
>>
>> I hope that helps.
>>
>> Best regards,
>> Miklos
>>
>> On 11 December 2017 at 19:07, Waldo Valenzuela via CMake  
>> wrote:
>>> Dear All,
>>>
>>> I am working on a multi-platform desktop app with Qt5-VTK8, on Windows and 
>>> Mac no problem to created the standalone app, but in Ubuntu 16.04  I have 
>>> several problems.
>>>
>>> I am using CodeBlocks to compile and run the app, and from CodeBlocks when 
>>> I run the app there is no problem, it work normally like in windows and 
>>> mac, but after run the installation, and If I want to run the app from the 
>>> installation folder (./app ) I have several problems.
>>>
>>> the CMakeList.txt is
>>>
>>> FILE(GLOB_RECURSE QTPLUGINS_IMAGEFORMATS 
>>> ${QT_BASE_DIRECTORY}/plugins/imageformats/*${CMAKE_SHARED_LIBRARY_SUFFIX})
>>> FILE(GLOB_RECURSE QTPLUGINS_PLATFORMS 
>>> ${QT_BASE_DIRECTORY}/plugins/platforms/*${CMAKE_SHARED_LIBRARY_SUFFIX})
>>>
>>> SET(QTPLUGINS ${QTPLUGINS_IMAGEFORMATS} ${QTPLUGINS_PLATFORMS})
>>>
>>> MESSAGE("Project libraries: ${QTPLUGINS}")
>>>
>>> INSTALL(CODE "
>>>         INCLUDE(BundleUtilities)
>>>         FIXUP_BUNDLE(\"${APPS}\" \"${QTPLUGINS}\" \"${DIRS}\")
>>>              "
>>>         COMPONENT ${PROJECT_NAME})
>>>
>>> First I have this:
>>>
>>> -- fixup_bundle: fixing...
>>> -- 132/260: fix-up not required on this platform 
>>> '/home/waldo/Developer/Qt/5.6.3/gcc_64/plugins/imageformats/libqicns.so'
>>> -- 133/260: fix-up not required on this platform 
>>> 

Re: [CMake] CMake fixup_bundle for ubuntu 16.04

2017-12-13 Thread Konstantin Tokarev
  13.12.2017, 22:16, "Waldo Valenzuela via CMake" :Dear Miklos, thanks for the email, and your suggestions, but the problem with fixup_bundle in ubuntu is that is not fixing the libraries locations from the executables meaning: if I execute the idd command like this “ idd ./app” where “app” is the executable, the locations of the library is still is “no found", that should be in the location that was copy after running the INSTALL. when you set LD_LIBRARY_PATH is for a temporally solution, or permanent if I modified the environment configuration of O.S.. The idea is that I want to create a standalone application. Under this scenario, if I have an executable called “app” and a shared library call “lib.so”, fixup_bundle should fix the location of the “lib.so” in the same folder where is “app”. Then if I run the command "idd ./app” the output should be: lib.so => “”, where  is folder where is located “app" Use linuxdeployqt (https://github.com/probonopd/linuxdeployqt)  Cheers, Waldo.  On 13 Dec 2017, at 03:58, Miklos Espak  wrote: Hi, you need to add the directory where the Qt libs have been installed (along with your application binaries) to the LD_LIBRARY_PATH. In your case it is '/home/waldo/Developer/install/Release/bratumia/bin/', as I see. Also, you do *not* need to add the Qt plugin directories to the library path. The plugins are loaded at run-time. So that they can be found, you need to install a qt.conf file in the bin directory with the following contents: [Paths]Prefix=. You also do *not* need to add "/usr/lib" and "/usr/lib/x86-..." to the library path. These libraries are searched for by default. If you did it because your Qt installation is there, that's wrong. The fixup_bundle function should have copied the necessary Qt libs in the install bin folder, so you just need to add that folder to the path. Also, make sure that the DIRS variable contains all the directories where there are libraries to install, including dependencies. I hope that helps. Best regards,Miklos   On 11 December 2017 at 19:07, Waldo Valenzuela via CMake  wrote:Dear All,I am working on a multi-platform desktop app with Qt5-VTK8, on Windows and Mac no problem to created the standalone app, but in Ubuntu 16.04  I have several problems.I am using CodeBlocks to compile and run the app, and from CodeBlocks when I run the app there is no problem, it work normally like in windows and mac, but after run the installation, and If I want to run the app from the installation folder (./app ) I have several problems.the CMakeList.txt isFILE(GLOB_RECURSE QTPLUGINS_IMAGEFORMATS ${QT_BASE_DIRECTORY}/plugins/imageformats/*${CMAKE_SHARED_LIBRARY_SUFFIX})FILE(GLOB_RECURSE QTPLUGINS_PLATFORMS ${QT_BASE_DIRECTORY}/plugins/platforms/*${CMAKE_SHARED_LIBRARY_SUFFIX})SET(QTPLUGINS ${QTPLUGINS_IMAGEFORMATS} ${QTPLUGINS_PLATFORMS})MESSAGE("Project libraries: ${QTPLUGINS}")INSTALL(CODE "        INCLUDE(BundleUtilities)        FIXUP_BUNDLE(\"${APPS}\" \"${QTPLUGINS}\" \"${DIRS}\")             "        COMPONENT ${PROJECT_NAME})First I have this:-- fixup_bundle: fixing...-- 132/260: fix-up not required on this platform '/home/waldo/Developer/Qt/5.6.3/gcc_64/plugins/imageformats/libqicns.so'-- 133/260: fix-up not required on this platform '/home/waldo/Developer/install/Release/bratumia/bin/libQt5Core.so.5'-- 134/260: fix-up not required on this platform '/home/waldo/Developer/install/Release/bratumia/bin/libQt5Gui.so.5’-- 167/260: fix-up not required on this platform '/home/waldo/Developer/install/Release/bratumia/bin/libITKEXPAT-4.13.so.1'-- 168/260: fix-up not required on this platform '/home/waldo/Developer/install/Release/bratumia/bin/libITKIOBMP-4.13.so.1'-- 169/260: fix-up not required on this platform '/home/waldo/Developer/install/Release/bratumia/bin/libITKIOBioRad-4.13.so.1then when I run: ldd ./app I have:        libQt5Concurrent.so.5 => not found        libvtkRenderingImage-9.0.so.1 => not found        libvtkRenderingVolumeOpenGL2-9.0.so.1 => not foundthen if I fix manually the path of the libraries like this:export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib:/usr/lib/x86_64-linux-gnu:/home/waldo/app/bin/plugins/imageformats:/home/waldo/app/bin/plugins/platforms"I can run the application from through the command line from the installation folder, but I have this message and I can not see nothingQXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabledQOpenGLWidget: Failed to create contextcomposeAndFlush: makeCurrent() failedI think that the FIXUP_BUNDLE is doing nothing.Any help is welcome.Best regards,Waldo.--Powered by www.kitware.comPlease keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQKitware offers various services to support the CMake community. For more information on each offering, please visit:CMake Support: http://cmake.org/cmake/help/support.htmlCMake Consulting: 

Re: [CMake] MinGW Compilers on Windows

2017-12-08 Thread Konstantin Tokarev


08.12.2017, 22:16, "Kevan Hashemi" :
> Greetings,
>
> I'm new to CMake, so please forgive this basic question.
>
> I'd like to use CMake to build OpenCV on Windows 7 using the C and C++ 
> compilers that come with my
> installation of MinGW. I compile all my other code with GCC compilers, from 
> the command line of the
> MSYS Bash shell, so I figure I can be certain to link OpenCV to my existing 
> code if I compile with
> GCC compilers.
>
> I installed the Windows GUI of CMake and I told it to use the MinGW C and C++ 
> compilers. I point
> CMake at my OpenCV directory and a build directory. When I press configure, I 
> get this error:
>
> Selecting Windows SDK version to target Windows 6.1.7601.
> CMake Error at CMakeLists.txt:64 (project):
> Failed to run MSBuild command:
> MSBuild.exe to get the value of VCTargetsPath:
> The system cannot find the file specified
> Configuring incomplete, errors occurred!
> See also "F:/OpenCV/build/CMakeFiles/CMakeOutput.log".
>
> If my understanding of CMake is correct, this error cannot not come directly 
> from CMake, but rather
> is caused by OpenCV asking for MSBuild. But I can find no instance of the 
> styring "MSBuild" in the
> OpenCV diretory tree. So my understanding must be wrong.
>
> Why is CMake looking for MSBuild? Can I build on Windows using compilers of 
> my choice?

Of course, but you should choose a suitable generator, e.g. -G "MinGW Makefiles"

>
> Yours, Kevan
>
> --
> Kevan Hashemi, Electrical Engineer
> Physics Department, Brandeis University
> http://alignment.hep.brandeis.edu/
> --
>
> 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] Automoc for a part of target sources

2017-11-24 Thread Konstantin Tokarev


12.04.2016, 22:32, "Konstantin Tokarev" <annu...@yandex.ru>:
> Hi all,
>
> Is it somehow possible to apply automoc-like processing to the list of files, 
> not whole target?
>
> My use case: in QtWebKit most of sources composing core targets are not 
> related to Qt at all, but there are specific sources specific to Qt port. 
> Currently I'm using automoc, but I suspect that it should be possible to 
> improve incremental build times by reducing number of automoc'ed files.

Answering myself: yes, this is possible by setting SKIP_AUTOMOC property on 
files.

This property appears in documentation since CMake 3.8, but in fact it is 
available since automoc was added to 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] Using find_package() portably?

2017-11-22 Thread Konstantin Tokarev


22.11.2017, 13:37, "Carsten Fuchs" :
> Hi all,
>
> thanks to you all for your replies!
>
> Concluding from your replies, it seems that the following approach for
> each external dependency implements a good(?) solution:
>
> find_package(JPEG) # without "REQUIRED"
>
> if (NOT JPEG_FOUND)
>  # Optionally, under Linux only:
>  # Stop with custom error message that explains how to install libjpeg.
>  # Or ask if alternatively the shipped library should be used.
>  # This complements the installation instructions in the user docs.
>  ... # TODO!
>
>  # Proceed with the shipped copy of libjpeg:
>  # Always under Windows

Note that there are package systems on Windows too, e.g. VCPKG or MSYS2.

Also there are a few packages which can be found by CMake by using registry
keys provided by their installers (not the case for libjpeg)


> and possibly under Linux as outlined above.
>  # Always in source code form, compiling here; not pre-made binaries.
>  # (This approach is my personal preference over the other options
>  # that have been suggested.)
>  add_subdirectory(../ExtLibs/libjpeg ../ExtLibs/libjpeg)
>
>  ... # see below
> endif()
>
> # How does this work in case `NOT JPEG_FOUND` above?
> target_link_libraries(main_program ${JPEG_LIBRARIES})
>
> That is, follow-up question: near the "..." above, we have got a target
> "libjpeg", but how do I get the variables JPEG_INCLUDES, JPEG_LIBRARIES
> etc. that `find_package(JPEG)` normally provides so that the last line
> with the `target_link_libraries()` works?
> I guess that defining them in `../ExtLibs/libjpeg/CMakeLists.txt` is wrong.
>
> It seems to me that the 2017 talks by Mathieu Roperts and Daniel Pfeifer
> (starting at slide 53, see especially slide 64 at
> https://www.slideshare.net/DanielPfeifer1/effective-cmake) suggest that
> this is how the modern, modular CMake is supposed to work?
>
> Best regards,
> Carsten
> --
>
> 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] Using find_package() portably?

2017-11-21 Thread Konstantin Tokarev

> Using ExternalProject and a dependency fetching script suffer from the
> same problem. It is very easy to implement these things insecurely,
> and it makes your software hard to package for Linux distributions.
> When I see a trendy new project that prominently features a "curl |
> sh" line on its webpage I shudder and, try as I might, I usually write
> it off in my mind. Besides those lines sometimes not having "https://;
> in them,

You should check sha256 of all downloaded files. It really guarantees that
files were not tampered, unlike that "s" letter in the URL after "http" which
only checks that peer's TLS certificate looks okay.


> installing software outside of your package manager will
> eventually lead to a slew of problems (developers that focus on one or
> two projects may never experience those problems, but that is almost
> entirely luck).

This is not the case if done carefully, and is not relevant at all if 
dependencies
are not installed into system location

-- 
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] debugging CMAKE_PREFIX_PATH

2017-09-12 Thread Konstantin Tokarev


12.09.2017, 16:31, "Zakrzewski, Jakub" :
> Hi,
>
>>  find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED)
>
>>  I build with -DCMAKE_PREFIX_PATH set, and in CMakeCache.txt, I see:
>
>>  //No help, variable specified on the command line.
>>  CMAKE_PREFIX_PATH:PATH=/usr/pkg/qt5
>
>>  //The directory containing a CMake configuration file for Qt5Core.
>>  Qt5Core_DIR:PATH=Qt5Core_DIR-NOTFOUND
>
>>  # ls /usr/pkg/qt5/lib/cmake/Qt5Core/Qt5CoreConfig.cmake
>>  /usr/pkg/qt5/lib/cmake/Qt5Core/Qt5CoreConfig.cmake
>
>>  so AFAICT, Qt5CoreConfig.cmake should be found.
>
>>  What am I missing?
>
> according to the documentation: 
> https://cmake.org/cmake/help/v3.0/command/find_package.html
> you're using the find_package() in MODULE mode, so it tries to locate a 
> FindQt5Core.cmake.
>
> Use this:
> find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED CONFIG)
>
> and it should do what you want.

This statement is wrong, when no MODULE or CONFIG are specified, CMake tries 
both, so find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED) is a correct way.

What actually happens here: rogue CMake project overwrites user-supplied 
CMAKE_PREFIX_PATH with its own value, so it is disregarded.

As a workaround (without changing project), you can pass 
-DQt5Core_DIR=/usr/pkg/qt5/lib/cmake/Qt5Core

>
> --
> Grüsse,
> Jakub
> --
>
> 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] [Windows] clang-cl.exe detected as MSVC?

2017-09-12 Thread Konstantin Tokarev


11.09.2017, 18:12, "Mateusz Loskot" <mate...@loskot.net>:
> On 11 September 2017 at 17:04, Konstantin Tokarev <annu...@yandex.ru> wrote:
>>  11.09.2017, 17:59, "Mateusz Loskot" <mate...@loskot.net>:
>>>  Hi,
>>>
>>>  I'm building a project with CMake 3.9 using clang-cl.exe driver [1]
>>>  from LLVM/clang 4.0 enabled with Visual Studio 2015 environment.
>>>
>>>  CMake detects the compiler as Clang 4.0.0:
>>>
>>>  -- The C compiler identification is Clang 4.0.0
>>>  -- The CXX compiler identification is Clang 4.0.0
>>>  -- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe
>>>  -- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe -- 
>>> works
>>>
>>>  and my project builds fine.
>>>
>>>  In my CMakeLists.txt, there is this flags update:
>>>
>>>  if(MSVC)
>>>    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
>>>  endif()
>>>
>>>  and in build log I see:
>>>
>>>  clang-cl.exe: warning: argument unused during compilation: '/MP'
>>>
>>>  I have double-checked and MSVC is defined and set True for clang-cl.exe.
>>>
>>>  Is this correct?
>>
>>  Yes. clang-cl is mostly compatible with MSVC on the command line
>
> Mostly, or less or more, it's subjective and my experience show it is not
> as compatible as one may expect.
> Also, AFAIU, compatibility is only at driver level that is command
> line interface.
>
>>  so it's natural that MSVC code in existing projects is applied to clang-cl 
>> too.
>
> I'd rather expect CL.exe exclusively considered as CL.exe

For fine-grained distinction you have CMAKE_CXX_COMPILER_ID

>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net

-- 
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] [Windows] clang-cl.exe detected as MSVC?

2017-09-11 Thread Konstantin Tokarev


11.09.2017, 17:59, "Mateusz Loskot" :
> Hi,
>
> I'm building a project with CMake 3.9 using clang-cl.exe driver [1]
> from LLVM/clang 4.0 enabled with Visual Studio 2015 environment.
>
> CMake detects the compiler as Clang 4.0.0:
>
> -- The C compiler identification is Clang 4.0.0
> -- The CXX compiler identification is Clang 4.0.0
> -- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe
> -- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe -- 
> works
>
> and my project builds fine.
>
> In my CMakeLists.txt, there is this flags update:
>
> if(MSVC)
>   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
> endif()
>
> and in build log I see:
>
> clang-cl.exe: warning: argument unused during compilation: '/MP'
>
> I have double-checked and MSVC is defined and set True for clang-cl.exe.
>
> Is this correct?

Yes. clang-cl is mostly compatible with MSVC on the command line, so it's 
natural
that MSVC code in existing projects is applied to clang-cl too.

> Is clang-cl.exe driver considered to be "when using Microsoft Visual C++" [2]
>
> [1] https://clang.llvm.org/docs/UsersManual.html#clang-cl
> [2] https://cmake.org/cmake/help/v3.9/variable/MSVC.html
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> --
>
> 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] How to maintain compatibility with earlier versions?

2017-09-11 Thread Konstantin Tokarev


11.09.2017, 16:52, "Robert Dailey" :
> So typically my setup is that I have the newest CMake installed, but
> am working with projects that set cmake_minimum_required to something
> like version 2.8. Will version 3.9 of CMake prevent me from using
> features that were introduced after 2.8? How can I make sure that
> someone with *actual* version 2.8 installed will not run into
> errors/issues?

Only by testing with actual 2.8 (or whatever version you support).

> --
>
> 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-gui on windows and qt5 dlls

2017-08-14 Thread Konstantin Tokarev


14.08.2017, 16:01, "Craig Scott" :
> On Mon, Aug 14, 2017 at 9:05 PM, Clément Gregoire  wrote:
>> Wouldn't it be possible to move it to a subfolder with the DLLs and put a 
>> link next to cmake and ccmake? Executables look for DLLs in their directory 
>> and it wouldn't pollute the PATH
>
> Symlinks are available on NTFS filesystems from Vista onwards. If the user 
> installed CMake on, say, a FAT filesystem instead or on an old XP box (CMake 
> appears to still try to support that), then symlinks wouldn't be available 
> from what I can make out. One could potentially use a forwarding script of 
> some kind though to achieve essentially the same thing.

This tool might be useful

https://github.com/chocolatey/shimgen

>
>> I personally like to be able to launch it through the command line, it is 
>> faster than looking for it and then browse for the folder.
>>
>> Le lun. 14 août 2017 à 11:48, Craig Scott  a écrit :
>>> This is a common problem, not just with CMake. I'm wondering if there's any 
>>> real need for cmake-gui to be on the PATH at all, since it will usually be 
>>> invoked by a desktop or menu icon. At the moment though, it is in the same 
>>> directory as the cmake and ccmake executables which have a much stronger 
>>> case for being on the PATH. There's a reasonable argument that cmake-gui 
>>> should be in a different directory, then it wouldn't be an issue if shared 
>>> Qt libs were used rather than static. I'll bring this up on the developer 
>>> mailing list and see what discussions yield.
>>>
>>> On Mon, Aug 14, 2017 at 6:22 PM, Christian Ehrlicher  
>>> wrote:
 Hi,

 I recently upgraded from cmake 3.3 to 3.9 on windows and got some problems 
 during my build because it looks like the pre-compile binaries for windows 
 are now shipping Qt5 - dlls instead static compile libs (since 3.5 afaics).
 The problem is, that I had the path to cmake *before* the path to my own 
 Qt5 libaries. So during the build / run of my application, the wrong 
 libraries were loaded and I got a symbol lookup error.
 Would it be possible to use the static Qt5 libs instead or maybe prefix 
 the Qt5 libs shipped with cmake-gui somehow?

 Thx,
 Christian

 --

 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
>>> https://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
>
> --
> Craig Scott
> Melbourne, Australia
> https://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


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

Re: [CMake] Coverage support

2017-08-07 Thread Konstantin Tokarev
  07.08.2017, 20:50, "Clément Gregoire" <lec...@gmail.com>:This is mainly why I started this thread, I want to know the best way to do this without using those variables.CMAKE_lang_FLAGS is a pain as soon as someone wants to use add_subdirectory (be it to add an external project or your project being used in another) or a user wants to change the value. Those variables should really only be set by the toolchain file or from the command-line.There's ExternalProject for this purpose Other solutions were mentioned in my first mail, the easiest one being to add a new build type.The other option is to uses something like a special script that will set those variables before your Cmakelists.txt (ie a toolchain file).  Le lun. 7 août 2017 à 17:22, Konstantin Tokarev <annu...@yandex.ru> a écrit : 07.08.2017, 17:24, "Clément Gregoire" <lec...@gmail.com>:>> I usually stop reading Cmakelists.txt as soon as I see this>>>> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -pthread -g -O0>> -fprofile-arcs -ftest-coverage")>>>> The pthread thing there is likely wrong anyway, and the -Wall is entirely optional. The other things are needed, otherwise gcov will not produce any useful output.>> I don't have an issue with the flags per se, but with the usage of set(CMAKE_CXX_FLAGS). Setting flags like that should be banned from modern cmake scripts.How can one set global compiler flags without use of CMAKE_CXX_FLAGS or setting flags for each individual target?>>> Also you need to use the SETUP_TARGET_FOR_COVERAGE for every single test>> target, which seems to be a difficult to scale on big projects>>>> No, you don't. It's entirely fine if you just run "make test" as I do in OSM2go.> From what I saw in the documentation of the script :>>> # Param _testrunner The name of the target which runs the tests>> It seems to call directly the command named _testrunner, which is somehow confirmed from the cmakelists :>>> # src/CMakelists.txt>> add_executable(tests ${TEST_FILES})>>>> # Linking up all libraries>>>> target_link_libraries(tests complex)>>>> add_test(NAME example_test COMMAND tests)>> # CMakelists.txt>> setup_target_for_coverage(${PROJECT_NAME}_coverage tests coverage)> From this I deduce that you need to call setup_target_for_coverage for each different test executable.>> 2017-08-07 13:37 GMT+02:00 Rolf Eike Beer <e...@sf-mail.de>:>> Am 2017-08-07 11:06, schrieb Clément Gregoire:>> I usually stop reading Cmakelists.txt as soon as I see this>>>> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -pthread -g -O0>> -fprofile-arcs -ftest-coverage")>>>> The pthread thing there is likely wrong anyway, and the -Wall is entirely optional. The other things are needed, otherwise gcov will not produce any useful output.>>>> Also you need to use the SETUP_TARGET_FOR_COVERAGE for every single test>> target, which seems to be a difficult to scale on big projects>>>> No, you don't. It's entirely fine if you just run "make test" as I do in OSM2go.>>>> Eike>> -->>>> 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-- 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:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Coverage support

2017-08-07 Thread Konstantin Tokarev


07.08.2017, 17:24, "Clément Gregoire" :
>> I usually stop reading Cmakelists.txt as soon as I see this
>>
>> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -pthread -g -O0
>> -fprofile-arcs -ftest-coverage")
>>
>> The pthread thing there is likely wrong anyway, and the -Wall is entirely 
>> optional. The other things are needed, otherwise gcov will not produce any 
>> useful output.
>
> I don't have an issue with the flags per se, but with the usage of 
> set(CMAKE_CXX_FLAGS). Setting flags like that should be banned from modern 
> cmake scripts.

How can one set global compiler flags without use of CMAKE_CXX_FLAGS or setting 
flags for each individual target?

>
>> Also you need to use the SETUP_TARGET_FOR_COVERAGE for every single test
>> target, which seems to be a difficult to scale on big projects
>>
>> No, you don't. It's entirely fine if you just run "make test" as I do in 
>> OSM2go.
> From what I saw in the documentation of the script :
>
>> # Param _testrunner The name of the target which runs the tests
>
> It seems to call directly the command named _testrunner, which is somehow 
> confirmed from the cmakelists :
>
>> # src/CMakelists.txt
>> add_executable(tests ${TEST_FILES})
>>
>> # Linking up all libraries
>>
>> target_link_libraries(tests complex)
>>
>> add_test(NAME example_test COMMAND tests)
>> # CMakelists.txt
>> setup_target_for_coverage(${PROJECT_NAME}_coverage tests coverage)
> From this I deduce that you need to call setup_target_for_coverage for each 
> different test executable.
>
> 2017-08-07 13:37 GMT+02:00 Rolf Eike Beer :
>> Am 2017-08-07 11:06, schrieb Clément Gregoire:
>> I usually stop reading Cmakelists.txt as soon as I see this
>>
>> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -pthread -g -O0
>> -fprofile-arcs -ftest-coverage")
>>
>> The pthread thing there is likely wrong anyway, and the -Wall is entirely 
>> optional. The other things are needed, otherwise gcov will not produce any 
>> useful output.
>>
>> Also you need to use the SETUP_TARGET_FOR_COVERAGE for every single test
>> target, which seems to be a difficult to scale on big projects
>>
>> No, you don't. It's entirely fine if you just run "make test" as I do in 
>> OSM2go.
>>
>> Eike
>> --
>>
>> 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


-- 
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] CPack Multicore Usage

2017-07-20 Thread Konstantin Tokarev


20.07.2017, 11:22, "Jörg Kreuzberger" :
> Hi
>
> My Project is compiling multicore without any problems using Unix makefiles 
> or ninja.
>
> In calls to cpack only one core is used if Makefiles are used. Is there any 
> option to enable multicore?

Yes, you should run make -jN, where N is a number of your cores or slightly 
larger

> If i use ninja in cpack builds, the cpack build is broken, cause there seems 
> no dependencies considered?
>
> Is ninja use in cpack intended? Or are there any contraints using ninja and 
> cpack?
>
> Greetz, Joerg
>
> --
>
> 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] Parallel moc for Qt files

2017-07-07 Thread Konstantin Tokarev


06.07.2017, 23:00, "Michael Jackson" :
> I have a large list of files that need to have Qt's 'moc' run on them
> (107 headers). I use all the normal CMake facilities for Qt based
> projects. I noticed that the generation of the moc files are done
> serially. Is there a flag or anything that I can use to run the
> generation in Parallel? I ask because each file takes about 3 seconds to
> run through moc. The code is heavily C++ templated which I think causes
> 'moc' to run more slowly. We have other places in the code where 'moc'
> must run and it does each file in the "blink of an eye".

Replace use of AUTOMOC with macros like qt5_generate_moc. Each moc file
will be generated by a separate custom command.

For example, I wrote 3 macros that wrap qt5_generate_moc for more
convenience [1], example usage is at [2].

[1] 
https://github.com/annulen/webkit/blob/qtwebkit-stable/Source/cmake/OptionsQt.cmake#L63
[2] 
https://github.com/annulen/webkit/blob/qtwebkit-stable/Source/WebCore/PlatformQt.cmake#L165

>
> Just curious.
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@bluequartz.net
> --
>
> 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] Is there analog of source command from bash ?

2017-05-28 Thread Konstantin Tokarev


28.05.2017, 16:58, "Denis Kotov" :
> Hi everyone,
>
> I have tried to find solution to the following problem:
> There is the project with environment variable described in setenv.sh file
> Old build process looks like:
> source setenv.sh
> make release
>
> But I want to accomplish this by CMake. But I have realized that CMake does 
> not have analog of source command that's why the following command does not 
> work:
> execute_process(COMMAND bash -c "source ../setenv")

You can run  source setenv.sh before you run cmake, or in the same shell 
invocation with command that requires environment

>
> Because CMake creates a child process.
> How can I import variables that was set in some sh file ?
>
> Thanks,
> Best Regards
> Denis Kotov
> ,--
>
> 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] How to detect MSVC 2015 update 3 (= presence of /fpermissive-)

2017-05-15 Thread Konstantin Tokarev


15.05.2017, 15:57, "René J.V. Bertin" :
> Hello,
>
> A question that will hopefully have a quick/easy answer:
>
> I'd like to detect when the MSVC /fpermissive- (yes, that's a dash at the 
> end) can be used instead of /Za . I know that a later update bumped the 
> version to 14.0.25422.01 and thus undoubtedly _MSC_FULL_VER== 1402542201 in C 
> code so I could assume everyone keeps installs their updates and use that 
> value.

Have you tried CHECK_CXX_COMPILER_FLAG?

>
> But what does this translate to in CMake code (MSVC_VERSION)? Probably not 
> just 1903 I presume?
>
> Thanks,
> René
> --
>
> 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] Release flags on one target in debug build type

2017-05-05 Thread Konstantin Tokarev


05.05.2017, 23:22, "Michael Ellery" <mellery...@gmail.com>:
>>  On May 5, 2017, at 11:45 AM, Konstantin Tokarev <annu...@yandex.ru> wrote:
>>
>>  Hello,
>>
>>  Is there any clear way to build specific target in "Debug" mode with flags 
>> that it would have in "Release"?
>>
>>  In particular, build this specific target without effect of 
>> CMAKE_CXX_FLAGS_DEBUG and CMAKE_C_FLAGS_DEBUG, while preserving flags added 
>> by target_compile_options
>>
>>  --
>>  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
>
> Does RelWithDebInfo do what you want? I have in the past taken one of the 
> “alternative targets” (RelWithDebInfo or MinSIzeRel) and adjusted the flags 
> for that target until it suited my specific needs, but I don’t necessarily 
> claim that is the right way to go in all cases. Also be aware that the 
> default optimization level can differ slightly with each of these build 
> types. In the end, it’s probably best to survey the current settings for each 
> build type and see if one is close to what you want.

I need to modify build of one target, not to change global build type of the 
project 

>
> -Mike

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

[CMake] Release flags on one target in debug build type

2017-05-05 Thread Konstantin Tokarev
Hello,

Is there any clear way to build specific target in "Debug" mode with flags that 
it would have in "Release"?

In particular, build this specific target without effect of 
CMAKE_CXX_FLAGS_DEBUG and CMAKE_C_FLAGS_DEBUG, while preserving flags added by 
target_compile_options

-- 
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] Qt Project Generator for Cmake

2017-05-03 Thread Konstantin Tokarev
  03.05.2017, 11:06, "K O ranjith" :I'm using CMake for Qt creator project(in Non-Qt c++ project).In Qt kit->CMake generator I couldn't find a way to generate a Qt project (o CMakeLists.txt which can open as non-Qt project in Qt creator)(But have generator option to other IDE types like to Generate Visual studio  project)Have any CMake Generator which create Qt project file(or CMakeLists.txt file)'? If you are using cmake already, it makes no sense to generate CMakeLists.txt file, since you already have one.Just build your project as usual, open CMakeLists.txt in Qt Creator, and point build directory in project settings to your build directory path. ,-- Powered by www.kitware.comPlease keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQKitware offers various services to support the CMake community. For more information on each offering, please visit:CMake Support: http://cmake.org/cmake/help/support.htmlCMake Consulting: http://cmake.org/cmake/help/consulting.htmlCMake Training Courses: http://cmake.org/cmake/help/training.htmlVisit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.htmlFollow 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

[CMake] _debug postfix in macOS frameworks

2017-04-09 Thread Konstantin Tokarev
Hello,

I'd like to put debug and release version of framework into the same bungle by 
adding "_debug" postfix to debug binaries. However it seems like 
CMAKE_DEBUG_POSTFIX is ignored b frameworks. What is the best way to achieve 
this?

Is there any alternative cmake module for making frameworks/bundles that allows 
more flexibility?

-- 
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] Building third party libraries along with normal targets

2017-03-30 Thread Konstantin Tokarev


30.03.2017, 18:15, "Miller Henry" :
> I have found the following projects which all seem to do some variation of a 
> meta build so that you can build multiple projects that depend on each other 
> and manage dependencies. (there are a couple others that seem to not be 
> maintained as well)
>
> https://gradle.org/
> https://bazel.build/
> https://github.com/LLNL/spack
> https://github.com/ruslo/hunter
> http://www.biicode.com
> https://conan.io/
> https://conda.io/

Also, https://github.com/GNOME/jhbuild (notably used by GNOME, WebKit, and 
X.org communities)

>
> Unfortunately I have never found anyone who has actually compared even two of 
> these. None of the projects have good marketing: it appears they somehow 
> solve similar problems, but none actually have defined the problem or their 
> solution. It is like everyone assumes that everyone in the world has their 
> exact same problem and the solution is obvious so the only thing left is the 
> details of implementing it. This of course tells me nothing about if they 
> handle cross compiling (not a common use case but it is yours and mine), what 
> packages they create, what compromises they make, what they expect of my 
> environment... These are important questions: I'm pretty sure that I could 
> eliminate several just by comparing my needs to their features.
>
> I'm currently using an in house system that builds everything in a Docker 
> which lets me ensure nobody is accidentally using the wrong compiler. (we 
> cross compile for a x86 target - 90% of the time if you build with gcc for 
> the local system everything will work just fine, the other 10% of the time 
> our system has an imcompatible version of some library and things blow up 
> when you try to use some uncommon feature). I'm thinking about moving to one 
> of the above, but I haven't actually evaluated anything.
>
> If you do evaluate any of the above please document your experience and in 
> particular what is good/bad about the things you look at.
>
> This is getting off-topic for the cmake mailing list, but I don't know where 
> else to move the conversation.
>
> -Original Message-
> From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Robert Dailey
> Sent: Wednesday, March 29, 2017 9:39 PM
> To: Florent Castelli 
> Cc: CMake 
> Subject: Re: [CMake] Building third party libraries along with normal targets
>
> On Wed, Mar 29, 2017 at 9:32 PM, Florent Castelli 
>  wrote:
>>  On 30/03/2017 03:54, Robert Dailey wrote:
>>>  On Wed, Mar 29, 2017 at 8:18 PM, Florent Castelli
>>>   wrote:
  This is known as "super build".
  Yes, this is exactly why I made my Boost CMake build scripts, which
  you use unless you changed your mind today :)
>>>
>>>  You mean this?
>>>  https://github.com/Orphis/boost-cmake
>>>
>>>  It's on the drawing board, for sure. It's the best solution I've
>>>  found. It's also part of the reason I'm asking this question to begin
>>>  with.
>>>
>>>  Although, this specific method of building boost doesn't use
>>>  superbuild, it uses normal add_subdirectory() with target.
>>
>>  It doesn't "super build" its dependencies, you have to provide them
>>  externally, but it is a possible addition.
>>  But it is designed to be part of a super build environment and is used
>>  as such at some large companies shipping to millions of people.
>>
  It can be done for other projects as well. Sometimes, they even
  provide CMake build scripts you can use directly with
  "add_subdirectory()" so you don't have to write CMake scripts or use
  "ExternalProject_Add()" (which isn't all great since it doesn't
  propagate all your current project settings).
>>>
>>>  Long term, I'm thinking a project like hunter[1] would be the best
>>>  choice. The problem with hunter is that it doesn't separate concerns
>>>  between host machine and target host. Specifically, when cross
>>>  compiling.
>>>
>>>  All the superbuild commands assume linux command syntax, simply
>>>  because I specified a toolchain utilizing android NDK. For this
>>>  reason it requires a lot of TLC to get working.
>>>
>>>  [1]: https://github.com/ruslo/hunter
>>
>>  There are those issues and also ABI changing flags that can become an
>>  issue as they aren't always propagated from what I can see.
>>
  You can use ccache or its Windows variants to make it faster. But
  you also shouldn't need "ninja clean" most of the time. Possibly,
  you could just clean a specific target "ninja -t clean foo".
  If you declare all your dependencies properly, then you could just
  always run "ninja" and the build will just be correct.
  If your purpose is to see the compiler output again (to fix
  warnings), it is acceptable to clean and rebuild (with ccache it
  should be fast enough).
  Personally, I just have a very long history 

Re: [CMake] -DCMAKE_BUILD_TYPE=Release breaks build process

2017-03-02 Thread Konstantin Tokarev


02.03.2017, 13:58, " Jan Hegewald" :
> Hi Berni,
>
>>  On 2 Mar 2017, at 10:12, Bernhard Seckinger  
>> wrote:
>
> ...
>>  but when I try to build with
>>  -DCMAKE_BUILD_TYPE=Release the linker complains about missing functions.
>
> ...
>>  Maybe you can give me some ideas on how to proceed?
>
> ...
>
> just a general idea as how to approach this:
> - make a clean cmake directory and try again, or at least remove the 
> CMakeCache.txt
> - if you use the make generator, add -DCMAKE_VERBOSE_MAKEFILE=ON when calling 
> cmake to know what exactly is being used during build

This is not a good advice, better don't touch CMAKE_VERBOSE_MAKEFILE and use 
make VERBOSE=1 whenever you want to see details

>
> HTH,
> Jan Hegewald
>
> --
>
> 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] set_if_not_set

2017-02-15 Thread Konstantin Tokarev


15.02.2017, 20:08, "Bill Newcomb" :
> My top-level CMakeLists.txt files always end up with a lot of
>
> if(NOT_DEFINED foo)
>  set(foo bar)
> endif()
>
> things to allow people to pass interesting things on the command line or
> to write their own "set this and that" CMakeLists.txt and include the
> top-level one.
>
> It would improve readability to have set_if_not_set and friends from
> CTest.cmake available in a separate module or, better still, as language
> primitives, either as-is or like
>
> set(IF_NOT_SET foo bar)
>
> or maybe
>
> set(foo bar IF_NOT_SET)
>
> Obviously I could define set_if_not_set at the top of each top-level
> CMakeLists.txt, but the above would be nicer.
>
> What do you think?

Use options or CACHE variables, default values will be set unless user 
specifies them
explicitly.

>
> Thanks,
> B.
>
> ---
> This email message is for the sole use of the intended recipient(s) and may 
> contain
> confidential information. Any unauthorized review, use, disclosure or 
> distribution
> is prohibited. If you are not the intended recipient, please contact the 
> sender by
> reply email and destroy all copies of the original message.
> ---
> --
>
> 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] Comaptibility with older gcc

2017-01-27 Thread Konstantin Tokarev


27.01.2017, 21:05, "Elizabeth A. Fischer" :
> C++ code is not compatible between different compilers.  

This is not true for compilers implementing Itanium C++ ABI, including GCC.

The only possible source of incompatibility comes from different standard 
library versions. 

>You cannot link C++ code built with GCC 4.9.3 with GCC 4.2.1.  Maybe if you 
>hack around and find the GNU C++ libraries from your GCC 4.9.3 installation... 
>just maybe, with enough hacking, it will work.  But in general, this is a 
>rabbit hole that will offer you very little in the end.
>
> The standard way to build on systems that don't have the compilers you need 
> is... to get the compilers you need.  My point was that getting these 
> compilers is actually not very hard.  In the end, that will almost certainly 
> be the easiest solution to your problem.
>
> On Fri, Jan 27, 2017 at 12:58 PM, Hendrik Sattler  
> wrote:
>> Your answer is totally unrelated to the question.
>>
>> Am 27. Januar 2017 18:23:39 MEZ schrieb "Elizabeth A. Fischer" 
>> :
>>>Get spack, then use it to build GCC 4.9.3  takes a couple hours of wall
>>>time, five minutes of your time.
>>>
>>>Github.com/llnl/spack
>>>On Jan 27, 2017 12:04 PM, "Michele Portolan" <
>>>michele.porto...@grenoble-inp.fr> wrote:
>>>
 I have a project that build correctly using gcc 4.9.3, generating a
 dynamic library that I can later link to obtain my executables. So,
>>>nothing
 special.

 My problem is that on one of my target systems, I only have a gcc
>>>4.1.2
 and I am forced to use it for at least  linking the last executable.
>>>My
 project uses extensively C++14,so I cannot build it with the older
>>>gcc.

 Is there a way to have Cmake generate a library that is compatible
>>>with
 gcc 4.1.2?

 Regards,


 Michele
 --

 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/opensou
 rce/opensource.html

 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/mailman/listinfo/cmake

>>
>> --
>> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
> ,--
>
> 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] Comaptibility with older gcc

2017-01-27 Thread Konstantin Tokarev


27.01.2017, 20:04, "Michele Portolan" :
> I have a project that build correctly using gcc 4.9.3, generating a
> dynamic library that I can later link to obtain my executables. So,
> nothing special.
>
> My problem is that on one of my target systems, I only have a gcc 4.1.2
> and I am forced to use it for at least linking the last executable. 

Do you have to use libstdc++ from gcc 4.1.2? If no, using gcc for linking does 
not differ much from using ld directly, and does not create any issues, 
provided that you compile your other code with gcc 4.9 and you don't link any 
other libraries depending on gcc 4.1 libraries

>My project uses extensively C++14,so I cannot build it with the older gcc.
>
> Is there a way to have Cmake generate a library that is compatible with
> gcc 4.1.2?

>
> Regards,
>
> Michele
> --
>
> 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] Comaptibility with older gcc

2017-01-27 Thread Konstantin Tokarev


27.01.2017, 20:04, "Michele Portolan" :
> I have a project that build correctly using gcc 4.9.3, generating a
> dynamic library that I can later link to obtain my executables. So,
> nothing special.
>
> My problem is that on one of my target systems, I only have a gcc 4.1.2
> and I am forced to use it for at least linking the last executable. My
> project uses extensively C++14,so I cannot build it with the older gcc.
>
> Is there a way to have Cmake generate a library that is compatible with
> gcc 4.1.2?

Your issue has nothing to do with cmake, but with used compilers / runtimes.

Your library will be possibly compatible with gcc 4.1 if it is not linked to 
libstdc++. To achieve this you have to elemeinate all std:: usages or only 
carefully chosen subset which does npot require linking. You also should not 
use any std:: types in public API of your library.

>
> Regards,
>
> Michele
> --
>
> 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


[CMake] Get path without Windows drive letter

2016-12-01 Thread Konstantin Tokarev
Hello,

On Windows, is there any better way to strip out drive letter from path besides 
using REGEX REPLACE? I looked at get_filename_component but didn't find 
anything appropriate.

What I'm doing at higher level is transposition of CMAKE_INSTALL_PREFIX with 
DESTDIR variable, like what install(FILES) is doing. I cannot use built-in 
DESTDIR support because I need to pass modified path to external program. Is 
there any better way to achieve that?

Thanks!

-- 
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] Executing python though CMake and linking libraries

2016-11-28 Thread Konstantin Tokarev


28.11.2016, 21:53, "Matthew Woehlke" :
> On 2016-11-25 04:04, Kit Chambers wrote:
>>  I have a Cmake custom target which runs a python script:
>>
>>  add_custom_target(run
>>   COMMAND python myscript.py
>>    )
>>
>>  ...
>>
>>  To me it looks like my LD_LIBRARY_PATH and DYLD_LIBRARY_PATH are not being 
>> passed through CMake to Python so it cannot find all the necessary sub 
>> libraries. However, i cannot work out how to pass this information through.
>
> As written, your custom target will be run with whatever environment
> your build tool decides to use. *Probably* that will be the environment
> when you actually run the build tool (make, ninja, etc.), but it's
> possible some build too might monkey with the environment in which it
> runs build commands. Also, requiring people building your software to
> modify their local environment is probably not ideal.
>
> You probably want to wrap your custom target's command with
> `${CMAKE_COMMAND} -E env ...` to ensure it gets the necessary
> environment. (Also, you should probably use `${PYTHON_EXECUTABLE}`
> instead of `python`, and, similarly, note `${CMAKE_COMMAND}` instead of
> `cmake`.)
>
> (Personally, I wouldn't mind seeing CMake learn an `ENVIRONMENT` option
> to add_custom_command / add_custom_target that would set up this
> wrapping automatically.)

+1

>
> --
> Matthew
>
> --
>
> 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] Relinking with Ninja broken in 3.7.0

2016-11-16 Thread Konstantin Tokarev


16.11.2016, 19:44, "Mika Fischer" :
> Hi,
>
> I get the following error even though I'm on Linux and thus an ELF-based 
> platform. This breaks all our builds...
>
> `The install of the  target requires changing an RPATH from
> the build tree, but this is not supported with the Ninja generator unless
> on an ELF-based platform.  The CMAKE_BUILD_WITH_INSTALL_RPATH variable may
> be set to avoid this relinking step.`
>
> Looking at cmGeneratorTarget.cxx#L1214, I see that there's no switch for 
> ELF-based platforms, it just unconditionally throws a fatal error when 
> relinking is required and ninja is being used...
>
> Is the error message misleading and this should actually work on Linux?
> Or is this not supposed to be working, and we should no longer use ninja? If 
> so, why?
>
> CMAKE_BUILD_WITH_INSTALL_RPATH is not a viable alternative for us...

I just fix up cmake_install.cmake with sed to replace CMakeRelink.dir with real 
library location

>
> Best,
>  Mika
> ,--
>
> 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] Pointing CMAKE_AUTOMOC to a custom version of Qt and its moc.exe

2016-11-07 Thread Konstantin Tokarev


07.11.2016, 18:49, "Saad Khattak" :
> I am working on a plugin for Maya and it uses a customized version of Qt. 
> Maya's SDK comes with everything to build Qt (headers, libraries and 
> customized Qt tools such as moc.exe).
>
> I have the following issues:
>
> (1) With CMAKE_AUTOMOC set to ON, I am unable to figure out how to point 
> CMake to pick Maya's version of moc.exe (and other Qt utils). The result is 
> that I get linking errors since the moc did not run - which I expected.

You should be able to use custom Qt installation by setting CMAKE_PREFIX_PATH 
to your Qt prefix

>
> (2) Maya uses a modified version of Qt 5.6.1. There is currently no way to 
> get that version from Autodesk. So I downloaded the official Qt 5.6.1 
> distribution. CMAKE_AUTOMOC now sets up my project correctly to be MOC'ed. 
> However, it is using the official Qt moc utilities and NOT Maya's customized 
> moc. The headers and libraries being used were still from Maya's custom Qt.
>
> The reason (2) worked is because I put "find_package(Qt5Widgets REQUIRED)" 
> after installing the official version of Qt 5.6.1. However, I did NOT use the 
> official Qt headers or libraries - instead, I used Maya's custom version of 
> Qt 5.6.1.
>
> Using solution (2) I successfully compile and link my Qt enabled Maya plugin 
> and load it in Maya. Things go smoothly until I either (a) unload the plugin 
> or (b) delete any widget. I looked at the simplest code that is causing a 
> heap corruption debug assertion:
>
> m_button = new QPushButton("MyButton"); // where m_button is a 
> QPointer
> delete m_button; // causes heap corruption debug assertion to fire
>
> A few other people have gone through similar issues but since they didn't use 
> CMake, they simply ran Maya's moc utilities in a build step. I would like a 
> solution where I can get CMAKE_AUTOMOC to run the custom Qt version.
>
> Thanks.
>
> ,--
>
> 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] Proper way to support 64bit and 32bit builds

2016-10-29 Thread Konstantin Tokarev


29.10.2016, 16:46, "cen" :
> I tried setting CXXFLAGS and CMAKE_CXX_FLAGS to -m32 before the
> project() call but nothing changed. I could make it fail with
> "CXXFLAGS=-m32 cmake -G ..." from command line but this seems wrong. A
> minimal CMakeLists.txt example would be nice.

Use toolchain file

>
> Hendrik Sattler je 29. 10. 2016 ob 15:25 napisal:
>>  You need to set these compiler flags BEFORE the project() call to let CMake 
>> detect all stuff properly. There is a CMake variable telling you the size of 
>> a void*.
>>
>>  Am 29. Oktober 2016 12:22:07 MESZ, schrieb cen :
>>>  Hi
>>>
>>>  Once I switch to 32bit builds, CMake fails to recognise that
>>>  glibc-devel.i686 is not installed resulting in an error when running
>>>  make.
>>>  In the same way, my own FindGMP fails to recognize that gmp-devel.i686
>>>  is not installed. I need CMake to fail if these things are missing.
>>>  At least for the compiler part, I'm pretty sure I am missing some var
>>>  or
>>>  flag to tell CMake I expect a 32 bit build.
>>>
>>>  This is what I use to switch between builds in CMakeLists.txt (ARCH var
>>>
>>>  is irrelevant here, I use it later on for CPack):
>>>
>>>  if (BUILD_32)
>>>  set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
>>>  "-m32" LINK_FLAGS "-m32")
>>>   MESSAGE(STATUS "Excluding 64bit library paths from search.")
>>>   set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
>>>   set(ARCH i686)
>>>  elseif (BUILD_64)
>>>  set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
>>>  "-m64" LINK_FLAGS "-m64")
>>>   set(ARCH amd64)
>>>  else()
>>>   set(ARCH amd64)
>>>  endif()
>>>
>>>  For the FindGMP module, I am not really sure what the best practice
>>>  is.Does the BUILD_32 and BUILD_64 flag propagate into the FindGMP? Do I
>>>
>>>  explicitly specify paths for 32bit libs (eg: /usr/lib64) or can cmake
>>>  be smarter than this?
>
> --
>
> 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] Proper way to find system copy of libxml2 on macOS

2016-10-12 Thread Konstantin Tokarev


12.10.2016, 19:04, "rle...@codelibre.net" <rle...@codelibre.net>:
> On 2016-10-12 15:28, Konstantin Tokarev wrote:
>>  Hello,
>>
>>  In my cmake project I need to use system version of libxml2 on macOS
>>  (/usr/lib/libxml2.dylib), however in case it is installed in MacPorts
>>  the latter version is picked by find_package. On the other hand I'd
>>  like to avoid hardcoding absolute path, just in case Apple changes
>>  some path or file name in future OS version.
>>
>>  I've tried
>>
>>  find_package(LibXml2 2.8.0 REQUIRED PATHS "/usr" NO_DEFAULT_PATH)
>>
>>  however it fails to find anything at all. Any ideas?
>
> Use
>
>    find_package(LibXml2 2.8.0 REQUIRED)
>
> and then use CMAKE_PREFIX_PATH to define the search locations (in your
> environment or on the command-line; not in the script).

That would be great if CMake didn't add Fink and MacPorts paths to
CMAKE_SYSTEM_PREFIX_PATH out of the box unconditionally.

> If you
> hardcode paths in the script, you make it break on other systems.
> That might not be a consideration in this case, but the less
> assumptions you make, the more flexible it will be.

Of course, this hack would be guarded with if (APPLE), and other systems
would continue using normal find_package call.

>
> Regards,
> Roger

-- 
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] Proper way to find system copy of libxml2 on macOS

2016-10-12 Thread Konstantin Tokarev


12.10.2016, 18:48, "Eric Noulard" <eric.noul...@gmail.com>:
> 2016-10-12 17:28 GMT+02:00 Konstantin Tokarev <annu...@yandex.ru>:
>> Hello,
>>
>> In my cmake project I need to use system version of libxml2 on macOS 
>> (/usr/lib/libxml2.dylib), however in case it is installed in MacPorts the 
>> latter version is picked by find_package. On the other hand I'd like to 
>> avoid hardcoding absolute path, just in case Apple changes some path or file 
>> name in future OS version.
>>
>> I've tried
>>
>> find_package(LibXml2 2.8.0 REQUIRED PATHS "/usr" NO_DEFAULT_PATH)
>>
>> however it fails to find anything at all. Any ideas?
>
> My guess is that your find_package call end up in "Module mode"  because 
> there is a FindLibXml2.cmake module bundled with cmake does not honor all 
> options of the find_package when in this mode.
>
> So I bet FindLibXml2.cmake does not handle the given
> "PATHS "/usr" NO_DEFAULT_PATH" part.
>
> Which are handled by find_package when running in "Config mode".
>
> I suggest you to try patch and update the FindLibXml2.cmake module.

Could anyone point me to module example that handles NO_DEFAULT_PATH correctly?

> Or simply craft your own
>
> find_library(...) call.if you only need the libxml2.

That's not an elegant solution as I need to find include dir as well, and also 
do the same for libxslt which is in the same boat.

> Eric
>
>> --
>> 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
>
> --
> Eric


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

[CMake] Proper way to find system copy of libxml2 on macOS

2016-10-12 Thread Konstantin Tokarev
Hello,

In my cmake project I need to use system version of libxml2 on macOS 
(/usr/lib/libxml2.dylib), however in case it is installed in MacPorts the 
latter version is picked by find_package. On the other hand I'd like to avoid 
hardcoding absolute path, just in case Apple changes some path or file name in 
future OS version.

I've tried 

find_package(LibXml2 2.8.0 REQUIRED PATHS "/usr" NO_DEFAULT_PATH)

however it fails to find anything at all. Any ideas?

-- 
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] Error: no cmake_fortran_compiler could be found.

2016-09-02 Thread Konstantin Tokarev


01.09.2016, 23:22, "ning...@ghiocel-tech.com" :
> Dear There,
>
> This is first time to use CMAKE. I got the error that says "no 
> cmake_fortran_compiler could be found."
> I use it on Windows 8.1, which have installed Visual Studio Community 2015, 
> Intel FORTRAN Composer XE 2013, and CUDA 7.0.
>
>     The Fortran compiler identification is unknown
>     CMake Error at CMakeLists.txt:9 (project):
>     No CMAKE_Fortran_COMPILER could be found.
>
> When I run CMake GUI to configure it. I guess that CMake may need environment 
> variable to tell the Fortran compiler, but I don't know what this enviroment 
> variable should be.

FC, how else can it be named :)

>
> Please give me a hand to solve it.
>
> Thank you very much.
>
> Ning An
>
> ,--
>
> 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 library installations and pkg-config

2016-09-01 Thread Konstantin Tokarev


01.09.2016, 08:34, "n...@appletonaudio.com" <n...@appletonaudio.com>:
> On 2016-08-31 23:32, Konstantin Tokarev wrote:
>>  31.08.2016, 16:22, "Nick Appleton" <n...@appletonaudio.com>:
>>>  Hi,
>>>
>>>  I’ve been recently doing a bit of work for an open source project
>>>  trying to extend it’s support for CMake. I’ve been trying to get CMake
>>>  to be able to replicate most of the functionality which can be
>>>  achieved with the existing autoconf-based infrastructure (and have had
>>>  pretty good success) but am struggling to figure out how to get CMake
>>>  to generate pkg-config files on unix-ey systems. I’ve done quite a lot
>>>  of searching, but have not found anything which provides a good
>>>  solution for our use case.
>>
>>  Do you consider contributing to
>>  https://api.kde.org/ecm/module/ECMGeneratePkgConfigFile.html ?
>
> Hi Konstantin,
>
> Thanks for the reply and pointing me at the ECM repository.
>
> I was hoping that this would be something that CMake would be able to do
> without requiring an external package - particularly since CMake
> provides support for finding packages on the system with pkg-config
> files. I think adding documentation to our project which says "if you
> want to install portaudio into the host system in a way compatible with
> autotools-based projects, you will need to get this other repository"
> seems a little bit much to me.

It's a usual practice to copy ECM modules into your project, they mostly don't 
depend on each other. For example, ECMGeneratePkgConfigFile is completely 
stand-alone.

>
> Cheers,
>
> Nick

-- 
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 library installations and pkg-config

2016-08-31 Thread Konstantin Tokarev


31.08.2016, 16:22, "Nick Appleton" :
> Hi,
>
> I’ve been recently doing a bit of work for an open source project trying to 
> extend it’s support for CMake. I’ve been trying to get CMake to be able to 
> replicate most of the functionality which can be achieved with the existing 
> autoconf-based infrastructure (and have had pretty good success) but am 
> struggling to figure out how to get CMake to generate pkg-config files on 
> unix-ey systems. I’ve done quite a lot of searching, but have not found 
> anything which provides a good solution for our use case.

Do you consider contributing to 
https://api.kde.org/ecm/module/ECMGeneratePkgConfigFile.html ?

>
> The project is called portaudio (a cross-platform, C, real-time audio 
> library) and at present there is one CMakeLists.txt file which does 
> everything (I’ve tried to keep it clean), you can see it here: 
> https://app.assembla.com/spaces/portaudio/git/source/cmake_updates/CMakeLists.txt
>
> It looks for various audio libraries which may be present on the system using 
> find_package() and associates them with the library which it defines using 
> target_link_libraries(). This is all great when my CMake project includes 
> portaudio (via add_subdirectory() and target_link_libraries() with one of the 
> portaudio library targets), but if I want “make install”-like functionality 
> so that others can use a portaudio installation without requiring CMake, I 
> would like to be able to generate a pkg-config file which contains the 
> necessary linker arguments to pass when linking against the library. The 
> generation of the pkg-config file is straight-forward using the 
> configure_file() function, but I am struggling to find a way to: given a 
> CMake target, create a variable containing the set of linker paths and 
> library names to use in the pkg-config file.
>
> Can anyone give me some hints as to whether this is possible?
>
> Cheers,
>
> Nick
>
> --
>
> 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] Running CxxTest fails on Fedora 24

2016-08-12 Thread Konstantin Tokarev


12.08.2016, 04:32, "Zan Lynx" :
> The Fedora /usr/bin/cxxtestgen script calls /usr/bin/python3. NOT
> python2 or python.
>
> CMake runs /usr/bin/python /usr/bin/cxxtestgen which is linked to
> python2, and the script fails.
>
> I don't quite understand why CMake feels the need to call it explicitly
> with the Python interpreter that it found instead of using the shebang.
> Maybe Windows? Eh.

I think this is a misfeature of python interpreter. For example, perl 
interprets shebang in such case.

>
> I am fixing it in my script by doing this:
>
>>  FIND_PACKAGE(PythonInterp 3 QUIET)
>>  FIND_PACKAGE(CxxTest)
>
> I thought this might help anyone else hitting this.
>
> --
> Knowledge is Power -- Power Corrupts
> Study Hard -- Be Evil
> --
>
> 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] CMakeRelink.dir fails on make package on Ninja

2016-07-29 Thread Konstantin Tokarev


29.07.2016, 17:36, "Gonzalo" :
> On Linux (Kubuntu 16.04) I am trying to pack my program (no cross
> compiling), and I am running into the following with the Ninja Generator
> and a custom library (that is also built in the project):
>
> [2/2] Run CPack packaging tool...
> CPack: Create package using DEB
> CPack: Install projects
> CPack: - Install project: Project
> CMake Error at
> /media/Linux/code/applications/mrViewer/BUILD/Linux-4.4.0-31-generic-64/Release/tmp/libACESclip/cmake_install.cmake:36
> (file):
>    file INSTALL cannot find
> "/media/Linux/code/applications/mrViewer/BUILD/Linux-4.4.0-31-generic-64/Release/tmp/libACESclip/CMakeFiles/CMakeRelink.dir/libACESclip.so.0.2.6".
> Call Stack (most recent call first):
> /media/Linux/code/applications/mrViewer/BUILD/Linux-4.4.0-31-generic-64/Release/tmp/cmake_install.cmake:37
> (include)
>
> CPack Error: Error when generating package: Project
> FAILED: cd
> /media/Linux/code/applications/mrViewer/BUILD/Linux-4.4.0-31-generic-64/Release/tmp
> && /usr/local/bin/cpack --config ./CPackConfig.cmake
> ninja: build stopped: subcommand failed.
>
> When run with -G 'Unix Makefiles' the packaging works. It is not a
> permissions problem.
>
> I am using the attached "mk" bash script to run the compilation.

I'm getting similar error with Ninja generator on a different project [1].
I'm using cmake 2.8.12.2 as shipped by Ubuntu 14.04.

Problem does not reproduce always, I haven't investigated yet if it is purely
random or reproduces in some particular conditions.

[1] https://github.com/annulen/webkit

>
> --
> Gonzalo Garramuño
> ggarr...@gmail.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+QT always failed for the first build, and succeeded for second build or later.

2016-06-01 Thread Konstantin Tokarev


01.06.2016, 14:09, "Jakob van Bethlehem" :
>> Hey, that was the LTS release until 1 or 2 month ago!
>
> Oops, you're right, my mistake. Somewhere in the back of my head was that the 
> 4-series was in the 4.12.x or so version, not sure where that came from.

KDE 4 I guess (it went up to 4.14)

> I haven't worked with Qt4 ever, but have become extremely experienced with 
> Qt5 from Qt 5.4 onwards. Nevertheless, I should've checked before mentioning 
> it :P.
>
> Sincerely,
> Jakob van Bethlehem
>
> On Wed, Jun 1, 2016 at 10:47 AM, Hendrik Sattler  
> wrote:
>> Am 1. Juni 2016 09:26:18 MESZ, schrieb Jakob van Bethlehem 
>> :
>>>That is what he said, but it seems to be a typo, because the
>>>CMakeLists.txt
>>>file clearly states 'set(QT_DIR
>>>${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/Qt/4.8.6)'
>>
>> Ok, I overlooked that one...
>>
>>>- still a stone-age version of Qt actually :(
>>
>> Hey, that was the LTS release until 1 or 2 month ago!
>> And they made Qt 5.6 an LTS release also to quieten people that complain 
>> about dropping modules without proper replacement (means feature parity) and 
>> dropping compiler support.
>> You will see users of Qt 5.6 for a loong time.
>>
>>>On Wed, Jun 1, 2016 at 9:09 AM, Hendrik Sattler
>>>
>>>wrote:
>>>


 Am 1. Juni 2016 09:02:41 MESZ, schrieb Jakob van Bethlehem <
 jsvanbethle...@gmail.com>:
 >Hej,
 >
 >Some things that come to mind:
 >* You're generating files *inside* the source tree - you're not
 >supposed to
 >do that
 >* Why do you want to have a special Qt_tmp directory? I don't see
>>>the
 >benefit, and without that requirement you can simply use the
 >qt4_wrap_cpp
 >macro explicitly and you still are not forced to use the automoc
 >feature
 >
 >And now for what is probably wrong in your CMakeLists.txt:
 >* It seems you made an important mistake regarding the behaviour of
 >'file(GLOB)'. That function will do the expansion *while running
 >CMake*.
 >But at that time the moc_* files *don't exist!* (as a matter of
>>>fact,
 >the
 >tmp directory doesn't even exist). In other words, your
>>>${Moc_SOURCES}
 >will
 >be empty, and hence they are not compiled, and hence you get
>>>precisely
 >the
 >linker errors you see (because these sources implement the functions
 >that
 >are listed as missing by the linker)
 >
 >If you would use the qt4_wrap_cpp() macro you don't run into this
 >problem,
 >so I'd strongly suggest using it.

 Except that he is using Qt3.

 >Sincerely,
 >Jakob van Bethlehem
 >
 >
 >
 >
 >On Tue, May 31, 2016 at 4:52 PM, irene w 
>>>wrote:
 >
 >> It seems CMakw could not find the generated moc_xxx files.  I
 >modified the
 >> scripts to specify moc_xxx files is generated, but it still has
>>>same
 >errors.
 >>
 >> ADD_CUSTOM_COMMAND ( OUTPUT ${Qt_tmp}/moc_GMWindow.cpp
 >>                      COMMAND ${QT_MOC_CMD} ${GM_DIR}/GMWindow.h -o
 >> ${Qt_tmp}/moc_GMWindow.cpp
 >>                      DEPENDS ${GM_DIR}/GMWindow.h
 >>                    )
 >> ADD_CUSTOM_TARGET(generate_foo DEPENDS ${Qt_tmp}/moc_GMWindow.cpp)
 >> SET_SOURCE_FILES_PROPERTIES(${Qt_tmp}/moc_GMWindow.cpp PROPERTIES
 >> GENERATED 1)
 >> SET_PROPERTY(SOURCE ${GM_DIR}/GMWindow.cpp APPEND PROPERTY
 >OBJECT_DEPENDS
 >> ${Qt_tmp}/moc_GMWindow.cpp)
 >>
 >> .
 >> add_dependencies (GM generate_foo)
 >>
 >>
 >> Does the Macro  "SET_SOURCE_FILES_PROPERTIES" with "GENERATED"
 >> setting work for this purposes?  Any help would be greatly
 >appreciated !
 >>
 >>
 >> On Wed, May 25, 2016 at 12:48 PM, irene w 
 >wrote:
 >>
 >>> Hi,
 >>>
 >>> I am compiling a simple Qt3 application on Linux using CMake. In
>>>my
 >case,
 >>> I need to build moc_xxx files with custom options and output to a
 >specified
 >>> directory, So, I was not using CAMKE_AUTO macros. My cmake
>>>scripts
 >create a
 >>> "Qt_tmp" directory and output moc_xxx there.
 >>>
 >>> It looked it always failed to link the moc_xxx files for the
>>>first
 >time
 >>> build when there is no "Qt_tmp" directory, and succeeded if I ran
 >build
 >>> again if the "Qt_tmp" directory and moc_xxx files created by the
 >failed
 >>> build were kept without removing.  However, it'll fail if I
>>>delete
 >>> the "Qt_tmp" directory.
 >>>
 >>> Even it failed at the first build, the moc_xxx files were
 >>> successfully created in the "Qt_tmp" directory.
 >>>
 >>> Here is my cmake scripts and the errors I got.  Can anyone help
>>>me
 >to
 >>> figure out the issues? Any help would be greatly appreciated.
 >Thanks.
 

Re: [CMake] in source makefile / helper script that enables building out of source?

2016-05-11 Thread Konstantin Tokarev


11.05.2016, 16:58, "Steve Lorimer" :
> I've recently changed over from using boost-build 
> (http://www.boost.org/build/) to cmake.
>
> Boost build builds in-source.
>
> I've become quite used to building and searching etc from the source root
>
>> ~/src $ b2 module
>> ~/src $ git grep foo
>
> This work flow has been broken because I'm not using out of source builds
>
>> ~/src/build $ make module
>> ~/src/build $ git grep... dang it! 
>> ~/src/build $ cd ..
>> ~/src $ git grep foo
>> ~/src $ make modu... dang it! 
>> ~/src $ cd build
>> ~/src/build $ make module
> I can't be the only one who wants to have the benefit of out of source builds 
> and be able to build from in-source.
>
> I imagine it would be relatively simple to create a makefile which navigates 
> to a known build directory (eg: build or debug or...), executes make there, 
> and then changes directory back to where it was called from.
>
> Before I do just this, I thought it better to try leverage the open source 
> community - hence asking the question.
>
> Does anyone have a script or makefile which does just this?

FYI, CMake supports in-source builds (however, particular projects may not)


>
> TIA
> Steve
> ,--
>
> 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


[CMake] Assign large C++ source to separate ninja pool

2016-04-23 Thread Konstantin Tokarev
Hello,

In Ninja documentation on pools feature there is an example of separate 
heavy_object_pool [1]. Is it possible to use this feature with cmake?

Use case is to avoid parallel compilation of N large sources, while compilation 
of 1 large and N-1 small sources is OK.

[1] https://ninja-build.org/manual.html#ref_pool

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

[CMake] Automoc for a part of target sources

2016-04-12 Thread Konstantin Tokarev
Hi all,

Is it somehow possible to apply automoc-like processing to the list of files, 
not whole target?

My use case: in QtWebKit most of sources composing core targets are not related 
to Qt at all, but there are specific sources specific to Qt port. Currently I'm 
using automoc, but I suspect that it should be possible to improve incremental 
build times by reducing number of automoc'ed files.


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