Re: [CMake] CMake removes /DEF: option in CMAKE_SHARED_LINKER_FLAGS

2019-10-04 Thread Cristian Adam
Hi,

You should simply add the my_defs.def file as a source files to
add_library/add_executable.
CMake will automagically pass /DEF: to the linker with my_defs.def

Cheers,
Cristian.

On Fri, Oct 4, 2019 at 4:45 PM Alexander 
wrote:

> Hello,
>
> I would like to add an extra .defs file for linking of a DLL on Windows. I
> want to use the CMake command line option
> -DCMAKE_SHARED_LINKER_FLAGS="/DEF:my_defs.defs". I expect that besides the
> automatically generated
> /bin/.dir/Release/exports.def i see additionally
> /DEF:my_defs.defs in the resulting linking command, but it does not happen.
>
> What is especially irritating that CMake deliberately removes namely /DEF:
> from CMAKE_SHARED_LINKER_FLAGS. Any other word combinations (if I write
> /DEF111:my_defs.def for example) are accepted and I see them the linking
> command.
>
> I tried to reach the same goal using a CMakeLists.txt like this:
>
> set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEF:my_defs.def")
>
> but it did not help - the same way CMake removes my /DEF: option.
>
> Could you please open a ticket to fix this behavior to not cut /DEF:
> option from CMAKE_***_LINKER_FLAGS?
>
> On my opinion CMake should not interpret or modify the content of
> CMAKE_SHARED_LINKER_FLAGS value, but should put it entirely as the user
> specified it. If you have another opinion, please provide any other
> possibility to pass an arbitrary arguments to the linking command "as is"
> so that they are not modified.
>
> Any workaround is highly appreciated (better command-line, because we
> build 3rd party software and it would not really fine to change
> CMakeLists.txt)
>
> --
> Best Regards,
> Alexander Samoilov
> Build & Integration Engineer
> Compart AG, 71034 Böblingen Germany
> --
>
> 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


[CMake] Hunter [CMake/C++] Package Manager: To be or not to be

2019-07-24 Thread Cristian Adam
Hi,

For those of you who use Hunter for package management with CMake,  its
maintainer has issued a call for support to keep it alive or take over its
maintainership: https://github.com/ruslo/hunter/issues/1921


Hunter is different than vcpkg and Conan, it uses only CMake to do the
package management. It also uses more CMake features than the others.

Let's take pcre2 package for example.  Which has bzip2 and zlib as
dependencies. pcre2 package has a peculiarity when it's built as a static
library, it needs the PCRE2_STATIC definition.

   - Conan  pcre2 package.
   - vcpkg  pcre2
   package.
   - Hunter  pcre2 package.

Conan is not using pcre2's CMake build system, instead the package is being
build with the Conan Python infrastructure. I don't know if in the end
you'll have CMake Module or CMake Config packages.

vcpkg is using  pcre2's CMake build system. It controls it from outside,
and afterwards it does some patching to ensure PCRE2_STATIC works as
expected. vcpkg is using CMake Module packages. In the vcpkg portfile the
zlib and bzip2 dependencies are not mentioned. I assume they are somehow
available in the vcpkg build environment prior to building pcre2.

Hunter is using  pcre2's CMake build system, and it does modify the pcre2's
CMakeLists.txt to call the Hunter CMake API. It handles the dependencies,
and then it properly installs / exports a CMake Config package. In the commit
history  you
can see what it takes to import a package in the Hunter repository.

At QTBUG-75578  there is a
description on how to use Hunter to download / build / install the 3rd
party dependencies of Qt6::Base module, in order to build it on Windows
with MinGW. You only need to edit one CMakeLists.txt file.

I would like to point out that Ruslan Baratov contributed the IPO/LTO
functionality that landed in CMake 3.9.

Cheers,
Cristian.
-- 

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] Combining two static libraries into one

2019-07-02 Thread Cristian Adam
On Tue, Jul 2, 2019 at 5:14 PM vinay kumar Kotegowder <
vinay.kotegow...@gmail.com> wrote:

> Hi Everyone,
>
> I have a requirement on combining two static library into one.
> Can anyone tell me how can I achieve this?
>
> Regards,
> Vinay
>
>
If your compiler is GCC or Visual C++, you can use this as a base:
https://cristianadam.eu/20190501/bundling-together-static-libraries-with-cmake/

Cheers,
Cristian.
-- 

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 on MinGW64; which generator

2019-06-23 Thread Cristian Adam
Hi,

You are most probably using MSys2, which means that you are using CMake
from MSys2,
and they patch CMake for their platform. This also means that CMake
upstream doesn't support it.

Here  are the differences between
upstream CMake 3.14.3 and MSys2 CMake 3.14.3. No idea why
the MSys2 people didn't try to upstream this into CMake.

In this case you should get support from MSys2 people, or switch to upstream
CMake  and standalone MinGW-w64

.

Alternatively you can try using the Ninja generator.

The problem with standalone MinGW-w64 is that you will not have the number
of libraries that MSys2 offers.
You can use a CMake package manager like Conan, or Hunter to obtain those
libraries.

I know this because when I tried to compile Qt6::Base with MSys2 I was not
able to compile, due to
various Msys2 problems. With upstream CMake, standalone MinGW-w64 and
Hunter 3rd party libraries
everything worked just fine. At https://bugreports.qt.io/browse/QTBUG-75578
I described how I compiled Qt6::Base.

Cheers,
Cristian.


On Sun, Jun 23, 2019 at 3:49 PM Christopher Webster  wrote:

> Greetings,
>
>   I am trying to figure out which generator to use on MinGW64 on Windows10, 
> the 2-3 I have tried fail.
>
> cmake version is 3.14.5
>
>
> If I try "Unix Makefiles" I get:
>
> $ cmake -S coin -B coin_build -G "Unix Makefiles" 
> -DCMAKE_INSTALL_PREFIX=C:\Tools\Packages\Coin3D
> -- The C compiler identification is GNU 9.1.0
> -- The CXX compiler identification is GNU 9.1.0
> System is unknown to cmake, create:
> Platform/MINGW64_NT-10.0-17763 to use this system, please send your
> config file to cm...@www.cmake.org so it can be added to cmake
>
>
>
> If I try "MinGW Makefiles" I get:
>
> $ cmake -S coin -B coin_build -G "MinGW Makefiles" 
> -DCMAKE_INSTALL_PREFIX=C:\Tools\Packages\Coin3D
> CMake Error: Could not create named generator MinGW Makefiles
>
> Generators
> * Unix Makefiles   = Generates standard UNIX makefiles.
>   Ninja= Generates build.ninja files.
>   CodeBlocks - Ninja   = Generates CodeBlocks project files.
>   CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
>   CodeLite - Ninja = Generates CodeLite project files.
>   CodeLite - Unix Makefiles= Generates CodeLite project files.
>   Sublime Text 2 - Ninja   = Generates Sublime Text 2 project files.
>   Sublime Text 2 - Unix Makefiles
>= Generates Sublime Text 2 project files.
>   Kate - Ninja = Generates Kate project files.
>   Kate - Unix Makefiles= Generates Kate project files.
>   Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
>   Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files
>
>
> Thanks for any guidance.
>
> Chris
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] ExternalProjectAdd and patch on Windows

2019-06-20 Thread Cristian Adam
Hi,

If the users have git installed, you could try find_program(git...), and
then "git apply", which should work to apply patches.

Cheers,
Cristian.

On Thu, Jun 20, 2019 at 1:21 PM Kris Thielemans 
wrote:

> Hi all
>
>
>
> I have a superbuild project where I need to patch a library (HDF5) after
> download. In Windows, there’s no “patch” or “sed” command, and  this has to
> run on other people’s computer. I can almost achieve what I want in
> Powershell like so
>
>
>
> get-content ConfigureChecks.cmake
>
> | %{$_ -replace "H5_HAVE_TIMEZONE 1","H5_HAVE_TIMEZONE 0"} > xx;move-item
> -Force xx ConfigureChecks.cmake
>
>
>
> (all on 1 line).
>
>
>
> Unfortunately, Powershell has now converted the file in some other
> encoding (I guess UTF-8), which doesn’t make sense for the subsequent
> compilation.
>
>
>
> Supposing I could resolved that, I have trouble passing this to
> PATCH_COMMAND. I tried
>
>
>
>   ExternalProject_Add(${proj}
>
>${${proj}_EP_ARGS}
>
> …
>
> PATCH_COMMAND powershell -Command “get-content ConfigureChecks.cmake |
> %{$_ -replace \"H5_HAVE_TIMEZONE 1\",\"H5_HAVE_TIMEZONE 0\"} > xx;
> move-item -Force xx ConfigureChecks.cmake “
>
>…
>
>)
>
>
>
> But the semi-colon doesn’t seem to work
>
>
>
> 2>  Performing patch step for 'HDF5'
>
> 2>  ForEach-Object : Cannot bind parameter 'RemainingScripts'. Cannot
> convert the "move-item" value of type
>
> 2>  "System.String" to type "System.Management.Automation.ScriptBlock".
>
> 2>  At line:1 char:50
>
> 2>  + ... cks.cmake | %{$_ -replace "H5_HAVE_TIMEZONE 1","H5_HAVE_TIMEZONE
> 0"}  ...
>
> 2>  +
> ~
>
> 2>  + CategoryInfo  : InvalidArgument: (:) [ForEach-Object],
> ParameterBindingException
>
> 2>  + FullyQualifiedErrorId :
> CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ForEachObjectCommand
>
>
>
>
>
> Trying to split it up as 2 commands (for instance the first powershell and
> the next cmd, but I could have used powershell as well)
>
>
>
> PATCH_COMMAND
>
>   powershell -Command "get-content ConfigureChecks.cmake | %{$_
> -replace \"H5_HAVE_TIMEZONE 1\",\"H5_HAVE_TIMEZONE 0\"} > xx"
>
>   move /Y xx ConfigureChecks.cmake
>
>
>
> gives almost the same error message (but now with “move” as opposed to
> “move-item”)
>
>
>
> Anyone any suggestions?
>
>
>
> Many thanks
>
> Kris
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Alternative to `add_compile_options` in Toolchain Files

2019-03-27 Thread Cristian Adam
Hi,

If your CMake version is newer than 3.11 you can control what gets into the
CMAKE__FLAGS_INIT flags with the technique from
https://cristianadam.eu/20190223/modifying-the-default-cmake-build-types/

In your case you want to remove from the linker flags init the cxx compiler
options.

Cheers
Cristian.

On Wed, Mar 27, 2019, 03:10 Jayesh Badwaik  wrote:

> Hi,
>
> In https://gitlab.kitware.com/cmake/cmake/issues/19074, it was mentioned
> that
> instead of `add_compile_options`, `CMAKE_CXX_FLAGS_INIT` should be used.
> An
> issue with this is that `CMAKE_CXX_FLAGS_INIT` flags are propogated to the
> linker as well, wherein, the linker warns about `[-Wunused-command-line-
> argument]` if those warnings are enabled.
>
> Is there an alternative to `CMAKE_CXX_FLAGS_INIT` which avoids these
> issues?
>
> Thanks
>
> --
> Best
> Jayesh Badwaik
> https://jayeshbadwaik.github.io
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] CMake Project Generation Speedup

2019-03-21 Thread Cristian Adam
Hi,

CMake has for Visual Studio is a multi configuration generator. (Debug,
Release, RelMinSize, RelWithDbgInformation).

If you specify only one configuration you should cut the generation time to
1/4th.

See
https://cmake.org/cmake/help/latest/variable/CMAKE_CONFIGURATION_TYPES.html#variable:CMAKE_CONFIGURATION_TYPES

Cheers,
Cristian

On Wed, Mar 20, 2019, 21:53 J. Caleb Wherry  wrote:

> Did anything ever come of this?
>
> I am in a similar boat: we have >800 targets on our full build (native
> C++, Managed C++, C#, Java, CUDA, etc) and the majority of the time for the
> configure/generate steps takes place in the generate step (>70%).
>
> I understand there is a lot of IO since the generate step has to write the
> project files and filters for each C++ project (the majority of our
> projects) for VS generators (what we use). I'm just looking to see if there
> is anything to look at or potentially speedup up the generate step besides
> "get a faster drive".
>
> Thanks!
> -Caleb
>
> On Thu, Nov 17, 2016 at 11:15 AM Damian  wrote:
>
>> Hi all,
>>
>> We are still in the process of switching our large Make-based build to
>> CMake. One of the issues we're running into is the time it takes to reparse
>> and regenerate the CMake project (whether ninja, VS, or make) after
>> touching any CMake file. To give you an idea, we have about 1000 targets
>> and that takes a good 2 min for CMake to rerun.
>>
>> Are there any plans to speed this up? Maybe parallelize it in some way or
>> do a better job regenerating only what needs regenerating? Is there
>> anything we can do on our side to reduce our regeneration times?
>>
>> For example, if using a VS generator, each directory in the source that
>> has a CMakeLists.txt gets a .vcproj and .sln generated. Ideally, if I touch
>> one of those CMakeLists.txt, only that .sln/.vcproj would get regenerated.
>>
>> Thanks for any help.
>> --
>>
>> 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
>
>
>
> --
> J. Caleb Wherry
> *Scientific Software Engineer*
>
> 
> http://www.calebwherry.com
> +1 (615) 708-5651
> calebwhe...@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:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Toolchain file for TI in CMake 3.10: how do I override compiler options and specify tools?

2019-02-23 Thread Cristian Adam
On Sat, Feb 23, 2019 at 8:49 AM Jason Heeris  wrote:

> I am trying to use CMake (3.10) to build an ANSI C project that may be
> compiled on PC with eg. GCC, but also needs to compile with Texas
> Instruments' compilers for their microprocessors. So I have about a million
> questions.
>
> According to[1] it seems like the way to do this is via a toolchain file.
> So I'm trying to write a toolchain file to use TI's compiler/linker/etc,
> which do not (always) take the same arguments as eg. GCC or Clang.
>
> Is there a complete list of tools I can override in a toolchain file?
> Specifically, I want to set the C compiler, C++ compiler, assembler and
> linker. I know about CMAKE_C(XX)_COMPILER, but what about the others? Are
> they documented anywhere? (I could guess, but I don't think that's wise.)
>
> As I mentioned, TI's tools aren't the same as GCC, so I need to pare back
> a lot of options and start from almost-scratch (there are some
> commonalities). Options like "-D" and "-I" are fine, which is good because
> then eg. target_include_directories() still works. But certain other flags
> are just going to cause errors. How do I completely remove all compile
> flags from the generated Makefiles and replace them with my own? I can do
> this:
>
> set(CMAKE_C_FLAGS ${MINIMAL_FLAGS} CACHE STRING "" FORCE)
> set(CMAKE_C_FLAGS_DEBUG ${MINIMAL_FLAGS} CACHE STRING "" FORCE)
> set(CMAKE_C_FLAGS_RELEASE ${MINIMAL_FLAGS} CACHE STRING "" FORCE)
> set(CMAKE_C_FLAGS_RELWITHDEBINFO ${MINIMAL_FLAGS} CACHE STRING "" FORCE)
> set(CMAKE_C_FLAGS_MINSIZEREL ${MINIMAL_FLAGS} CACHE STRING "" FORCE)
>
> But I *still* see flags in the generated makefiles that I didn't put there
> such as "--compile_only" and "--c_file=...". How do I get rid of these and
> specify what's correct for my toolchain? (Also, why do I need the CACHE
> STRING "" FORCE options? I pulled that out of various Stackoverflow posts
> but I have no idea why it's necessary. Is that documented? What about the
> configurations... where are they listed? Do I have them all?)
>
>
Regarding the CMAKE__FLAGS_ have a look at this blog post:
https://cristianadam.eu/20190223/modifying-the-default-cmake-build-types/

You "just" need to modify the CMAKE__FLAGS__INIT variables,
no need to force the cache entries.

The "Modules" CMake folder is your friend, you can see how CMake handles
other compilers.
For debugging use CMake's "--trace-expand" command line parameter.

Cheers,
Cristian.
-- 

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] New version forces rebuild all?

2018-12-05 Thread Cristian Adam
On Wed, Dec 5, 2018 at 10:19 PM Andy  wrote:

> (previously I send this mail not to mail list, but user)
> Maybe my cmake files are bad?
> I have created test project
> https://gitlab.com/andrzejbor/test_rebuild_all
> after commit is rebuild whole project
> what I might change?
> I don't want moving all but .git to one directory src/
>
>
The problem is that you add the GIT variables as compile time defines,
which means that after every commit you will have different compile command
lines, which trigger recompilation of whole project because you have used
add_definitions.

You should instead write those GIT variables in a file, like this:

file(WRITE ${CMAKE_BINARY_DIR}/git_version.h.in "
#define GIT_SHA1 \"@GIT_SHA@\"
#define GIT_TAG \"@GIT_TAG@\"
#define GIT_LOCAL_CHANGES \"@GIT_LOCAL_CHANGES@\""
)

configure_file(${CMAKE_BINARY_DIR}/git_version.h.in
${CMAKE_BINARY_DIR}/git_version.h @ONLY)

Make sure you have ${CURRENT_BINARY_DIR} as part of your target's include
directories. And then somewhere in your code do an #include "git_version.h".

Cheers,
Cristian.
-- 

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] Tips on reducing configure time

2018-11-14 Thread Cristian Adam
On Wed, Nov 14, 2018 at 10:20 AM Poughon Victor 
wrote:

> Hi all
>
> I am working on a large C++ project using CMake (
> https://www.orfeo-toolbox.org/) and our 'configure' step takes quite a
> lot of time. This can be annoying for developers working on features where
> the configure step needs to be re-run, or for CI in general.
>
> We have looked into it a bit and it seems like one issue is that the
> configure/generate steps do a lot of small files I/O. Specifically, using:
>
> inotofy-wait -mr 
>
> shows that "cmake ." causes about 150K file access/modify, etc. There are
> some especially guilty looking files like 'Makefile2.tmp' or 'progress.tmp'
> that appear thousands of times in most of the log file.
>
> I have an SSD which somewhat helps, but for colleagues still on mechanical
> drives this is especially painful. Is there a way to disable writing all
> those files to the disk?
>
> Any other tips on optimizing the performance of 'cmake .'?
>
> Thanks,
>
> Victor Poughon
>
>
Hi,

if a subsequent CMake  run is faster than the initial one, you can have a
look at
https://github.com/cristianadam/cmake-checks-cache

If you cache the results of the configure checks you can have the initial
run as fast as subsequent ones!

Cheers,
Cristian.
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] CMake Checks Cache

2018-04-23 Thread Cristian Adam
Hi,

If you use CMake in a CI you should probably have a look at how to speed up
your CMake build: https://github.com/cristianadam/cmake-checks-cache

In the case of LLVM + Clang on a Windows box the speed up was either 2.66x
or 3.32x, depending on the CMake generator.

Even if you don't use CMake Check macros you might want to cache the
initial compiler detection, which could take a few seconds :)

Cheers,
Cristian.
-- 

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] Generating MSVS solution files that can be passed around

2018-04-19 Thread Cristian Adam
On Thu, Apr 19, 2018 at 5:46 PM, Zaak Beekman  wrote:

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

Why not distribute CMake as source code? Compile it so that they don't have
to "install" it.

On the other hand Visual Studio 2017 comes with their own version of CMake!
Just make sure your contractors use VS2017 :D

Cheers,
Cristian.
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] [blog article] It's Time To Do CMake Right

2018-02-20 Thread Cristian Adam
Hi,

I thought the audience here would appreciate this:
https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/

It did quite a stir on /r/cpp too:
https://www.reddit.com/r/cpp/comments/7yps20/its_time_to_do_cmake_right/

Cheers,
Cristian.
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] cmake_format

2018-02-07 Thread Cristian Adam
Hi,

I don't remember seeing this tool advertised on the CMake mailing lists:

https://github.com/cheshirekow/cmake_format/tree/master/cmake_format

*cmake-format can format your listfiles nicely so that they don't look like
crap.*

Cheers,
Cristian.
-- 

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] downloading ftp URL problems

2018-01-27 Thread Cristian Adam
On Sat, Jan 27, 2018 at 12:12 PM, Kris Thielemans <
kris.f.thielem...@gmail.com> wrote:

> Dear all
>
>
>
> I have had no response to this. The problem continues with CMake 3.10.2. I
> have no idea what causes this or how to fix it. Any help would be much
> appreciated.
>
>
>
> Kris
>
>
>
> *From:* Kris Thielemans
>
> *Sent:* 19 December 2017 08:15
> *To:* cmake@cmake.org
> *Subject:* downloading ftp URL problems
>
>
>
> Hi
>
>
>
> I’m try to get a file via ftp in EXTERNAL_PROJECT_ADD by specifying the
> URL. This takes a long time on my Windows machine using CMake 3.10.1 (and
> previous versions of CMake) as it needs multiple retries:
>
>
>
> 2>  -- Using src='ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
>
> 2>  -- Retrying...
>
> 2>  -- Using src='ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
>
> 2>  -- Retry after 5 seconds (attempt #2) ...
>
> 2>  -- Using src='ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
>
> 2>  -- Retry after 5 seconds (attempt #3) ...
>
> 2>  -- Using src='ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
>
> 2>  -- Retry after 15 seconds (attempt #4) ...
>
> 2>  -- Using src='ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
>
> 2>  -- Retry after 60 seconds (attempt #5) ...
>
> 2>  -- Using src='ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
>
> -- [download 0% complete]
>
> ...
>
>
>
> When using on https link, the download starts immediately.
>
>
>
> Any suggestions why this happens, what I can do about it, or how I could
> specify an initial sleep period to skip the first retries (but I’m not sure
> if that’d help)?
>
>
>
> Some more detail:
>
> I’m using Windows 10 home with latest CMake installed via the msi.
>
>
>
> Using the URL in a browser  (firefox) works fine but does need a ~5s wait
> before I get the “save” dialog box.
>
>
>
> Checking the created download.cmake, it is just a loop with different
> sleep_seconds doing the following
>
>
>
> Set(url “ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip”)
>
> execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep "${sleep_seconds}")
>
>
>
>file(
>
>DOWNLOAD
>
>"${url}" "C:/Users/krisf/Documents/devel/fftw-3.3.5-dll64.zip"
>
>SHOW_PROGRESS
>
># no TIMEOUT
>
>STATUS status
>
>LOG log
>
>)
>
>
>
> Thanks for your help
>
>
>

CMake, as far as I know, uses libcurl to handle network transfers.
You should compare cmake downloading with a curl build
not with Firefox.
Rumor has it that curl is part of Windows now.

If the https link works instantly, why not use it also with cmake?

Cheers,
Cristian.
-- 

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] Link Time Code Generation (LTGC) by default, for Release configurations of Visual Studio projects?

2018-01-24 Thread Cristian Adam
Hi,

I had a quick check to see if CMake 3.10 for which compilers it has support
for Interprocedural Optimization

(IPO, or LTCG as known on Visual C++).

Modules/Compiler had only for *GNU*, *Clang* and *PGI* the following:
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)

QNX with QCC didn't have it set to YES even though nowdays QNX comes with
GCC 5.4.0 on QNX 7.0, which should be just fine.

It would be nice if CMake would have support for IPO on Visual C++.

The steps would be to set the right variables into
Modules/Compiler/MSVC-CXX.cmake, change the CheckIPOSupported

module, change some flags in some places,update tests, documentation, and
so on.

Shouldn't be hard to add this feature.

Cheers,
Cristian.



On Wed, Jan 24, 2018 at 9:06 PM, Niels Dekker <
niels_dekker_address_until_2...@xs4all.nl> wrote:

> When a Visual C++ project is created within Visual Studio (by File menu,
> New, Project...), it has Link Time Code Generation (LTGC) by default, for
> its Release configurations: Compiler option /GL and linker option /LTCG.
> However, when the Visual C++ project is generated by CMake, it does not
> have LTGC, by default. LTCG looks like a very useful feature to me. I think
> it's worth enabling the feature by default, for Release configurations.
> What do you think?
>
>
> Some details:
>
> I created a "dummy" Visual C++ project in Visual Studio 2017 (Version
> 15.5.4), by File menu, New, Project..., and I also generated one by CMake
> (version 3.10.2), using a very minimal CMakeLists.txt
>
> The Visual C++ project created by Visual Studio 2017 has the following
> compile options, by default, for Release (x64):
>
> /permissive- /GS /GL /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl
> /Fd"x64\Release\vc141.pdb" /Zc:inline /fp:precise /D "_MBCS"
> /errorReport:prompt /WX- /Zc:forScope /Gd /Oi /MD /Fa"x64\Release\" /EHsc
> /nologo /Fo"x64\Release\" /Fp"x64\Release\MyVS2015Project.pch"
> /diagnostics:classic
>
> And the following linker options:
>
> /OUT:"F:\X\Src\MyProject\MyVS2015Project\x64\Release\MyVS2015Project.exe"
> /MANIFEST /LTCG:incremental /NXCOMPAT /PDB:"F:\X\Src\MyProject\MyVS2
> 015Project\x64\Release\MyVS2015Project.pdb" /DYNAMICBASE "kernel32.lib"
> "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib"
> "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib"
> "odbccp32.lib" /DEBUG:FULL /MACHINE:X64 /OPT:REF
> /PGD:"F:\X\Src\MyProject\MyVS2015Project\x64\Release\MyVS2015Project.pgd"
> /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
> /ManifestFile:"x64\Release\MyVS2015Project.exe.intermediate.manifest"
> /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
>
> The vcxproj file created by Visual Studio has
> "true" for its
> Release configurations.
>
>
> The Visual C++ project generated by CMake (Generator: Visual Studio 15
> 2017 Win64) has the following compile options, for its Release
> configuration:
>
> /GS /TP /W3 /Zc:wchar_t /Gm- /O2 /Ob2 /Fd"MyExecutable.dir\Release\vc141.pdb"
> /Zc:inline /fp:precise /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D
> "CMAKE_INTDIR=\"Release\"" /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope
> /GR /Gd /MD /Fa"Release/" /EHsc /nologo /Fo"MyExecutable.dir\Release\"
> /Fp"MyExecutable.dir\Release\MyExecutable.pch" /diagnostics:classic
>
> And the following linker options:
>
> /OUT:"F:\X\Bin\vc141-64\MyProject\Release\MyExecutable.exe" /MANIFEST
> /NXCOMPAT /PDB:"F:/X/Bin/vc141-64/MyProject/Release/MyExecutable.pdb"
> /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib"
> "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib"
> "advapi32.lib" /IMPLIB:"F:/X/Bin/vc141-64/MyProject/Release/MyExecutable.lib"
> /MACHINE:X64 /INCREMENTAL:NO 
> /PGD:"F:\X\Bin\vc141-64\MyProject\Release\MyExecutable.pgd"
> /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
> /ManifestFile:"MyExecutable.dir\Release\MyExecutable.exe.intermediate.manifest"
> /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
>
> The vcxproj file generated by CMake does not have a
> "" tag.
>
>
> I hope you can consider adding LTCG to Release configurations of Visual
> C++ projects generated by CMake, by default.
>
>
> Kind regards, Niels
> --
> Niels Dekker
> Scientific programmer
> LKEB, Leiden University Medical Center
> --
>
> 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
> rc

Re: [CMake] CMake Monthly Meeting Summary

2017-11-21 Thread Cristian Adam
On Tue, Nov 21, 2017 at 6:40 PM, Robert Maynard 
wrote:

> Sorry about this this was meant for an internal mailing list.
>
>
Please do give us an update on the part regarding C++20 modules! I think
I'm not the only
on interested in this.

Cheers,
Cristian.
-- 

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 equivalent to Boost.Build site-config.jam or user-config.jam

2017-08-09 Thread Cristian Adam
On Tue, Aug 8, 2017 at 8:08 PM, Brian Davis  wrote:

>
> Is there a CMake equivalent to a site-config.jam or user-config.jam
>
> http://www.boost.org/build/doc/html/bbv2/recipies/site-config.html
>
> basically a CMake file the user can put in a project directory that CMake
> will read first when using cmake-gui that allows user to specify stuff they
> don't want to have to keep specifying in cmake-gui each "delete cache"
>
> such as
>
> set( CMAKE_INSTALL_PREFIX ${CURRENT_LIST_DIR}/install CACHE STRING ""
> FORCE)
> set( CMAKE_DEBUG_POSTFIX d CACHE STRING "" FORCE )
>
>
> There is cmake.exe
>
> -C 
>
> but requires command line
>
> come to think of it would be nice if
> set( CMAKE_GENERATOR_PLATFORM "Visual Studio 12 2013 Win64" )
>
> in desired user config file and CMake would just "make it so" on clicking
> Generate.
>
> I can do this with my own projects, by implementing it myself, but when
> checking out 3rd party projs they can be all over the map on config
> allowing a user-config.cmake would provide mechanism to tame the config
> problems.
>
> Desired workflow
>
> 1) Checkout 3rd party proj
>
> 2) put a CMakeUser.txt or whatever file per project
>
> 3) Run CMake GUI Generate
>
> 4) Click Open Project
>
> 5) Change whatever manual bits in in gui
>
> 6) Update project suing git witch branches versions
>
> 7) Delete Cache
>
> 8) Return to 3
>
> 9) Doopy doopy doo whatever else
>

There is the (undocumented) PreLoad.cmake
,
which acts like giving a precache file with -C command line argument.

But, as it turns out, it doesn't work with server mode :(

Cheers,
Cristian.
-- 

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-06 Thread Cristian Adam
On Thu, Jul 6, 2017 at 10:00 PM, Michael Jackson <
mike.jack...@bluequartz.net> wrote:

> 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".
>
> Just curious.
>
>
Have you tried removing moc altogether using Verdigris
? I'm curious how
this would speed up your compilation time.

Cheers,
Cristian.
-- 

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 Clang + Ninja on Windows?

2016-04-22 Thread Cristian Adam
On Fri, Apr 22, 2016 at 8:59 AM, Mueller-Roemer, Johannes Sebastian <
johannes.sebastian.mueller-roe...@igd.fraunhofer.de> wrote:

> You are mistaken, Clang absolutely also works with MinGW. Or it did at
> least up to 3.7 (didn’t get around to trying 3.8 yet)
>
>
>

Clang works fine with libstdc++ on Linux and Cygwin, there should be no
reason why it shouldn't work with MinGW.

What I should have wrote was that Clang on Windows officially supports only
a Visual C++ setup / Visual Studio integration.

I don't think I have seen a package containing clang and libstdc++ from
MinGW.

Cheers,
Cristian.
-- 

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 Clang + Ninja on Windows?

2016-04-21 Thread Cristian Adam
On Wed, Apr 20, 2016 at 4:01 PM, Johan Holmberg  wrote:

> Hi!
>
> How should I setup CMake to build a C/C++ application on Windows using
> clang/clang++ as compilers and Ninja as build tool?
>
> I tried specifying "-GNinja" to cmake, and setting CC/CXX to
> clang/clang++. But this didn't work. I get errors like:
>
>   clang.exe: error: no such file or directory: '/nologo'
>
> indicating that CMake thinks it should pass Visual C++ style options to
> clang.
>
> I'm thinking about fooling CMake that clang/clang++ are cross compilers (I
> know how to get cross compiling working in other cases). But since
> clang/clang++ are the native tools for Windows, I was hoping to be able to
> use Clang + Ninja on Windows almost like I use on Linux.
>
> If I run Clang from the command line, I can build my application, so my
> Clang-installation works.
>
> I'm using CMake 3.5.1 and Clang 3.8.0.
>
> /Johan Holmberg
>
>
Hi,

On Windows Clang works only with Visual C++, since they don't provide
libc++. MinGW is not supported.
Clang provides a Visual C++'s cl.exe replacement.

You need to have the official windows
 Clang and Visual C++ Express
or Community installed.

Then it's just a matter of:

   1. Opening a Visual C++ 2013 64 bit command prompt window
   2. Putting clang's cl.exe in the path and setting clang's INCLUDE path
   first

   set PATH=c:\Program Files\LLVM\msbuild-bin\;%PATH%
   set INCLUDE=c:\Program Files\LLVM\lib\clang\3.8.0\include\;%INCLUDE%

   3. cmake -G "Ninja"
   4. Ninja

CMake / Ninja will think that they compile with Visual C++, but instead
will use clang.

Note that you have to match Visual C++ and Clang's build, 32 or 64 bit. You
can't mix them,
or you'll have weird errors
.

Cheers,
Cristian.

P.S. This is actually a re-post, this time adding the mailing list.
-- 

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 download blocked by Google Chrome

2016-04-10 Thread Cristian Adam
Hi,

virustotal.com (which belongs to google) doesn't find any problems with the
msi file.

I assume Google Chrome panics because the file is not digitally signed by
CMake.org.

One can get an open source authenticode for 14€ from Certum

.


Cheers,
Cristian.

On Sun, Apr 10, 2016 at 4:25 PM, Matthew Rule 
wrote:

> When trying to download cmake-3.5.1-win32-x86.msi from
> https://cmake.org/download/ I received the following message:
> https://i.gyazo.com/6cf9cd56e9cf1f513f649cf59f768241.png
>
> I'd assume that this message is displayed to most Chrome users (if Google
> uses and distributes a single collection of malware filter lists) so it
> should be a big concern. Is it currently safe to download software from
> cmake.org, or has someone injected malicious code into it? Why has this
> message come up? Can I ignore it safely?
>
> Thanks,
>
> Matt
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-10 Thread Cristian Adam
On Thu, Mar 10, 2016 at 12:48 AM, Anton Yartsev 
wrote:

> Oops, sorry, confused with different variants.
>
> I've tried
> $SET CC=D:\LLVM-3.7.1\bin\clang-cl.exe
> $SET CXX=D:\LLVM-3.7.1\bin\clang-cl.exe
> $cmake -G "Ninja" ..
>
> Compilation succeeded, linkage has ended up with "clang-cl.exe: error:
> unable to execute command: program not executable".
> The same result with clang-cl.exe renamed to cl.exe.
>


Hi Anton,

My setup is:

  * Visual Studio 2013 x86 and amd64
  * Clang 3.7.1 64 bit installed in c:\Program Files\LLVM\
  * CMake 3.5.0
  * Ninja 1.5.3
  * C++ Hello World CMake project

Visual Studio 2013 amd64


1. Opened a command prompt and run "C:\Program Files (x86)\Microsoft Visual
Studio 12.0\VC\vcvarsall.bat" amd64
2. set INCLUDE=c:\Program Files\LLVM\lib\clang\3.7.1\include\;%INCLUDE%
3. set PATH=c:\Program Files\LLVM\msbuild-bin\;%PATH%
4. cmake -G "Ninja" ..\helloworldcmake

CMake output was:

$ cmake -G "Ninja" ..\helloworldcmake
-- The C compiler identification is Clang 3.7.1
-- The CXX compiler identification is Clang 3.7.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - failed
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/C++/helloworldcmake-build


Visual Studio 2013 x86
=

1. Opened a command prompt and run "C:\Program Files (x86)\Microsoft Visual
Studio 12.0\VC\vcvarsall.bat" x86
2. set INCLUDE=c:\Program Files\LLVM\lib\clang\3.7.1\include\;%INCLUDE%
3. set PATH=c:\Program Files\LLVM\msbuild-bin\;%PATH%
4. cmake -G "Ninja" ..\helloworldcmake

CMake output was:


$ cmake -G "Ninja" ..\helloworldcmake
-- The C compiler identification is Clang 3.7.1
-- The CXX compiler identification is Clang 3.7.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at
C:/Tools/cmake-3.5.0/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61
(message):
  The C compiler "C:/Program Files/LLVM/msbuild-bin/cl.exe" is not able to
  compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/C++/helloworldcmake-build/CMakeFiles/CMakeTmp



  Run Build Command:"C:/Tools/ninja/ninja.exe" "cmTC_89c35"

  [1/2] Building C object CMakeFiles\cmTC_89c35.dir\testCCompiler.c.obj

  [2/2] Linking C executable cmTC_89c35.exe

  FAILED: cmd.exe /C "cd .  && C:\Tools\cmake-3.5.0\bin\cmake.exe -E
  vs_link_exe --intdir=CMakeFiles\cmTC_89c35.dir --manifests --
  C:\PROGRA~2\MICROS~3.0\VC\bin\link.exe /nologo
  CMakeFiles\cmTC_89c35.dir\testCCompiler.c.obj /out:cmTC_89c35.exe
  /implib:cmTC_89c35.lib /pdb:cmTC_89c35.pdb /version:0.0 /machine:x64
/debug
  /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib
  winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib
  advapi32.lib && cd ."

  LINK : error LNK2001: unresolved external symbol mainCRTStartup

  cmTC_89c35.exe : fatal error LNK1120: 1 unresolved externals

  LINK Pass 1 failed.  with 1120

  ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- Configuring incomplete, errors occurred!
See also "C:/Projects/C++/helloworldcmake-build/CMakeFiles/CMakeOutput.log".
See also "C:/Projects/C++/helloworldcmake-build/CMakeFiles/CMakeError.log".



Clang people say that both Clang builds (32 or 64 bit) can compile both 32
and 64 bit
applications. [1]

As it turns out this statement is not completely true :)

I've installed the 32 bit Clang 3.7.1 version to c:\Program Files
(x86)\LLVM\ and tried
again:

Visual Studio 2013 x86
=

1. Opened a command prompt and run "C:\Program Files (x86)\Microsoft Visual
Studio 12.0\VC\vcvarsall.bat" x86
2. set INCLUDE=c:\Program Files
(x86)\LLVM\lib\clang\3.7.1\include\;%INCLUDE%
3. set PATH=c:\Program Files (x86)\LLVM\msbuild-bin\;%PATH%
4. cmake -G "Ninja" ..\helloworldcmake

This time the CMake output was:

$ cmake -G "Ninja" ..\helloworldcmake
-- The C compiler identification is Clang 3.7.1
-- The CXX compiler identification is Clang 3.7.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - failed
-- Configuring done
-- Generating done
-- Build files have been written t

Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-04 Thread Cristian Adam
Hi Anton,

When I say clang-cl I mean how the official llvm package does it - a 50mb
executable named cl.exe and not clang-cl.exe.

Ninja believes it compiles with visual c++, but instead it compiles with
clang. That's why you need to put the path to clang INCLUDE and PATH first.

Simply rename clang-cl.exe as cl.exe, copy it in a directory and put that
path as first in the PATH environment variable.

Cheers,
Cristian.
On Mar 4, 2016 12:16, "Anton Yartsev"  wrote:

> Hi Cristian,
>
> thanks for the replay. I have clang-cl first in PATH, the problem persists.
>
> $ SET PATH
> Path=D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin;...
>
> $cd D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin
> $dir
>  Directory of D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin
>
> 04.03.2016  14:03  .
> 04.03.2016  14:03  ..
> 04.03.2016  01:0011 662 848 arcmt-test.exe
> 04.03.2016  01:02 6 446 080 bugpoint.exe
> 04.03.2016  01:01 9 728 c-arcmt-test.exe
> 04.03.2016  01:0182 944 c-index-test.exe
> 04.03.2016  17:2040 207 872 clang++.exe
> 04.03.2016  01:0132 803 840 clang-check.exe
> 04.03.2016  17:2040 207 872 clang-cl.exe
> 04.03.2016  01:00 1 401 856 clang-format.exe
> 04.03.2016  17:05   814 592 clang-tblgen.exe
> 04.03.2016  17:2040 207 872 clang.exe
> ...
>
>
> Hi Anton,
>
> clang.exe doesn't know of any windows specific things.  Clang-cl instead
> does.
>
> Just make sure to have clang-cl before msvc-cl in path and ninja will just
> work.
>
> Cheers,
> Cristian
> On Mar 4, 2016 01:31, "Anton Yartsev"  wrote:
>
>> Hi all,
>>
>> I'm trying to use Clang, compiled with VS 2013 (configuration:Release,
>> platform:x64) as a C/C++ compiler for a simple HelloWorld CMake project.
>> Generation ends up with errors like "clang.exe: error: no such file or
>> directory: '/DWIN32'" at compiler check stage. If I understand correctly
>> the problem is that MSVC compiler options are fed to Clang for some reason
>> (maybe the "-- The C compiler identification is unknown" log entry is
>> related to the problem?).
>> Could anyone help to resolve this, please?
>>
>> I also tried to change compiler ID with "-DCMAKE_C_COMPILER_ID=Clang
>> -DCMAKE_CXX_COMPILER_ID=Clang", then compilation succeeded, but linkage
>> failed (just as described in the thread "Question on usage of cmake on
>> Windows with clang"
>> http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/54650).
>> Here the problem seems to be reversed: GNU linker options are fed to MS
>> linker.
>>
>> ** Setup and details:
>> 1) INCLUDE and PATH set to clang/clang-cl
>> 2) command line environment is configured with vsvars32.bat
>> 3) CC and CXX set to clang
>>
>> $ cat CMakeLists.txt
>> project(test_project)
>> add_executable(main file.cpp)
>>
>> $ cmake -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang ..
>>
>> Log:
>> -- The C compiler identification is unknown
>> -- The CXX compiler identification is Clang 3.7.1
>> -- Check for working C compiler using: Ninja
>> -- Check for working C compiler using: Ninja -- broken
>> CMake Error at C:/Program
>> Files/CMake/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
>>   The C compiler "D:/-Work-/llvm-3.7.1.src/-VS_build VS
>>   2013-/Release/bin/clang.exe" is not able to compile a simple test
>> program.
>>   It fails with the following output:
>>Change Dir: D:/-Work-/llvm-3.7.1.src/-CLANG-/CMakeFiles/CMakeTmp
>>
>>   Run Build Command:"C:/PROGRA~1/ninja/ninja.exe" "cmTC_2cb9d"
>>
>>   [1/2] Building C object CMakeFiles\cmTC_2cb9d.dir\testCCompiler.c.obj
>>
>>   FAILED: D:\-Work-\LLVM-3~2.SRC\-VS_BU~2\Release\bin\clang.exe /DWIN32
>>   /D_WINDOWS /W3 -o CMakeFiles\cmTC_2cb9d.dir\testCCompiler.c.obj -c
>>   testCCompiler.c
>>
>>   clang.exe: error: no such file or directory: '/DWIN32'
>>   clang.exe: error: no such file or directory: '/D_WINDOWS'
>> ...
>>
>> OS: Windows 7 (x64)
>>
>> clang version 3.7.1 (tags/RELEASE_371/final)
>> Target: x86_64-pc-windows-msvc
>> Thread model: posix
>>
>> cmake version 3.5.0-rc3
>>
>> Thank you!
>>
>> --
>> Anton
>>
>> --
>>
>> 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
>>
>
>
> --
> Anton
>
>
-- 

Powered by www.kitware.com

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

Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-03 Thread Cristian Adam
Hi Anton,

clang.exe doesn't know of any windows specific things.  Clang-cl instead
does.

Just make sure to have clang-cl before msvc-cl in path and ninja will just
work.

Cheers,
Cristian
On Mar 4, 2016 01:31, "Anton Yartsev"  wrote:

> Hi all,
>
> I'm trying to use Clang, compiled with VS 2013 (configuration:Release,
> platform:x64) as a C/C++ compiler for a simple HelloWorld CMake project.
> Generation ends up with errors like "clang.exe: error: no such file or
> directory: '/DWIN32'" at compiler check stage. If I understand correctly
> the problem is that MSVC compiler options are fed to Clang for some reason
> (maybe the "-- The C compiler identification is unknown" log entry is
> related to the problem?).
> Could anyone help to resolve this, please?
>
> I also tried to change compiler ID with "-DCMAKE_C_COMPILER_ID=Clang
> -DCMAKE_CXX_COMPILER_ID=Clang", then compilation succeeded, but linkage
> failed (just as described in the thread "Question on usage of cmake on
> Windows with clang"
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/54650).
> Here the problem seems to be reversed: GNU linker options are fed to MS
> linker.
>
> ** Setup and details:
> 1) INCLUDE and PATH set to clang/clang-cl
> 2) command line environment is configured with vsvars32.bat
> 3) CC and CXX set to clang
>
> $ cat CMakeLists.txt
> project(test_project)
> add_executable(main file.cpp)
>
> $ cmake -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang ..
>
> Log:
> -- The C compiler identification is unknown
> -- The CXX compiler identification is Clang 3.7.1
> -- Check for working C compiler using: Ninja
> -- Check for working C compiler using: Ninja -- broken
> CMake Error at C:/Program
> Files/CMake/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
>   The C compiler "D:/-Work-/llvm-3.7.1.src/-VS_build VS
>   2013-/Release/bin/clang.exe" is not able to compile a simple test
> program.
>   It fails with the following output:
>Change Dir: D:/-Work-/llvm-3.7.1.src/-CLANG-/CMakeFiles/CMakeTmp
>
>   Run Build Command:"C:/PROGRA~1/ninja/ninja.exe" "cmTC_2cb9d"
>
>   [1/2] Building C object CMakeFiles\cmTC_2cb9d.dir\testCCompiler.c.obj
>
>   FAILED: D:\-Work-\LLVM-3~2.SRC\-VS_BU~2\Release\bin\clang.exe /DWIN32
>   /D_WINDOWS /W3 -o CMakeFiles\cmTC_2cb9d.dir\testCCompiler.c.obj -c
>   testCCompiler.c
>
>   clang.exe: error: no such file or directory: '/DWIN32'
>   clang.exe: error: no such file or directory: '/D_WINDOWS'
> ...
>
> OS: Windows 7 (x64)
>
> clang version 3.7.1 (tags/RELEASE_371/final)
> Target: x86_64-pc-windows-msvc
> Thread model: posix
>
> cmake version 3.5.0-rc3
>
> Thank you!
>
> --
> Anton
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] Question on usage of cmake on Windows with clang

2016-02-08 Thread Cristian Adam
On Mon, Feb 8, 2016 at 1:56 PM, Victor Leschuk  wrote:

> Hello, I am trying to use clang with cmake on Windows.
>
> I have compiled LLVM+clang using Visual Studio 2015. And now I am facing
> problems with building cmake projects using this clang. It looks like cmake
> is trying to pass wrong options to linker.
>
> os: Windows 7 (64bit)
>
> $ clang --version
> clang version 3.9.0
> Target: i686-pc-windows-msvc
> Thread model: posix
>
> $ cmake --version
> cmake version 3.5.0-rc1
>
> It would be great if someone could point me to what am I doing wrong?
>
> Thanks in advance!
>

Did you build also libc++? Which CRT does clang 3.9.0 use on Windows?

Clang officially offers the clang-cl driver, which is a Visual C++ cl.exe
replacement.

The following works with Clang 3.7.0 and Visual C++ 2013 (should also work
with Clang 3.9 and Visual C++ 2015):

1. Open Visual C++ command prompt window
2. Set INCLUDE and PATH to the clang-cl
set PATH=C:\Program Files (x86)\LLVM\msbuild-bin\;%PATH%
set INCLUDE=C:\Program Files
(x86)\LLVM\lib\clang\3.7.0\include\;%INCLUDE%
3. cmake -G "Ninja" will pick clang-cl and should build and link just fine.

HTH,
Cristian
-- 

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] Help for a cmake newbie

2016-01-31 Thread Cristian Adam

On 31-Jan-16 03:42, vadtec wrote:


curl, libiconv, libpng, libssh2, and zlib are the libs I want to build 
and use both on Linux and Windows. I know all of those are available 
on Linux and I could use the system installed versions, but I want to 
use the same vesions on Windows as well. The server is only built on 
Linux, while the client needs to be built for Linux and Windows. All 
the libs, headers, etc go into the build directory, and the final 
"make install" puts everything into the bundle directory, so it can be 
packaged for distribution.




Have a look at hunter  – 
Cross-platform package manager for C++ (based on CMake ExternalProject).


Hunter has CMake versions for:

 * libpng 
 * libssh2 
 * zlib 

Curl  has CMake support by itself. The 
only library missing is libiconv. It seems that
LuaDist project has added  a CMake build here 
.


You could either take all the libraries and include in your project or 
open hunter tickets. 


Cheers,
Cristian.

-- 

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 any way to use clang-cl with MSBuild on Windows?

2016-01-29 Thread Cristian Adam

On 29-Jan-16 19:04, Yi-Hong Lyu wrote:

Hello everyone,

I am a newbie of CMake. I would like to use clang-cl with MSBuild on 
Windows. However it always use MSVC 19.0.23506.0 as the identified 
compiler even I defined CMAKE_C_COMPILER / CMAKE_CXX_COMPILER / 
CMAKE_C_COMPILER_FORCED / CMAKE_CXX_COMPILER_FORCED:


$ cmake -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl 
-DCMAKE_C_COMPILER_FORCED=ON -DCMAKE_CXX_COMPILER_FORCED=ON ..\src\

-- Building for: Visual Studio 14 2015
-- The CXX compiler identification is MSVC 19.0.23506.0
-- The C compiler identification is MSVC 19.0.23506.0
-- Configuring for standalone build.
-- Found PythonInterp: C:/Python34/python.exe (found version "3.4.4")
-- Sphinx disabled.
.
.
.

PS. The environment PATH is already set to clang-cl.

I am wondering whether there is any option that I can force MSBuild 
use clang-cl instead.


Thanks,
Yi-Hong



I use clang-cl with ninja.  Open a Visual Studio 2013 command prompt 
window and then set:


$ set PATH=C:\Program Files (x86)\LLVM\msbuild-bin\;%PATH%
$ set INCLUDE=C:\Program Files (x86)\LLVM\lib\clang\3.7.0\include\;%INCLUDE%


The same can be done with Qt Creator and a cloned Visual C++ kit, but in 
the environment settings instead of %PATH% and %INCLUDE% use

$(PATH) and $(INCLUDE).

Cheers,
Cristian.

-- 

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 based package manager

2016-01-11 Thread Cristian Adam
On Mon, Jan 11, 2016 at 2:33 PM, Nicholas Braden  wrote:

> Doesn't biicode already fill this role? Biicode seems to work well
> enough for me, anyway.
>
>
Biicode is dead.

There is a comparison with biicode here:
https://github.com/ruslo/hunter/issues/54

Having only CMake as a dependency is awesome!

I have tried once to reuse biicode's OpenSSL CMake files, I failed. So I
ended up
using perl and whatever OpenSSL needed to compile.

On the other hand hunter has only CMake as dependency, which means that its
CMake scripts are very portable.

Cheers,
Cristian.
-- 

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 based package manager

2016-01-11 Thread Cristian Adam
Ruslan Baratov via CMake  writes:

> 
> Hi,
> 
> I'm developing a project that is a kind of wrapper of 
> ExternalProject_Add and
> allow it to be more reusable. User interface is quite simple.
> 
> For anybody interested, here is a github project:
> 
> * https://github.com/ruslo/hunter

Recently posted on reddit: 
https://www.reddit.com/r/cpp/comments/40cfbk/hunter_crossplatform_packag
e_manager_for_c/

Any thoughts of including such a project in CMake? 

Cheers,
Cristian.


-- 

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] Ninja generator fail for QNX on Windows

2014-09-24 Thread Cristian Adam
Hendrik Sattler  writes:

> On 23. September 2014 16:22:40 MESZ, Cristian Adam 
> >>> QCC compiler generates for this project dependency files which look
> >like:
> >>>
> >>> c:\projects\my_proj\include\/a.h \
> >>> c:\projects\my_proj\src\/a.cpp \
> >>> c:\projects\my_proj\other\..\/include/b.h \
> >>> c:\projects\my_proj\other\..\/src/b.cpp \
> 
> To me it looks more like a bug in qcc.
> Does qcc generates the same broken files when not used in context of 
> CMake or ninja?
>
> It should only use one kind of separator for directories.
> 
> HS
> 

It might be a bug in qcc.

I've tried to compile CMake with ninja and here are a few dependency files: 

[c:\Projects\cmake-2.8.12.2-build\Source\kwsys\CMakeFiles\cmsys.dir\
Base64.c.o.d]

Source\kwsys\CMakeFiles\cmsys.dir\Base64.c.o: \
 C:\Projects\cmake-2.8.12.2\Source\kwsys\Base64.c \
 C:\Projects\cmake-2.8.12.2\Source\kwsys\/kwsysPrivate.h \
 Source/cmsys/Base64.h Source/cmsys/Configure.h

[c:\Projects\cmake-2.8.12.2-build\Utilities\KWIML\test\CMakeFiles\
cmIML_test.dir\test_ABI_C.c.o.d]

Utilities\KWIML\test\CMakeFiles\cmIML_test.dir\test_ABI_C.c.o: \
 C:\Projects\cmake-2.8.12.2\Utilities\KWIML\test\test_ABI_C.c \
 C:\Projects\cmake-2.8.12.2\Utilities\KWIML\test\/test.h \
 Utilities/cmIML/ABI.h Utilities\KWIML\test/test_ABI_endian.h


The following patch to ninja fixed my problem with the "\/" pair:

diff -Naur ninja-master-orig/src/depfile_parser.in.cc
ninja-master/src/depfile_parser.in.cc
--- ninja-master-orig/src/depfile_parser.in.cc  2014-09-17
22:00:32.0 +0200
+++ ninja-master/src/depfile_parser.in.cc   2014-09-24
08:29:03.869714200 +0200
@@ -67,6 +67,11 @@
 *out++ = '$';
 continue;
   }
+  '\\/' {
+// QCC case on Windows where in some cases "\/" were generated.
+*out++ = '\\';
+continue;
+  }
   '\\' [^\000\r\n] {
 // Let backslash before other characters through verbatim.
 *out++ = '\\';

Everything is fine now! ^_^

Cheers,
Cristian.

-- 

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] Ninja generator fail for QNX on Windows

2014-09-23 Thread Cristian Adam
On 23 Sep 2014 15:27, "Bill Hoffman"  wrote:
>
>
> Seems that gmake supports that:
>
http://www.qnx.com/developers/docs/6.4.1/neutrino/prog/make_convent.html#Parallel
>

In theory it should work, but the mingw version they ship doesn't work.

I've upgraded to a version of make which does (one needs to pass
SHELL=cmd.exe as an additional parameter), but when you haven't changed
anything it still takes some time. This is where ninja comes into place.

>>
>> Found the problem though.
>>
>> QCC compiler generates for this project dependency files which look like:
>>
>> c:\projects\my_proj\include\/a.h \
>> c:\projects\my_proj\src\/a.cpp \
>> c:\projects\my_proj\other\..\/include/b.h \
>> c:\projects\my_proj\other\..\/src/b.cpp \
>>
>> The "\/" combination does not agree with ninja.
>>
> That would do it.   How are the depends being created?  Is it ninja or
CMake that is creating them on QNX?

CMake sets the right flags for qcc and qcc creates the dependency files.

Cheers,
Cristian.
-- 

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] Ninja generator fail for QNX on Windows

2014-09-23 Thread Cristian Adam
On Mon, Sep 22, 2014 at 6:32 PM, Bill Hoffman 
wrote:


> Maybe if you looked at the very first older than in your output instead of
> the dirty ones it might tell you what ninja thinks is out of date. Could be
> some sort of path issue that has something to do with the way the paths are
> constructed.  Again, without seeing the details I can only guess.
>
> Do makefiles work for you?  What if you try the "Unix Makefiles" generator
> on the same machine does it have the same problem?
>
> -Bill
>

Unix Makefiles work, but on the make provided by QNX doesn't support the
parallel -j flag.

Found the problem though.

QCC compiler generates for this project dependency files which look like:

c:\projects\my_proj\include\/a.h \
c:\projects\my_proj\src\/a.cpp \
c:\projects\my_proj\other\..\/include/b.h \
c:\projects\my_proj\other\..\/src/b.cpp \

The "\/" combination does not agree with ninja.

I've tried to hack disk_interface.cc:RealDiskInterface::Stat by removing
the "/" prefix.

  string dir = DirName(path);
>   string base(path.substr(dir.size() ? dir.size() + 1 : 0));
>
>   if (base[0] == '/' || base[0] == '\\')
>   {
> base.erase(0, 1);
>   }
>
>

But this fixes only the a.h and a.cpp case.

The other case with doesn't work though, since the path is no longer
present, Stat received only "include/b.h" and "src/b.cpp".

A workaround would be to search and replace all "\/" occurrences in
all dependency files.

This looks like a ninja bug, I'll report it there.

Thank you for the support.

Cheers,
Cristian.
-- 

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] Ninja generator fail for QNX on Windows

2014-09-22 Thread Cristian Adam
On Mon, Sep 22, 2014 at 5:40 PM, Bill Hoffman 
wrote:

> On 9/22/2014 1:45 AM, Cristian Adam wrote:
>
>>
>> On QNX side, thins are not as good. First, in order to compile
>> the project I had to apply this patch [1], provided by Stephen Kelly.
>>
>> And now the "fail" part for QNX, the second subsequent build
>> doesn't say "ninja: no work to do" instead it starts compiling,
>> taking as much as 70% of the original clean build time :(
>>
>> Now I don't know who to blame cmake or ninja?
>>
> There is no way to really tell what is going on from what you have
> posted.  What about the third time you run ninja does it have nothing todo?
>

For the 3rd time, 4th time etc. same thing happens.

>
> You can run:
>  ninja -d explain
> to see why ninja wants to run things.  Sounds like some input files are
> getting changed during your build for QNX for some reason.
>
> -Bill
>
>
"-d explain" parameter gives for lots of files (probably all) in the
project (headers, source files, object files, static libraries,
executables)
"is dirty"

This means that ninja's method of detecting if a file has been changed
doesn't quite work for QNX.  Or is this being set by cmake?
Some compiler flag which needs a -Wc, or -Wp prefix?

Cheers,
Cristian.
-- 

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] Ninja generator fail for QNX on Windows

2014-09-21 Thread Cristian Adam
Hi,

I have a project which uses CMake (v 2.8.12.2) to (cross)compile
on Windows using either Visual Studio 2008 or QNX 6.5.0.

Using ninja (v1.5.1) as a CMake generator works as expected with
Visual Studio 2008. First build takes time, second subsequent
build says: "ninja: no work to do".

On QNX side, thins are not as good. First, in order to compile
the project I had to apply this patch [1], provided by Stephen Kelly.

And now the "fail" part for QNX, the second subsequent build
doesn't say "ninja: no work to do" instead it starts compiling,
taking as much as 70% of the original clean build time :(

Now I don't know who to blame cmake or ninja?

Thank you,
Cristian.

[1]
http://public.kitware.com/pipermail/cmake-developers/2014-January/009413.html
-- 

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 2.8.0 RC 1 ready for testing!

2009-09-26 Thread Cristian Adam

Bill Hoffman wrote:

- Qt based GUI cmake-gui is now the default GUI, MFC CMakeSetup is no
  longer included in CMake.  ccmake is still supported.


If MFC is no longer used then the following files should not be part
of the installer:

Microsoft.VC90.MFCLOC.manifest
Microsoft.VC90.MFC.manifest
mfcm90u.dll
mfcm90.dll
mfc90u.dll
mfc90kor.dll
mfc90jpn.dll
mfc90ita.dll
mfc90fra.dll
mfc90esp.dll
mfc90enu.dll
mfc90deu.dll
mfc90cht.dll
mfc90chs.dll
mfc90.dll

I've checked that MFC is no longer referenced:

c:\Program Files\CMake 2.8\bin
$ dumpbin /imports ctest.exe | findstr -i mfc

c:\Program Files\CMake 2.8\bin
$ dumpbin /imports cpack.exe | findstr -i mfc

c:\Program Files\CMake 2.8\bin
$ dumpbin /imports cmw9xcom.exe | findstr -i mfc

c:\Program Files\CMake 2.8\bin
$ dumpbin /imports cmake-gui.exe | findstr -i mfc

c:\Program Files\CMake 2.8\bin
$ dumpbin /imports cmake.exe | findstr -i mfc

c:\Program Files\CMake 2.8\bin
$

Cheers,
Cristian.
___
Powered by www.kitware.com

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

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

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


Re: [CMake] cmake 2.6.4 won't find boost 1.40 on windows

2009-09-17 Thread Cristian Adam

John Drescher wrote:




You set BOOST_ROOT in your windows environment variables.



Thanks for the tip. Setting BOOST_INCLUDEDIR environment variable
to "c:/boost/include/boost-1_40" resolved all the problems, no need
to set additional versions, it just worked.

I was a bit surprised to see that after following the instructions
from here:
http://www.boost.org/doc/libs/1_40_0/more/getting_started/windows.html
(especially #5.3.4) cmake didn't work "out of the box" with my freshly 
compiled boost.


Cheers,
Cristian.
___
Powered by www.kitware.com

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

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

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


Re: [CMake] cmake 2.6.4 won't find boost 1.40 on windows

2009-09-17 Thread Cristian Adam

James C. Sutherland wrote:

 From FindBoost.cmake:

# These last three variables are available also as environment variables:
#
#   BOOST_ROOT or BOOSTROOT  The preferred installation prefix for 
searching for
#Boost.  Set this if the module has 
problems finding

#the proper Boost installation.

Did you try setting one of these variables?



Now I've tried setting BOOST_ROOT, but I don't see a big improvement
over BOOST_INCLUDEDIR :)

#set(BOOST_INCLUDEDIR "c:/boost/include/boost-1_40")
set(BOOST_ROOT "c:/boost/include/boost-1_40")

Cheers,
Cristian.
___
Powered by www.kitware.com

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

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

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


Re: [CMake] cmake 2.6.4 won't find boost 1.40 on windows

2009-09-17 Thread Cristian Adam

Michael Jackson wrote:

When you build boost use the --prefix=C:\boost_1_40 ... install

also you should specify toolset==msvc9.0 or the libraries will not be 
named correctly.




Hmm, I managed to compile a small program_options test program.
Program options libraries are named like:

boost_program_options-vc90-mt-1_40.dll
boost_program_options-vc90-mt-gd-1_40.dll
boost_program_options-vc90-mt.lib
boost_program_options-vc90-mt-1_40.lib
boost_program_options-vc90-mt-gd.lib
boost_program_options-vc90-mt-gd-1_40.lib
libboost_program_options-vc90-mt.lib
libboost_program_options-vc90-mt-1_40.lib
libboost_program_options-vc90-mt-gd.lib
libboost_program_options-vc90-mt-gd-1_40.lib
libboost_program_options-vc90-mt-s.lib
libboost_program_options-vc90-mt-s-1_40.lib
libboost_program_options-vc90-mt-sgd.lib
libboost_program_options-vc90-mt-sgd-1_40.lib
libboost_program_options-vc90-s.lib
libboost_program_options-vc90-s-1_40.lib
libboost_program_options-vc90-sgd.lib
libboost_program_options-vc90-sgd-1_40.lib

How should they be named correctly?

Cheers,
Cristian.


___
Powered by www.kitware.com

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

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

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



[CMake] cmake 2.6.4 won't find boost 1.40 on windows

2009-09-17 Thread Cristian Adam

Hi,

I have encountered problems with Boost 1.40 (build on Windows using
Visual Studio 2008 and MinGW GCC 4.4.0) with CMake 2.6.4.

Boost was compiled for Visual Studio 2008 like this:
bjam --build-dir=c:\temp\boost toolset=msvc --build-type=complete install
and for MinGW GCC like this:
bjam --build-dir=c:\temp\boost toolset=gcc --build-type=complete install

Adding set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0") didn't fix the
problem.

The problem is due to the fact that Boost 1.40 was installed to
c:\boost\include\boost-1_40\ and according to FindBoost.cmake module 
lines 292 to 300:


   FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
 # Add in a path suffix, based on the required version, ideally
 # we could read this from version.hpp, but for that to work we'd
 # need to know the include dir already
 if (WIN32 AND NOT CYGWIN)
   set(_boost_PATH_SUFFIX boost_${_boost_VER})
 else (WIN32 AND NOT CYGWIN)
   set(_boost_PATH_SUFFIX boost-${_boost_VER})
 endif (WIN32 AND NOT CYGWIN)

Boost should have been installed into c:\boost\include\boost_1_40\.

Was Boost before version 1.40 installed into "boost_1_3x" for Visual 
Studio and MinGW?

If so how should version 1.40 be detected for Visual Studio and MinGW?

I have tested two solutions to this problem:

1. rename c:\boost\include\boost-1_40\ to c:\boost\include\boost_1_40\
2. use set(BOOST_INCLUDEDIR "c:/boost/include/boost-1_40"

The following cmake change:
http://www.cmake.org/pipermail/cmake-commits/2009-August/006975.html
will remove the "set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0")" 
statement but it won't fix the

underscore problem for Visual Studio and MinGW Boost compilations!

Cheers,
Cristian.
___
Powered by www.kitware.com

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

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

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

Re: [CMake] InstallRequiredSystemLibraries with MSVC9 SP1

2008-12-07 Thread Cristian Adam

cyril_wobow wrote:
- adding the following preprocessor definitions to my project : 
_BIND_TO_CURRENT_MFC_VERSION=1 and _BIND_TO_CURRENT_CRT_VERSION=1, as I 
read about in forums, results in the embedded manifest depending on both 
RTM and SP1 CRTs, which doesn't help.

- there must be the same problem with MFC and ATL libs.


Hi,

In my experience using _BIND_TO_CURRENT_CRT_VERSION works correctly, the
embedded manifest depends only to version 9.0.30729.1. Just tested it
with a test program.

Another solution would be to call mt.exe (manifest tool) and 
replace/update the generated manifest with you own manifest file like this:


mt.exe -manifest my_manifest.manifest -outputresource:my.exe;#1

Cheers,
Cristian.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] FindBoost.cmake: please test

2008-01-20 Thread Cristian Adam



Also, where did you get those binary package from? Boost.org itself
doesn't have any binaries available as far as I can see?

Andreas

  

http://www.boost-consulting.com/products/free
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] submission: updated Modules/FindBoost.cmake

2007-05-18 Thread Cristian Adam

Mike Talbot wrote:
I have made some enhancements to FindBoost.cmake to try to add support 
for the boost libraries (attached).

Thanks, the enhancements are welcome, the script now looks like this:

   project(signal CXX)

   if (MINGW)
   set(Boost_LIB_SUFFIX mgw34-s-1_34)
   set(Boost_LIB_PREFIX lib)
   endif(MINGW)

   find_package(Boost)

   include_directories(${Boost_INCLUDE_DIRS})
   link_directories(${Boost_LIBRARY_DIRS})

   add_executable(signal signal.cpp)
   if (MINGW)
   target_link_libraries(signal ${Boost_signals_LIBRARIES})
   endif(MINGW)

And it works with VS8.0 and MinGW 3.4.2.

Please update your findboost.cmake with the changes the original poster 
made, by

adding boost-1.34 (and others) to SUFFIX_FOR_PATH.

Best regards,
Cristi.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] submission: updated Modules/FindBoost.cmake

2007-05-18 Thread Cristian Adam

Bob Kuehne wrote:
boost recently updated to 1.34, changing (of course) the default 
installation path. this breaks the FindBoost cmaker, so attached is an 
update that allows 1.34 as released to work.



Regarding FindBoost.cmake, I'm testing Boost 1.34.0 with MinGW gcc 3.4.2

MinGW doesn't have autolinking support, here is the CMakeLists.txt

   project(signal CXX)

   find_package(Boost)

   include_directories(${Boost_INCLUDE_DIRS})
   link_directories(${Boost_LIBRARY_DIRS})

   add_executable(signal signal.cpp)
   target_link_libraries(signal libboost_signals-mgw34-1_34.a)


I would like not to use libboost_signals_mgw34-1_34.a, but something 
like ${Boost_signals_LIB},

not caring about version and such.

Are there any plans to imporove FindBoost.cmake?

Best Regards,
Cristi.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] qt4 simple app

2006-05-17 Thread Cristian Adam

Hi all,

I'm trying to compile a simple Qt4 (4.1.1) application with Visual 
Studio 7 .NET 2003, but I get this error:

Linking...
MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol 
[EMAIL PROTECTED] referenced in function _WinMainCRTStartup


Here is my CMakeLists.txt file:

SET(QT_USE_QTMAIN TRUE)
INCLUDE (${CMAKE_ROOT}/Modules/FindQt4.cmake)

INCLUDE_DIRECTORIES(
${QT_INCLUDES}
)

LINK_DIRECTORIES(
${QT_LIBRARY_DIR}
)

IF(NOT QT_LIBRARIES)
SET(QT_LIBRARIES
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTMAIN_LIBRARY}
)   
ENDIF(NOT QT_LIBRARIES)

ADD_EXECUTABLE(main WIN32 main.cpp)
TARGET_LINK_LIBRARIES(main ${QT_LIBRARIES})

If I compile the same application with MinGW with Qt4 (4.1.2) everything 
compiles just fine.


Also if I set qtmain.lib instead ${QT_QTMAIN_LIBRARY} everyting compiles 
just fine, but I don't like this hack, also I think that setting 
QT_LIBRARIES by hand is a hack.


Somehow SET(QT_USE_QTMAIN TRUE) is ignored for Visual Studio 7 .NET 2003.

Any ideas?

Regards,
Cristi.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Digital Mars

2006-05-17 Thread Cristian Adam

William A. Hoffman wrote:

You could run cmake --debug-trycompile and it will leave the makefiles around,
and you can run make in CMakeFiles/CMakeTmp to see what the error really is.
Does Digital Mars have its own make?
  

Yes it has. "Digital Mars Make Version 5.05"

Cristi.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] mingw and cygwin is not detected for CXX

2006-04-17 Thread Cristian Adam




Hi all,

MINGW is not set for CXX projects, it works with C projects though.

Please add:

    IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
  SET(CMAKE_COMPILER_IS_MINGW 1)
    ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
    IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
  SET(CMAKE_COMPILER_IS_CYGWIN 1)
    ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )

in CMakeDetermineCXXCompiler.cmake just before   ENDIF(NOT
CMAKE_COMPILER_RETURN).

I hope this will be included in cmake 2.4 ;-)

Regards,
Cristi.



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] mingw windows applications

2006-04-17 Thread Cristian Adam




Hi all,

In order to build windows applications (not console) with MinGW you
need to set "-mwindows"
parameter for the compiler (http://www.mingw.org/docs.shtml).

Please add

SET(CMAKE_CREATE_WIN32_EXE  "-mwindows")

to Windows-gcc.cmake

I hope this will be included in cmake 2.4 ;-)

Best regards,
Cristi.




___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake