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] [EXTERNAL] Re: Linking to boost on OS X 10.12

2019-02-06 Thread Stephens, J. Adam via CMake
Hi Juan,

I believe BUILD_WITH_INSTALL_RPATH would place the correct RPATH in the 
executables. It’s a potentially easier alternative to using the BUILD_RPATH 
property for that purpose. However, I think it’s only half of what needs to 
happen. The linker still would be unable to find the boost libraries because 
their install names do not contain @rpath. Thanks for the suggestion.

--
J. Adam Stephens, Ph.D.
Dakota Support Analyst
https://dakota.sandia.gov/
Optimization and UQ
Sandia National Laboratories
Albuquerque, NM


From: Juan Sanchez 
Date: Tuesday, February 5, 2019 at 3:37 PM
To: "Stephens, J. Adam" 
Cc: "Maynard, Robert (External Contact)" , 
"cmake@cmake.org" 
Subject: Re: [CMake] [EXTERNAL] Re: Linking to boost on OS X 10.12

Hello,

Are you able to use BUILD_WITH_INSTALL_RPATH:
https://cmake.org/cmake/help/v3.13/prop_tgt/BUILD_WITH_INSTALL_RPATH.html
https://cmake.org/cmake/help/v3.13/prop_tgt/INSTALL_RPATH.html#prop_tgt:INSTALL_RPATH

Regards,

Juan


On Tue, Feb 5, 2019 at 4:00 PM Stephens, J. Adam via CMake 
mailto:cmake@cmake.org>> wrote:
Hi Robert,

Thanks for your reply. We do use install_name_tool and the like when 
installing/packaging, and our packages continue to work fine on OS X 10.12. My 
question is about what to do with executables before packaging, while they are 
still just in the build tree. We need them to work for purposes of testing via 
CTest.

Adam


On 2/5/19, 2:56 PM, "Robert Maynard" 
mailto:robert.mayn...@kitware.com>> wrote:

My general approach for the second problem is to run a tool such as
install_name_tool to change the library names to have @rpath when
constructing the package.

On Tue, Feb 5, 2019 at 2:25 PM Stephens, J. Adam via CMake
mailto:cmake@cmake.org>> wrote:
>
> Hello,
>
>
>
> The project I work on links to several shared boost libraries. After our 
organization disallowed use of OS X 10.11 and we upgraded our built/test slave 
to 10.12, we encountered a problem with our testing. Executables in the build 
tree that were built as part of our project now fail to run with the error that 
boost libraries can’t be found.
>
>
>
> Superficially, the problem is that (I think) Apple strengthened the SIP 
between 10.11 and 10.12 to prevent DYLD_LIBRARY_PATH from having any effect – 
previously the linker was able to locate the boost libs for our build tree 
executables that way.
>
>
>
> The deeper problem is twofold: First, the build tree executables don’t 
include the boost lib folder in their RPATHs. Second, the install names 
embedded in boost libs themselves are just the bare filenames with no @rpath. 
(My understanding is, the boost project does that deliberately because they 
can’t know what users of their libraries will want.)
>
>
>
> Recent versions of CMake (3.8+) have the property BUILD_RPATH that we 
could use to embed the path to the boost libs into the build tree executables. 
That doesn’t solve the second part of the problem, though. Without embedding 
install names that look like @rpath/libboost_foo.dylib in the build tree 
executables, I think the linker will still be unable to find them.
>
>
    >
> What is the best (or least bad) way to fix this?
>
>
>
> Thanks!
>
>
>
> Adam
>
>
>
> --
>
> J. Adam Stephens, Ph.D.
>
> Dakota Support Analyst
>
> https://dakota.sandia.gov/
>
> Optimization and UQ
>
> Sandia National Laboratories
>
> Albuquerque, NM
>
>
>
> --
>
> Powered by www.kitware.com<http://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<http://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: ht

Re: [CMake] [EXTERNAL] Re: Linking to boost on OS X 10.12

2019-02-06 Thread Stephens, J. Adam via CMake
Robert,

We unfortunately can't just modify the boost libraries where they are installed 
because our customers need to be able to build our project from source, and 
they would need to do the same thing. We could perhaps do something more 
radical like copy those libraries into the build tree and modify them, or build 
our own boost as part of our project.

Alternatively, we could use install_name_tool  to edit the build tree 
executables and change their dependencies from libboost_foo.dylib to 
@rpath/libboost_foo.dylib, just like we do for the executables we install. Can 
you think of a mechanism in CMake that would allow us to run install_name_tool 
on our executables as a final step in the build process?

Thanks again for your help.

Adam

--
J. Adam Stephens, Ph.D.
Dakota Support Analyst
https://dakota.sandia.gov/
Optimization and UQ
Sandia National Laboratories
Albuquerque, NM

 

On 2/5/19, 3:06 PM, "Robert Maynard"  wrote:

The version of the libraries that you load from your build directory
would need to be fixed up to.

On Tue, Feb 5, 2019 at 5:00 PM Stephens, J. Adam  wrote:
>
> Hi Robert,
>
> Thanks for your reply. We do use install_name_tool and the like when 
installing/packaging, and our packages continue to work fine on OS X 10.12. My 
question is about what to do with executables before packaging, while they are 
still just in the build tree. We need them to work for purposes of testing via 
CTest.
>
> Adam
>
>
> On 2/5/19, 2:56 PM, "Robert Maynard"  wrote:
>
> My general approach for the second problem is to run a tool such as
> install_name_tool to change the library names to have @rpath when
> constructing the package.
>
> On Tue, Feb 5, 2019 at 2:25 PM Stephens, J. Adam via CMake
>  wrote:
> >
> > Hello,
> >
> >
> >
> > The project I work on links to several shared boost libraries. 
After our organization disallowed use of OS X 10.11 and we upgraded our 
built/test slave to 10.12, we encountered a problem with our testing. 
Executables in the build tree that were built as part of our project now fail 
to run with the error that boost libraries can’t be found.
> >
> >
> >
> > Superficially, the problem is that (I think) Apple strengthened the 
SIP between 10.11 and 10.12 to prevent DYLD_LIBRARY_PATH from having any effect 
– previously the linker was able to locate the boost libs for our build tree 
executables that way.
> >
> >
> >
> > The deeper problem is twofold: First, the build tree executables 
don’t include the boost lib folder in their RPATHs. Second, the install names 
embedded in boost libs themselves are just the bare filenames with no @rpath. 
(My understanding is, the boost project does that deliberately because they 
can’t know what users of their libraries will want.)
> >
> >
> >
> > Recent versions of CMake (3.8+) have the property BUILD_RPATH that 
we could use to embed the path to the boost libs into the build tree 
executables. That doesn’t solve the second part of the problem, though. Without 
embedding install names that look like @rpath/libboost_foo.dylib in the build 
tree executables, I think the linker will still be unable to find them.
> >
    > >
> >
> > What is the best (or least bad) way to fix this?
> >
> >
> >
> > Thanks!
> >
> >
> >
> > Adam
> >
> >
> >
> > --
> >
> > J. Adam Stephens, Ph.D.
> >
> > Dakota Support Analyst
> >
> > https://dakota.sandia.gov/
> >
> > Optimization and UQ
> >
> > Sandia National Laboratories
> >
> > Albuquerque, NM
> >
> >
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Kitware offers various services to support the CMake community. For 
more information on each offering, please visit:
> >
> > CMake Support: http://cmake.org/cmake/help/support.html
> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
> > CMake Training Courses: http://cmake.org/cmake/help/training.html
> >
> > Visit

Re: [CMake] [EXTERNAL] Re: Linking to boost on OS X 10.12

2019-02-05 Thread Stephens, J. Adam via CMake
Hi Robert,

Thanks for your reply. We do use install_name_tool and the like when 
installing/packaging, and our packages continue to work fine on OS X 10.12. My 
question is about what to do with executables before packaging, while they are 
still just in the build tree. We need them to work for purposes of testing via 
CTest.

Adam
 

On 2/5/19, 2:56 PM, "Robert Maynard"  wrote:

My general approach for the second problem is to run a tool such as
install_name_tool to change the library names to have @rpath when
constructing the package.

On Tue, Feb 5, 2019 at 2:25 PM Stephens, J. Adam via CMake
 wrote:
>
> Hello,
>
>
>
> The project I work on links to several shared boost libraries. After our 
organization disallowed use of OS X 10.11 and we upgraded our built/test slave 
to 10.12, we encountered a problem with our testing. Executables in the build 
tree that were built as part of our project now fail to run with the error that 
boost libraries can’t be found.
>
>
>
> Superficially, the problem is that (I think) Apple strengthened the SIP 
between 10.11 and 10.12 to prevent DYLD_LIBRARY_PATH from having any effect – 
previously the linker was able to locate the boost libs for our build tree 
executables that way.
>
>
>
> The deeper problem is twofold: First, the build tree executables don’t 
include the boost lib folder in their RPATHs. Second, the install names 
embedded in boost libs themselves are just the bare filenames with no @rpath. 
(My understanding is, the boost project does that deliberately because they 
can’t know what users of their libraries will want.)
>
>
>
> Recent versions of CMake (3.8+) have the property BUILD_RPATH that we 
could use to embed the path to the boost libs into the build tree executables. 
That doesn’t solve the second part of the problem, though. Without embedding 
install names that look like @rpath/libboost_foo.dylib in the build tree 
executables, I think the linker will still be unable to find them.
>
>
>
> What is the best (or least bad) way to fix this?
>
>
>
> Thanks!
>
>
>
> Adam
>
>
>
> --
>
> J. Adam Stephens, Ph.D.
>
> Dakota Support Analyst
>
> https://dakota.sandia.gov/
>
> Optimization and UQ
>
> Sandia National Laboratories
>
> Albuquerque, NM
>
>
>
> --
>
> 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] Linking to boost on OS X 10.12

2019-02-05 Thread Stephens, J. Adam via CMake
Hello,

The project I work on links to several shared boost libraries. After our 
organization disallowed use of OS X 10.11 and we upgraded our built/test slave 
to 10.12, we encountered a problem with our testing. Executables in the build 
tree that were built as part of our project now fail to run with the error that 
boost libraries can’t be found.

Superficially, the problem is that (I think) Apple strengthened the SIP between 
10.11 and 10.12 to prevent DYLD_LIBRARY_PATH from having any effect – 
previously the linker was able to locate the boost libs for our build tree 
executables that way.

The deeper problem is twofold: First, the build tree executables don’t include 
the boost lib folder in their RPATHs. Second, the install names embedded in 
boost libs themselves are just the bare filenames with no @rpath. (My 
understanding is, the boost project does that deliberately because they can’t 
know what users of their libraries will want.)

Recent versions of CMake (3.8+) have the property BUILD_RPATH that we could use 
to embed the path to the boost libs into the build tree executables. That 
doesn’t solve the second part of the problem, though. Without embedding install 
names that look like @rpath/libboost_foo.dylib in the build tree executables, I 
think the linker will still be unable to find them.

What is the best (or least bad) way to fix this?

Thanks!

Adam

--
J. Adam Stephens, Ph.D.
Dakota Support Analyst
https://dakota.sandia.gov/
Optimization and UQ
Sandia National Laboratories
Albuquerque, NM

-- 

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


Re: [CMake] CTest extra tests

2018-03-20 Thread Adam Getchell


> On Mar 20, 2018, at 9:45 AM, Bill Hoffman  wrote:
> 
> Must be coming from some macro, cmake does not automatically add any tests.  
> You could run cmake --trace and look at the output and find out where the 
> add_test call is coming from.

Thanks, that was it!

The create_single_source_cgal_program() macro was the culprit.

Thanks for the pointer to cmake --trace


> 
> On Sun, Mar 18, 2018 at 5:39 PM, Adam Getchell  <mailto:adam.getch...@gmail.com>> wrote:
> Hello all,
> 
> I’m running into unexpected behavior when using CTest.
> 
> First, I define the list of tests that I want to run in my CMakeLists.txt:
> 
> https://github.com/acgetchell/CDT-plusplus/blob/develop/CMakeLists.txt#L151 
> <https://github.com/acgetchell/CDT-plusplus/blob/develop/CMakeLists.txt#L151>
> 
> However, it generates two extra tests:
> 
> ┌─[adam][hapkido][±][develop {1} ✓][~/CDT-plusplus/build]
> └─▪ ctest -N
> Test project /Users/adam/CDT-plusplus/build
>   Test  #1: cdt-gv
>   Test  #2: build_target_cdt-gv
>   Test  #3: CDT-Usage
>   Test  #4: CDT-3Donly
>   Test  #5: CDT-Simplices
>   Test  #6: CDT-Timeslices
>   Test  #7: CDT-3Dtriangle
>   Test  #8: CDT-MinimalS3
>   Test  #9: CDT-S3Runs
>   Test #10: CDT-unit-tests
> 
> Total Tests: 10
> 
> I’d like to get rid of these first two autogenerated tests, because #1 fails. 
> Where/how are these being generated/defined?
> 
> I’m aware that I can just filter using ctest -E, but I’d like to make it easy 
> for the other contributors (and my CI) by making `ctest` just work.
> 
> Thanks for any pointers.
> 
> Cheers,
> Adam
> -- 
> Adam Getchell
> https://keybase.io/adamgetchell <https://keybase.io/adamgetchell>
> 
> --
> 
> Powered by www.kitware.com <http://www.kitware.com/>
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ <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 
> <http://cmake.org/cmake/help/support.html>
> CMake Consulting: http://cmake.org/cmake/help/consulting.html 
> <http://cmake.org/cmake/help/consulting.html>
> CMake Training Courses: http://cmake.org/cmake/help/training.html 
> <http://cmake.org/cmake/help/training.html>
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html 
> <http://www.kitware.com/opensource/opensource.html>
> 
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake 
> <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] CTest extra tests

2018-03-18 Thread Adam Getchell
Hello all,

I’m running into unexpected behavior when using CTest.

First, I define the list of tests that I want to run in my CMakeLists.txt:

https://github.com/acgetchell/CDT-plusplus/blob/develop/CMakeLists.txt#L151 
<https://github.com/acgetchell/CDT-plusplus/blob/develop/CMakeLists.txt#L151>

However, it generates two extra tests:

┌─[adam][hapkido][±][develop {1} ✓][~/CDT-plusplus/build]
└─▪ ctest -N
Test project /Users/adam/CDT-plusplus/build
  Test  #1: cdt-gv
  Test  #2: build_target_cdt-gv
  Test  #3: CDT-Usage
  Test  #4: CDT-3Donly
  Test  #5: CDT-Simplices
  Test  #6: CDT-Timeslices
  Test  #7: CDT-3Dtriangle
  Test  #8: CDT-MinimalS3
  Test  #9: CDT-S3Runs
  Test #10: CDT-unit-tests

Total Tests: 10

I’d like to get rid of these first two autogenerated tests, because #1 fails. 
Where/how are these being generated/defined?

I’m aware that I can just filter using ctest -E, but I’d like to make it easy 
for the other contributors (and my CI) by making `ctest` just work.

Thanks for any pointers.

Cheers,
Adam
-- 
Adam Getchell
https://keybase.io/adamgetchell

-- 

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


Re: [CMake] Ignore installation failure

2018-02-20 Thread David Adam
On Sun, 18 Feb 2018, David Adam wrote:
> Our project installs an empty directory for other programs to drop files 
> in, the location of which is overrideable with a cache variable. Some 
> environments set the location of this directory outside the writeable 
> area and create it themselves, so I'd like to set up CMake so that it 
> tries to create the directory but skips over it if there is a failure.
> 
> At the moment we use:
> 
> SET(extra_completionsdir
> ${rel_datadir}/fish/vendor_completions.d
> CACHE STRING "Path for extra completions")
> INSTALL(DIRECTORY DESTINATION ${extra_completionsdir})
> 
> but that fails if the destination is not writeable.
> 
> Is there an idiomatic way of ignoring a failed installation step? At the 
> moment, I'm trying various install(script code execute_process(... 
> incantations, but I'm aware there's lots of corner cases with DESTDIR and 
> so on.

For the record, I ended up implementing just enough to make our use case 
work:

FUNCTION(FISH_TRY_CREATE_DIRS)
  FOREACH(dir ${ARGV})
IF(NOT IS_ABSOLUTE ${dir})
  SET(abs_dir "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${dir}")
ELSE()
  SET(abs_dir "\$ENV{DESTDIR}${dir}")
ENDIF()
INSTALL(SCRIPT CODE "EXECUTE_PROCESS(COMMAND mkdir -p ${abs_dir} 
OUTPUT_QUIET ERROR_QUIET)
 EXECUTE_PROCESS(COMMAND chmod 755 ${abs_dir} 
OUTPUT_QUIET ERROR_QUIET)
")
  ENDFOREACH()
ENDFUNCTION(FISH_TRY_CREATE_DIRS)

Perhaps that will help someone in a similar situation in the future.

David Adam
zanc...@ucc.gu.uwa.edu.au

-- 

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] Ignore installation failure

2018-02-17 Thread David Adam
Hi there,

Our project installs an empty directory for other programs to drop files 
in, the location of which is overrideable with a cache variable. Some 
environments set the location of this directory outside the writeable 
area and create it themselves, so I'd like to set up CMake so that it 
tries to create the directory but skips over it if there is a failure.

At the moment we use:

SET(extra_completionsdir
${rel_datadir}/fish/vendor_completions.d
CACHE STRING "Path for extra completions")
INSTALL(DIRECTORY DESTINATION ${extra_completionsdir})

but that fails if the destination is not writeable.

Is there an idiomatic way of ignoring a failed installation step? At the 
moment, I'm trying various install(script code execute_process(... 
incantations, but I'm aware there's lots of corner cases with DESTDIR and 
so on.

Thanks

David Adam
zanc...@ucc.gu.uwa.edu.au
-- 

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 install

2017-09-12 Thread Adam Getchell
Thanks for the catch, sudo cmake --build . --target install &> install.log 
worked.

Yes, I plan to use a package manager like Conan or conda rather than the 
horrible tangle of scripts I have now for Travis and Appveyor, just have a few 
other things to do first. ;-)

-- 
Adam Getchell
https://keybase.io/adamgetchell

> On Sep 10, 2017, at 5:42 AM, Michael Jackson  
> wrote:
> 
> You should explicitly set the installation location of your package using 
> –DCMAKE_INSTALL_PREFIX=/xxx///xxx during the initial invocation of 
> cmake.
>  
> This should be set to a location you KNOW you have normal write access to. 
> Once this is set then you will no longer need to use “sudo” to run the 
> commands and all _should_ work correctly. This is what we do on our dashboard 
> builds.
>  
> -- 
> Mike Jackson  
>  
>  
> From: CMake  on behalf of Adam Getchell 
> 
> Date: Friday, September 8, 2017 at 9:20 PM
> To: Craig Scott 
> Cc: CMake 
> Subject: Re: [CMake] cmake install
>  
>  
>> On Sep 8, 2017, at 6:11 PM, Craig Scott > <mailto:craig.sc...@crascit.com>> wrote:
>>>  
>>> I tried:
>>>  
>>> # cmake -G Ninja .
>>> # cmake --build .
>>> # cmake --build . --target install
>>  
>> This should be correct. Did this not work for you?
>  
> No.
>  
> https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700 
> <https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700>
>  
> Thanks for your help.
>  
>>  
>>  
>>> If its somewhere in the manual, I’d appreciate pointers.
>>  
>> Which part were you looking for? The use of --target is documented as part 
>> of the Build Tool Mode 
>> <https://cmake.org/cmake/help/git-master/manual/cmake.1.html#build-tool-mode>
>>  section, but it seems you've already figured out that part. There's nothing 
>> technically special about the install target as far as I'm aware, you should 
>> be able to refer to it as a build target like you've done above.
>>  
>>  
>> Craig Scott
>> Melbourne, Australia
>> https://crascit.com <https://crascit.com/> 
> -- 
> Adam Getchell
> https://keybase.io/adamgetchell <https://keybase.io/adamgetchell>
> 
> -- Powered by www.kitware.com <http://www.kitware.com/> Please keep messages 
> on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ 
> <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 
> <http://cmake.org/cmake/help/support.html> CMake Consulting: 
> http://cmake.org/cmake/help/consulting.html 
> <http://cmake.org/cmake/help/consulting.html> CMake Training Courses: 
> http://cmake.org/cmake/help/training.html 
> <http://cmake.org/cmake/help/training.html> Visit other Kitware open-source 
> projects at http://www.kitware.com/opensource/opensource.html 
> <http://www.kitware.com/opensource/opensource.html> Follow this link to 
> subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake 
> <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] cmake install

2017-09-08 Thread Adam Getchell

> On Sep 8, 2017, at 6:11 PM, Craig Scott  wrote:
> 
> I tried:
> 
> # cmake -G Ninja .
> # cmake --build .
> # cmake --build . --target install
> 
> This should be correct. Did this not work for you?

No.

https://travis-ci.org/acgetchell/CDT-plusplus/jobs/273498700

Thanks for your help.

>  
> 
> If its somewhere in the manual, I’d appreciate pointers.
> 
> Which part were you looking for? The use of --target is documented as part of 
> the Build Tool Mode 
> <https://cmake.org/cmake/help/git-master/manual/cmake.1.html#build-tool-mode> 
> section, but it seems you've already figured out that part. There's nothing 
> technically special about the install target as far as I'm aware, you should 
> be able to refer to it as a build target like you've done above.
>  
> 
> Craig Scott
> Melbourne, Australia
> https://crascit.com <https://crascit.com/>
-- 
Adam Getchell
https://keybase.io/adamgetchell

-- 

Powered by www.kitware.com

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

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

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

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

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

[CMake] cmake install

2017-09-08 Thread Adam Getchell
Hello all,

If I want to use CMake to invoke my build system, I can use:

# cmake -- build .

What’s the syntax for invoking the build system installer from cmake, i.e. the 
equivalent of:

# cmake -G Ninja .
# ninja
# ninja install

I tried:

# cmake -G Ninja .
# cmake --build .
# cmake --build . --target install

If its somewhere in the manual, I’d appreciate pointers.

Thanks,
Adam
-- 
Adam Getchell
https://keybase.io/adamgetchell

-- 

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] CMake 3.9.0 Windows zip file shows wrong version

2017-08-08 Thread Adam Getchell
Yeah, that was it, lol.

-- 
Adam Getchell
https://keybase.io/adamgetchell

> On Aug 8, 2017, at 1:33 AM, David Cole  wrote:
> 
> I suspect you are running a different cmake, not the one you've unzipped.
> 
> Type "where cmake" instead of "cmake --version" and Windows will list
> the directories where it finds an executable named cmake. The first
> one it lists is the one it is running when you type "cmake
> --version"...
> 
> If you want to force the one you've downloaded to run instead of that
> one, you could **prepend** to the PATH instead of appending to it.
> 
> 
> HTH,
> David C.
> 
> 
> 
> On Mon, Aug 7, 2017 at 9:07 PM, Adam Getchell  wrote:
>> Hi all,
>> 
>> The CMake 3.9.0 Windows zip file gives the wrong version. Here’s a snippet
>> from my AppVeyor logs [1]:
>> 
>> set CMAKE_URL="https://cmake.org/files/v3.9/cmake-3.9.0-win64-x64.zip";
>> appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
>> Downloading cmake.zip (25,944,520 bytes)...100%
>> 7z x cmake.zip -oC:\projects\dev
>> 7-Zip [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04
>> Scanning the drive for archives:
>> 1 file, 25944520 bytes (25 MiB)
>> Extracting archive: cmake.zip
>> --
>> Path = cmake.zip
>> Type = zip
>> Physical Size = 25944520
>> Everything is Ok
>> Folders: 90
>> Files: 4922
>> Size: 66584952
>> Compressed: 25944520
>> set PATH=%PATH%;C:\projects\dev\cmake\bin
>> cmake --version
>> cmake version 3.8.2
>> CMake suite maintained and supported by Kitware (kitware.com/cmake).
>> 
>> [1] https://ci.appveyor.com/project/acgetchell/cdt-plusplus
>> --
>> Adam Getchell
>> https://keybase.io/adamgetchell
>> 
>> 
>> --
>> 
>> 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

[CMake] CMake 3.9.0 Windows zip file shows wrong version

2017-08-07 Thread Adam Getchell
Hi all,

The CMake 3.9.0 Windows zip file gives the wrong version. Here’s a snippet from 
my AppVeyor logs [1]:

set CMAKE_URL="https://cmake.org/files/v3.9/cmake-3.9.0-win64-x64.zip";
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L15>appveyor
 DownloadFile %CMAKE_URL% -FileName cmake.zip
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L16>Downloading
 cmake.zip (25,944,520 bytes)...100%
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L17>7z 
x cmake.zip -oC:\projects\dev
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L18>
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L19>7-Zip
 [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L20>
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L21>Scanning
 the drive for archives:
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L22>1 
file, 25944520 bytes (25 MiB)
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L23>
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L24>Extracting
 archive: cmake.zip
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L25>--
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L26>Path 
= cmake.zip
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L27>Type 
= zip
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L28>Physical
 Size = 25944520
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L29>
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L30>Everything
 is Ok
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L31>
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L32>Folders:
 90
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L33>Files:
 4922
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L34>Size:
   66584952
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L35>Compressed:
 25944520
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L36>set 
PATH=%PATH%;C:\projects\dev\cmake\bin
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L37>cmake
 --version
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L38>cmake
 version 3.8.2
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L39>
 
<https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L40>CMake
 suite maintained and supported by Kitware (kitware.com/cmake).
 <https://ci.appveyor.com/project/acgetchell/cdt-plusplus/build/1.0.108#L41>

[1] https://ci.appveyor.com/project/acgetchell/cdt-plusplus
-- 
Adam Getchell
https://keybase.io/adamgetchell

-- 

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

[CMake] Embedding Python in macOS bundle

2017-03-18 Thread Adam Wolf
Hi folks!

I work on a relatively large cross-platform project which uses CMake.
Currently, the macOS version uses the system Python.

I'm working on embedding a Python inside the bundle.  I compiled
Python with --enable-framework, stored it in my home directory and
aimed CMake at it.  I added a few directories to the dirs parameter of
fixup_bundle, but fixup_bundle doesn't seem to be pulling it in.







-- Analyzing 
app='/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/kicad'

-- bundle='/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app'

-- 
executable='/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/kicad'

-- valid='1'

-- executable file 1:
/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/dxf2idf

-- executable file 2:
/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/idf2vrml

-- executable file 3:
/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/idfcyl

-- executable file 4:
/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/idfrect

-- executable file 5:
/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/kicad

-- executable file 6:
/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

-- verified='0'

-- info='external prerequisites found:

f='/Users/wolf/wnl/kicad/kicadmacbuilder/silly/bin/kicad.app/Contents/MacOS/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python'

external_prereqs='/Users/wolf/wnl/kicad/kicadmacbuilder/silly/python-build//Python.framework/Versions/2.7/Python'

'

--

CMake Error at 
/usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/BundleUtilities.cmake:1053
(message):

 error: verify_app failed

Call Stack (most recent call first):

 /usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/BundleUtilities.cmake:912
(verify_app)

 kicad/cmake_install.cmake:91 (fixup_bundle)

 cmake_install.cmake:69 (include)


I tried setting BU_COPY_FULL_FRAMEWORK_CONTENTS, mostly for giggles,
and I had similar issues.

Anyone have any thoughts or suggestions?  Am I barking up the wrong
tree with --enable-framework?  Anyone have any examples or projects
that have pulled in Python using CMake and fixup_bundle?

Thanks!

Adam Wolf
-- 

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] [Visual Studio] Universal Windows Platform projects

2016-07-06 Thread Adam Rankin
Hello all,

I've been trying to identify the correct variables to set to create a UWP 
project using VS2015, and the projects generated are missing a few critical 
tags.

I'm using CMAKE_SYSTEM_NAME=WindowsStore and CMAKE_SYSTEM_VERSION=10.0. This 
correctly identifies and sets the target platform tag, but does not set the 
following 'Globals' Properties in the PropertyGroup of the .vcxproj file

true
Windows Store
10.0.10240.0
10.0

Has anyone successfully created a UWP project using CMake?

Regards,
Adam
-- 

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] [Visual Studio] Is it possible to specify a different target architecture?

2016-06-28 Thread Adam Rankin
Well now don’t I feel silly…

Thanks!

Adam

From: Benjamin Ballet [mailto:bbal...@ivsweb.com]
Sent: Tuesday, June 28, 2016 9:59 AM
To: Adam Rankin 
Cc: cmake@cmake.org
Subject: Re: [CMake] [Visual Studio] Is it possible to specify a different 
target architecture?

Hi

Look at the 
CMAKE_VS_PLATFORM_TOOLSET<https://cmake.org/cmake/help/v3.0/variable/CMAKE_VS_PLATFORM_TOOLSET.html>
 variable

2016-06-28 15:51 GMT+02:00 Adam Rankin 
mailto:aran...@robarts.ca>>:
Hello all,

I am wondering if there exist CMake commands/variables to specify for Visual 
Studio to have the project file(s) generated target a different architecture 
than the one associated with that version of Visual Studio.

For example, I develop in VS2015, but would like to target the VS2012 
redistributable (v110).

Is this possible?

Kind regards,
Adam

--

Powered by www.kitware.com<http://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



--
Benjamin BALLET
Ingénieur R&D

ACTIVISU
19, rue Klock - 92110 Clichy
> Standard Tél :  01 44 69 37 37
> www.activisu.com<http://www.activisu.com/>
-- 

Powered by www.kitware.com

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

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

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

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

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

[CMake] [Visual Studio] Is it possible to specify a different target architecture?

2016-06-28 Thread Adam Rankin
Hello all,

I am wondering if there exist CMake commands/variables to specify for Visual 
Studio to have the project file(s) generated target a different architecture 
than the one associated with that version of Visual Studio.

For example, I develop in VS2015, but would like to target the VS2012 
redistributable (v110).

Is this possible?

Kind regards,
Adam
-- 

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] execute_process, cmd /c and vcvarsall

2016-06-10 Thread Adam Rankin
Thank you Kristian, I will keep experimenting.

David, I agree, and in my own project I have done it that way.

However, I am attempting to fix the CUDA auto detection in OpenCV, and I am not 
sure if they would take kindly to adding .bat files for Windows only solutions 
(maybe they will, I haven't discussed it yet).

I was hoping to solve the problem within a CMake one-liner to reduce the 
complexity of the change.

Thanks for your suggestions,

Adam

-Original Message-
From: David Cole [mailto:dlrd...@aol.com] 
Sent: Friday, June 10, 2016 7:48 AM
To: Kristian 
Cc: Adam Rankin ; cmake@cmake.org
Subject: Re: [CMake] execute_process, cmd /c and vcvarsall

The easiest way to do what you want here is to make a standalone script (*.bat 
/ *.cmd) that runs the commands you want and get it to work without CMake 
involvement at all, and then simply use execute_process to invoke that script.

You can pass arguments to it if you need to communicate information from CMake 
to the script, but if you **require** environment for your command to run, the 
easiest way to achieve it is to write a script that sets up the env, and then 
executes the command, and then restores the environment (if necessary).

In Windows *.cmd files, it's easy to save/restore the environment by using 
"setlocal" and "endlocal".

Why bother with all the escaping and special characters in an execute_process 
when you could just write a script and then call it?
It will be much easier on the eyes for people having to read your code in the 
future if you make it simpler.


HTH,
David C.




On Fri, Jun 10, 2016 at 6:21 AM, Kristian  wrote:
> After some tries I found maybe a solution for you. In my small 
> example, I had these lines, which are working:
>
>
>> set(HELLO1 "C:/Program Files (x86)/Microsoft Visual Studio
>> 14.0/VC/vcvarsall.bat")
>> execute_process(COMMAND ${HELLO1} && msbuild /help WORKING_DIRECTORY
>> "${CMAKE_CURRENT_SOURCE_DIR}")
>
> So for you, it would look like this (I am not very sure about it):
>
> ==
>
>
> execute_process( COMMAND
> $ENV{VS${VS_IDE_VERSION}0COMNTOOLS}../../VC/vcvarsall.bat x86_amd64 && 
> ${CUDA_NVCC_EXECUTABLE} 
> ${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu --run
>
>  WORKING_DIRECTORY
> "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
>
>  RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
>
>  OUTPUT_STRIP_TRAILING_WHITESPACE)
>
>
> ==
>
> Anyhow, when I tried several types of your presentation, I got always 
> some errors. I do not know, if this is a bug or not, but I will write 
> them down here. Maybe some of the others could write something about it.
>
>
> *** First try ***
>
>> set(HELLO1 "C:/Program Files (x86)/Microsoft Visual Studio
>> 14.0/VC/vcvarsall.bat")
>> execute_process(COMMAND cmd /c "call ${HELLO1}" WORKING_DIRECTORY 
>> "${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE _nvcc_res 
>> OUTPUT_VARIABLE
>> _nvcc_out)
>> message("${_nvcc_out}")
>
> When I call these lines on a windows machine, I am getting the error
>
>> 'C:/Program' is not recognized as an internal or external command, 
>> operable program or batch file.
>
> *** Second try ***
>
> When I change the execute_process to this
>
>> execute_process(COMMAND cmd /c "call \"${HELLO1}\"" WORKING_DIRECTORY 
>> "${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE _nvcc_res 
>> OUTPUT_VARIABLE
>> _nvcc_out)
>
> then I am getting this error
>
>> '\"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat\"'
>> is not recognized as an internal or external command, operable 
>> program or batch file.
>
> So now, CMake / Batch recognizes the right path, but somehow there are 
> the characters \".
>
> *** Third try ***
>
> I changed the definition of the variable HELLO1 into (because of some 
> hints here
> https://superuser.com/questions/279008/how-do-i-escape-spaces-in-comma
> nd-line-in-windows-without-using-quotation-marks)
>
>> set(HELLO1 "C:/Program^ Files^ (x86)/Microsoft^ Visual^ Studio^
>> 14.0/VC/vcvarsall.bat")
>
> But here, I am also getting the error
>
>> 'C:/Program' is not recognized as an internal or external command, 
>> operable program or batch file.
>
> Even, when I double the carets ^^, then the same error occurs
>
>
> 2016-06-09 22:41 GMT+02:00 Adam Rankin :
>>
>> Hello all,
>>
>>
>>
>> I am trying to develop a execute_process command that will first load 
>>

[CMake] execute_process, cmd /c and vcvarsall

2016-06-09 Thread Adam Rankin
Hello all,

I am trying to develop a execute_process command that will first load the env 
variables set by the appropriate vcvarsall, and then run a compile command. See 
here for my progress so far:

set(cuda_generation_command cmd /c "\"call 
\"$ENV{VS${VS_IDE_VERSION}0COMNTOOLS}../../VC/vcvarsall.bat\" x86_amd64 && 
\"${CUDA_NVCC_EXECUTABLE}\" 
\"${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu\" \"--run\"\"")

execute_process( COMMAND ${cuda_generation_command}
 WORKING_DIRECTORY 
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
 RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
 OUTPUT_STRIP_TRAILING_WHITESPACE)

When run at a command prompt, the command works as expected. When called from 
CMake, the output is:
The filename, directory name, or volume label syntax is incorrect.

Has anyone ever succeeded with something like this?

Cheers,
Adam
-- 

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

2016-02-03 Thread Adam Rankin
Ok, that makes sense to me. What I’m seeing though, is that find modules and 
xyzConfig files for some software packages do not make a variable available 
that contains just target names. Xyz_LIBRARIES contains full path file 
locations.

This is my immediate frustration with leptonica for example. The config file it 
creates does not output a list of targets, and even if it did, it doesn’t 
dynamically build the list of targets depending on what dependencies it finds 
(libpng, libjpeg, etc…)

I think I will fork and rewrite the leptonica cmake file to properly expose 
target names.

Thanks,
Adam

From: Craig Scott [mailto:audiofana...@gmail.com]
Sent: Wednesday, February 03, 2016 4:26 PM
To: Adam Rankin 
Cc: cmake@cmake.org
Subject: Re: [CMake] xyz_LIBRARIES



On 4 February 2016 at 04:45, Adam Rankin 
mailto:aran...@robarts.ca>> wrote:
Hello all,

I am trying to sort out a project with multiple layers of dependencies and I am 
trying to figure out the “right” way of configuring things.

First easy question: Should a value xyz_LIBRARIES contain target names, or 
library file locations?

Preferably target names, assuming you mean imported targets (see answer to next 
question).


 Second question: Should a FindXYZ.cmake file add imported targets, or should a 
USE_xyz variable be created for later inclusion? (what if the project does not 
export its targets?)

Imported targets will be better for end users/developers. An imported target 
can provide not just the library file location, it can also provide other 
dependencies such as dependent libraries that also must be linked, header 
search paths, etc. Furthermore, with an imported target you can explicitly 
control what other targets are affected by these dependencies simply by linking 
against your imported target. If you chose the USE_xyz variable + include 
approach, then the include file will typically end up calling  
link_libraries(), link_directories() and/or include_directories() commands and 
making those things apply to all targets defined thereafter, which used to be 
the norm but is no longer necessary with all the target_xxx() commands added in 
more recent versions of CMake (well, 2.8.11 or later).


 Third question: How’s your day going today?

Ask me again after the coffee kicks in. :P


--
Craig Scott
Melbourne, Australia
http://crascit.com
-- 

Powered by www.kitware.com

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

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

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

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

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

[CMake] xyz_LIBRARIES

2016-02-03 Thread Adam Rankin
Hello all,

I am trying to sort out a project with multiple layers of dependencies and I am 
trying to figure out the "right" way of configuring things.

First easy question: Should a value xyz_LIBRARIES contain target names, or 
library file locations?

Second question: Should a FindXYZ.cmake file add imported targets, or should a 
USE_xyz variable be created for later inclusion? (what if the project does not 
export its targets?)

Third question: How's your day going today?

Cheers,
Adam
-- 

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] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Adam Rankin
To elaborate on my reply:

I do indeed interact with the repository after it's cloned (as per my previous 
email).

With regards to implementation, I have implemented it such that the git remote 
name is only involved if git is chosen as the source of choice, in much the 
same manner as the git_tag implementation. My implementation makes the git 
remote name completely optional and defaults to "origin".

Regards,
Adam

-Original Message-
From: Nicholas Braden [mailto:nicholas11bra...@gmail.com] 
Sent: Friday, January 15, 2016 12:02 PM
To: Adam Rankin 
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add support for git clone -o option

Why would you like to have names other than origin? I am struggling to think of 
a use case for this, seeing as you never directly interact with the cloned 
repository. I don't even think it's safe to assume that a git repository is 
involved at all, for all you know it could be changed to just download the code 
and never even involve git. (Maybe it is guaranteed somewhere but I don't see 
such a guarantee in the
documentation)

On Fri, Jan 15, 2016 at 10:03 AM, Adam Rankin  wrote:
> Hello all,
>
>
>
> I am reading through the ExternalProject source for 3.2 at the moment 
> (if updating to 3.4 is the answer, great!) and trying to determine if 
> there is support for the –o option when using a git repository.
>
>
>
> Has anyone accomplished this? I would like to have names other than “origin”
>
>
>
> Cheers,
>
> Adam
>
>
> --
>
> 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] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Adam Rankin
My use case is for forked repositories and sending pull requests upstream. In 
this case "origin" is ambiguous as manage both remotes and I would like to give 
the cloned repository a more accurate name.

Cheers,
Adam

-Original Message-
From: Nicholas Braden [mailto:nicholas11bra...@gmail.com] 
Sent: Friday, January 15, 2016 12:02 PM
To: Adam Rankin 
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add support for git clone -o option

Why would you like to have names other than origin? I am struggling to think of 
a use case for this, seeing as you never directly interact with the cloned 
repository. I don't even think it's safe to assume that a git repository is 
involved at all, for all you know it could be changed to just download the code 
and never even involve git. (Maybe it is guaranteed somewhere but I don't see 
such a guarantee in the
documentation)

On Fri, Jan 15, 2016 at 10:03 AM, Adam Rankin  wrote:
> Hello all,
>
>
>
> I am reading through the ExternalProject source for 3.2 at the moment 
> (if updating to 3.4 is the answer, great!) and trying to determine if 
> there is support for the –o option when using a git repository.
>
>
>
> Has anyone accomplished this? I would like to have names other than “origin”
>
>
>
> Cheers,
>
> Adam
>
>
> --
>
> 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

[CMake] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Adam Rankin
Hello all,

I am reading through the ExternalProject source for 3.2 at the moment (if 
updating to 3.4 is the answer, great!) and trying to determine if there is 
support for the -o option when using a git repository.

Has anyone accomplished this? I would like to have names other than "origin"

Cheers,
Adam
-- 

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] nonstandard C++ source filename extension

2015-03-17 Thread Adam
Hi Dave,

try
   add_definitions("-x c++")

CMakeLists.txt
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(asm CXX)
add_definitions("-x c++")
set_source_files_properties(foo.bar PROPERTIES LANGUAGE CXX)
add_executable(foo foo.bar)
set_target_properties(foo PROPERTIES LINKER_LANGUAGE CXX)

Adam


On Tue, Mar 17, 2015 at 2:10 PM, Dave Yost  wrote:

> From what I can glean online, I’ve tried this:
>
> set_source_files_properties(foo.bar  PROPERTIES  LANGUAGE  CXX)
> add_executable(foo  foo.bar)
> set_target_properties(foo  PROPERTIES  LINKER_LANGUAGE  CXX)
>
>
> but it doesn’t work.
> What am I missing?
>
> 0 Mon 20:16:15 yost
> 1181 Z% cat CMakeLists.txt
> cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
> project(asm CXX)
>
> set_source_files_properties(foo.bar PROPERTIES LANGUAGE CXX)
> add_executable(foo foo.bar)
> set_target_properties(foo PROPERTIES LINKER_LANGUAGE CXX)
> 0 Mon 20:16:43 yost
> 1182 Z% cat foo.bar
> #include 
>
> int main(int argc, char* argv[]) {
>   std::cout << "Hello\"\n";
>   return 0;
> }
> 0 Mon 20:16:46 yost
> 1183 Z% cd build ; cmake ..
> -- The CXX compiler identification is GNU 4.9.2
> -- Checking whether CXX compiler has -isysroot
> -- Checking whether CXX compiler has -isysroot - yes
> -- Checking whether CXX compiler supports OSX deployment target flag
> -- Checking whether CXX compiler supports OSX deployment target flag - yes
> -- Check for working CXX compiler: /opt/local/bin/c++
> -- Check for working CXX compiler: /opt/local/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /Users/yost/p/c++/cmake/asm/build
> 0 Mon 20:16:58 yost
> 1184 Z% make
> Scanning dependencies of target foo
> [100%] Building CXX object CMakeFiles/foo.dir/foo.bar.o
> c++: warning: /Users/yost/p/c++/cmake/asm/foo.bar: linker input file
> unused because linking not done
> Linking CXX executable foo
> c++: error: CMakeFiles/foo.dir/foo.bar.o: No such file or directory
> CMakeFiles/foo.dir/build.make:85: recipe for target 'foo' failed
> make[2]: *** [foo] Error 1
> CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/foo.dir/all' failed
> make[1]: *** [CMakeFiles/foo.dir/all] Error 2
> Makefile:75: recipe for target 'all' failed
> make: *** [all] Error 2
> 2 Mon 20:17:01 yost
> 1185 Z% rm -rf * ; cmake ..
> zsh: sure you want to delete all the files in
> /Users/yost/p/c++/cmake/asm/build [yn]? y
> -- The CXX compiler identification is GNU 4.9.2
> -- Checking whether CXX compiler has -isysroot
> -- Checking whether CXX compiler has -isysroot - yes
> -- Checking whether CXX compiler supports OSX deployment target flag
> -- Checking whether CXX compiler supports OSX deployment target flag - yes
> -- Check for working CXX compiler: /opt/local/bin/c++
> -- Check for working CXX compiler: /opt/local/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /Users/yost/p/c++/cmake/asm/build
> 0 Mon 20:23:00 yost
> 1201 Z% make VERBOSE=1
> /Applications/CMake.app/Contents/bin/cmake -H/Users/yost/p/c++/cmake/asm
> -B/Users/yost/p/c++/cmake/asm/build --check-build-system
> CMakeFiles/Makefile.cmake 0
> /Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start
> /Users/yost/p/c++/cmake/asm/build/CMakeFiles
> /Users/yost/p/c++/cmake/asm/build/CMakeFiles/progress.marks
> make -f CMakeFiles/Makefile2 all
> make[1]: Entering directory '/Users/yost/p/c++/cmake/asm/build'
> make -f CMakeFiles/foo.dir/build.make CMakeFiles/foo.dir/depend
> make[2]: Entering directory '/Users/yost/p/c++/cmake/asm/build'
> cd /Users/yost/p/c++/cmake/asm/build &&
> /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix
> Makefiles" /Users/yost/p/c++/cmake/asm /Users/yost/p/c++/cmake/asm
> /Users/yost/p/c++/cmake/asm/build /Users/yost/p/c++/cmake/asm/build
> /Users/yost/p/c++/cmake/asm/build/CMakeFiles/foo.dir/DependInfo.cmake
> --color=
> Dependee
> "/Users/yost/p/c++/cmake/asm/build/CMakeFiles/foo.dir/DependInfo.cmake" is
> newer than depender
> "/Users/yost/p/c++/cmake/asm/build/CMakeFiles/foo.dir/depend.internal".
> Dependee
> "/Users/yost/p/c++/cmake/asm/build/CMakeFiles/CMakeDirectoryInformation.cmake"
> is newer than depender
> "/Users/yost/p/c++/cmake/asm

Re: [CMake] Full paths for transitive dependencies

2015-03-17 Thread Adam
I happened to stumble acrosss this today.  I fixed it by adding another
find_package to the last project but this seems to defeat the purpose of
transitive dependencies.  What am I doing wrong?

Here's a more detailed example
(https://github.com/toomuchatonce/cmake_transient_issue.git)

---
app - CMakeLists.txt
cmake_minimum_required(VERSION 3.0.2)
add_executable(app main.cpp)
# uncomment to fix link error
#find_package( a NO_MODULE REQUIRED )
find_package( b NO_MODULE REQUIRED )
target_link_libraries(app b)
install(TARGETS app RUNTIME DESTINATION bin)
---
libb - CMakeLists.txt
cmake_minimum_required (VERSION 3.0.2)
project(b)
find_package(a NO_MODULE REQUIRED )
add_library(b lib.cpp)
target_link_libraries(b a)
target_include_directories(b PUBLIC "$")
install(TARGETS b EXPORT bConfig ARCHIVE DESTINATION lib/b )
install(FILES b.h DESTINATION include/b)
install(EXPORT bConfig DESTINATION lib/cmake/b )
--
liba - CMakeLists.txt
cmake_minimum_required (VERSION 3.0.2)
project(a)
add_library(a lib.cpp)
target_include_directories(a INTERFACE "$")
install(TARGETS a EXPORT aConfig ARCHIVE DESTINATION lib/a )
install(FILES a.h DESTINATION include/a)
install(EXPORT aConfig DESTINATION lib/cmake/a )
--
superbuild - CMakeLists.txt
cmake_minimum_required( VERSION 3.0.2 )
include(ExternalProject)
set(DEVROOT ${CMAKE_BINARY_DIR}/devroot)
set(CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${DEVROOT})
ExternalProject_Add(
   a
   CMAKE_ARGS ${CMAKE_ARGS}
   SOURCE_DIR ${CMAKE_SOURCE_DIR}/../liba
)
ExternalProject_Add(
   b
   DEPENDS a
   CMAKE_ARGS ${CMAKE_ARGS}
   SOURCE_DIR ${CMAKE_SOURCE_DIR}/../libb
)
ExternalProject_Add(
   app
   DEPENDS b
   CMAKE_ARGS ${CMAKE_ARGS}
   SOURCE_DIR ${CMAKE_SOURCE_DIR}/../app
)

Regards,
Adam

On Tue, Mar 17, 2015 at 4:50 AM, Stephen Kelly  wrote:

> Richard Taylor wrote:
>
> >
>
> http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
> >
>
> Prefer the official documentation instead of the wiki wherever official
> documentation exists (especially if it is well-formatted; that means it's
> probably recent and maintained).
>
>  http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html
>
> > However, only the names of dependent targets are set (via
> > INTERFACE_LINK_LIBRARIES in Targets.cmake)
> >
> > I guess that's where the problem lies, I'm just not sure how to fix it..
>
> The above link documents a find_dependency macro, which you might make use
> of.
>
> Thanks,
>
> Steve.
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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] Setting build type

2015-03-10 Thread Adam Getchell
Hello all,

You were correct, when CGAL is built it overrides CMAKE_BUILD_TYPE, as
documented here:

http://doc.cgal.org/latest/Manual/installation.html

The solution is to invoke:

cmake -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS=True -DCMAKE_BUILD_TYPE=Debug ..


Thanks for your help!


Adam

On Sun, Mar 1, 2015 at 1:41 PM, Mark Abraham 
wrote:

> Hi,
>
> Looks like one of your find_package calls is setting the build type
> variable, which it should not...
>
> Mark
> On 27/02/2015 5:47 pm, "Adam Getchell"  wrote:
>
>> Thanks for the help!
>>
>> It still runs Release mode:
>>
>> Here's my project:
>>
>> https://github.com/acgetchell/CDT-plusplus
>>
>> ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus]
>>
>> └─▪ tree
>>
>> .
>>
>> |.git
>>
>> | |config
>>
>> | |description
>>
>> | |HEAD
>>
>> | |hooks
>>
>> | | |applypatch-msg.sample
>>
>> | | |commit-msg.sample
>>
>> | | |post-update.sample
>>
>> | | |pre-applypatch.sample
>>
>> | | |pre-commit.sample
>>
>> | | |pre-push.sample
>>
>> | | |pre-rebase.sample
>>
>> | | |prepare-commit-msg.sample
>>
>> | | |update.sample
>>
>> | |index
>>
>> | |info
>>
>> | | |exclude
>>
>> | |logs
>>
>> | | |HEAD
>>
>> | | |refs
>>
>> | | | |heads
>>
>> | | | | |master
>>
>> | | | |remotes
>>
>> | | | | |origin
>>
>> | | | | | |HEAD
>>
>> | |objects
>>
>> | | |info
>>
>> | | |pack
>>
>> | | | |pack-a9db5eb5c90025a8ca13bddf15822cb0e57cbead.idx
>>
>> | | | |pack-a9db5eb5c90025a8ca13bddf15822cb0e57cbead.pack
>>
>> | |packed-refs
>>
>> | |refs
>>
>> | | |heads
>>
>> | | | |master
>>
>> | | |remotes
>>
>> | | | |origin
>>
>> | | | | |HEAD
>>
>> | | |tags
>>
>> |.gitignore
>>
>> |.travis-linux.yml
>>
>> |.travis-macosx.yml
>>
>> |.travis.yml
>>
>> |build.sh
>>
>> |CMakeLists.txt
>>
>> |Doxyfile
>>
>> |LICENSE
>>
>> |README.md
>>
>> |scan-build.sh
>>
>> |src
>>
>> | |cdt.cpp
>>
>> | |Delaunay.h
>>
>> | |docopt
>>
>> | | |docopt.cpp
>>
>> | | |docopt.h
>>
>> | | |docopt_private.h
>>
>> | | |docopt_util.h
>>
>> | | |docopt_value.h
>>
>> | | |examples
>>
>> | | | |naval_fate.cpp
>>
>> | | |LICENSE-Boost-1.0
>>
>> | | |LICENSE-MIT
>>
>> | | |main.cpp
>>
>> | | |README.rst
>>
>> | | |run_testcase.cpp
>>
>> | | |run_tests.py
>>
>> | | |testcases.docopt
>>
>> | |grid_d.cpp
>>
>> | |grid_d.h
>>
>> | |periodic_3_complex.h
>>
>> | |periodic_3_triangulations.h
>>
>> | |Point.h
>>
>> | |S3Action.h
>>
>> | |S3ErgodicMoves.h
>>
>> | |S3Triangulation.h
>>
>> | |sphere_d.h
>>
>> | |utilities.h
>>
>> |unittests
>>
>> | |.gitignore
>>
>> | |main.cpp
>>
>> | |PointTest.cpp
>>
>> | |S3BulkActionTest.cpp
>>
>> | |S3ErgodicMovesTest.cpp
>>
>> | |S3TetrahedronTest.cpp
>>
>> | |SdTriangulationTest.cpp
>>
>> | |SphereTest.cpp
>>
>> | |Triangulated2SphereTest.cpp
>>
>> | |VertexTest.cpp
>>
>> ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus]
>>
>> └─▪ mkdir build-d
>>
>> ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus]
>>
>> └─▪ cd build-d
>>
>> ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus/build-d]
>>
>> └─▪ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out ..
>>
>> -- The C compiler identification is AppleClang 6.0.0.656
>>
>> -- The CXX compiler identification is AppleClang 6.0.0.656
>>
>> -- Check for working C compiler: /usr/bin/cc
>>
>> -- Check for working C compiler: /usr/bin/cc -- works
>>
>> -- Detecting C compiler ABI info
>>
>> -- Detecting C compil

Re: [CMake] Setting build type

2015-02-27 Thread Adam Getchell
Thanks for the help!

It still runs Release mode:

Here's my project:

https://github.com/acgetchell/CDT-plusplus

┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus]

└─▪ tree

.

|.git

| |config

| |description

| |HEAD

| |hooks

| | |applypatch-msg.sample

| | |commit-msg.sample

| | |post-update.sample

| | |pre-applypatch.sample

| | |pre-commit.sample

| | |pre-push.sample

| | |pre-rebase.sample

| | |prepare-commit-msg.sample

| | |update.sample

| |index

| |info

| | |exclude

| |logs

| | |HEAD

| | |refs

| | | |heads

| | | | |master

| | | |remotes

| | | | |origin

| | | | | |HEAD

| |objects

| | |info

| | |pack

| | | |pack-a9db5eb5c90025a8ca13bddf15822cb0e57cbead.idx

| | | |pack-a9db5eb5c90025a8ca13bddf15822cb0e57cbead.pack

| |packed-refs

| |refs

| | |heads

| | | |master

| | |remotes

| | | |origin

| | | | |HEAD

| | |tags

|.gitignore

|.travis-linux.yml

|.travis-macosx.yml

|.travis.yml

|build.sh

|CMakeLists.txt

|Doxyfile

|LICENSE

|README.md

|scan-build.sh

|src

| |cdt.cpp

| |Delaunay.h

| |docopt

| | |docopt.cpp

| | |docopt.h

| | |docopt_private.h

| | |docopt_util.h

| | |docopt_value.h

| | |examples

| | | |naval_fate.cpp

| | |LICENSE-Boost-1.0

| | |LICENSE-MIT

| | |main.cpp

| | |README.rst

| | |run_testcase.cpp

| | |run_tests.py

| | |testcases.docopt

| |grid_d.cpp

| |grid_d.h

| |periodic_3_complex.h

| |periodic_3_triangulations.h

| |Point.h

| |S3Action.h

| |S3ErgodicMoves.h

| |S3Triangulation.h

| |sphere_d.h

| |utilities.h

|unittests

| |.gitignore

| |main.cpp

| |PointTest.cpp

| |S3BulkActionTest.cpp

| |S3ErgodicMovesTest.cpp

| |S3TetrahedronTest.cpp

| |SdTriangulationTest.cpp

| |SphereTest.cpp

| |Triangulated2SphereTest.cpp

| |VertexTest.cpp

┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus]

└─▪ mkdir build-d

┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus]

└─▪ cd build-d

┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus/build-d]

└─▪ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out ..

-- The C compiler identification is AppleClang 6.0.0.656

-- The CXX compiler identification is AppleClang 6.0.0.656

-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Build type: Release

-- USING CXXFLAGS = ' -O3 -DNDEBUG'

-- USING EXEFLAGS = '
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
'

-- Targetting Unix Makefiles

-- Using /usr/bin/c++ compiler.

-- DARWIN_VERSION=14

-- Mac Leopard detected

-- Requested component: Core

-- Requested component: MPFR

-- Requested component: GMP

-- Found Eigen3: /usr/local/include/eigen3 (found suitable version "3.2.4",
minimum required is "3.1.0")

-- Found Intel TBB

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/adam/CDT-plusplus/build-d

┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus/build-d]


On Wed, Feb 25, 2015 at 1:37 AM, J Decker  wrote:

> mkdir build-d
> cd build-d
> cmake
> -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out ../your/source/procject
> cmake --build .
> cd ..
>
> mkdir build-r
> cd build-r
> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out
> ../your/source/procject
> cmake --build . --target install
> cd ..
>
>
> On Wed, Feb 25, 2015 at 1:16 AM, Adam Getchell 
> wrote:
>
>> Thanks for your reply.
>>
>> I'm not sure I follow your answer. I do delete the directory each time I
>> build, but I'm still not understanding how you're building release or debug
>> versions to begin with.
>>
>> I'm just automatically getting Release, unless I edit CMakeCache.txt
>> after I've built once.
>>
>> I just checked CGAL_CreateSingleSourceCGALProgram.cmake which is invoked
>> in my CMakeLists.txt, but I do not see it setting the build type to Release.
>>
>> https://github.com/acgetchell/CDT-plusplus/blob/master/CMakeLists.txt
>>
>>
>>
>> On Tue, Feb 24, 2015 at 12:20 PM, J Decker  wrote:
>>
>>> I use a different directory to build release and debug versions
>>>
>>> if you d

Re: [CMake] Setting build type

2015-02-25 Thread Adam Getchell
Thanks for your reply.

I'm not sure I follow your answer. I do delete the directory each time I
build, but I'm still not understanding how you're building release or debug
versions to begin with.

I'm just automatically getting Release, unless I edit CMakeCache.txt after
I've built once.

I just checked CGAL_CreateSingleSourceCGALProgram.cmake which is invoked in
my CMakeLists.txt, but I do not see it setting the build type to Release.

https://github.com/acgetchell/CDT-plusplus/blob/master/CMakeLists.txt



On Tue, Feb 24, 2015 at 12:20 PM, J Decker  wrote:

> I use a different directory to build release and debug versions
>
> if you didn't delete, then when it goes to build partial things, the .obj
> files will still be newer than the .c files and will cause mixed
> release-debug builds which generally results in bizarre crashes.
> Once chosen, can't change the build type of a build; although if you could
> it should do a clean also.
>
>
> On Tue, Feb 24, 2015 at 11:42 AM, Adam Getchell 
> wrote:
>
>> Hello all,
>>
>> I've browsed this thread:
>>
>> http://www.cmake.org/pipermail/cmake/2008-September/023808.html
>>
>> But it doesn't work. My project is set to Release regardless, whether I
>> do:
>>
>> project( CDT-plusplus_ )
>> set(CMAKE_BUILD_TYPE RelWithDebInfo)
>>
>> Or:
>>
>> #
>> # If the user specifies -DCMAKE_BUILD_TYPE on the command line, take
>> their definition
>> # and dump it in the cache along with proper documentation, otherwise set
>> CMAKE_BUILD_TYPE
>> # to Debug prior to calling PROJECT()
>> #
>> IF(DEFINED CMAKE_BUILD_TYPE)
>>SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type
>> of
>> build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug
>> Release RelWithDebInfo MinSizeRel.")
>> ELSE()
>>SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build,
>> options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release
>> RelWithDebInfo MinSizeRel.")
>> ENDIF()
>>
>> project( CDT-plusplus_ )
>>
>> The only way I can change the build type is by going into my build
>> directory and editing CMakeCache.txt. However, I use an out of source
>> build, so my build directory is generated automatically by scripts such as:
>>
>> https://github.com/acgetchell/CDT-plusplus/blob/master/scan-build.sh
>>
>> What's the correct method for being able to set the type of build via the
>> command line?
>>
>> --
>> Adam Getchell
>> about.me/adamgetchell
>> "Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu
>>
>> --
>>
>> 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
>>
>
>


-- 
Adam Getchell
about.me/adamgetchell
"Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu
-- 

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] Setting build type

2015-02-24 Thread Adam Getchell
Hello all,

I've browsed this thread:

http://www.cmake.org/pipermail/cmake/2008-September/023808.html

But it doesn't work. My project is set to Release regardless, whether I do:

project( CDT-plusplus_ )
set(CMAKE_BUILD_TYPE RelWithDebInfo)

Or:

#
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their
definition
# and dump it in the cache along with proper documentation, otherwise set
CMAKE_BUILD_TYPE
# to Debug prior to calling PROJECT()
#
IF(DEFINED CMAKE_BUILD_TYPE)
   SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of
build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug
Release RelWithDebInfo MinSizeRel.")
ELSE()
   SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build,
options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release
RelWithDebInfo MinSizeRel.")
ENDIF()

project( CDT-plusplus_ )

The only way I can change the build type is by going into my build
directory and editing CMakeCache.txt. However, I use an out of source
build, so my build directory is generated automatically by scripts such as:

https://github.com/acgetchell/CDT-plusplus/blob/master/scan-build.sh

What's the correct method for being able to set the type of build via the
command line?

-- 
Adam Getchell
about.me/adamgetchell
"Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu
-- 

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] whole archive linkage

2015-01-24 Thread Adam
On Sat, 2015-01-24 at 01:43 -0500, Braden McDaniel wrote:
> On Sat, 2015-01-24 at 13:41 +1000, Adam wrote:
> 
> > The library contains a static which registers itself in its
> > constructor. This problem is described here
> > http://stackoverflow.com/a/842770
> 
> As something of an aside to your question, I don't know that I accept
> that as a sane use case.  C++ doesn't guarantee that (in that example) m
> will be constructed before h.  If m is not constructed first,
> construction of h calls operator[] on an uninitialized object.
> 

I agree.  The actually legacy library I'm using has wrapped the global
map 'm' inside a singleton which I believe resolves the static ordering
issue. 

I currently have to specify something like the following for every
application that wants to use this library

target_link_libraries(
   Application
   -Wl,--whole-archive -llegacyLib -Wl,--no-whole-archive
   libA
   libB )

I was hoping there might have been a better way to do this with target
properties of legacyLib.

~Adam


-- 

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] whole archive linkage

2015-01-23 Thread Adam
Hi All,

I have a library that must be linked with -Wl,--whole-archive -lyourlib

The library contains a static which registers itself in its constructor.
This problem is described here http://stackoverflow.com/a/842770

Is there a target property I can set on this library so consumers of the
library automatically get whole archive linkage when including this library.


Regards,
Adam
-- 

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] Correct settings to add docopt.cpp to target list

2014-12-05 Thread Adam Getchell
It turns out that CGAL's CGAL_CreateSingleSourceCGALProgram.cmake module
handles this nicely:

create_single_source_cgal_program( "src/cdt-docopt.cpp"
"src/docopt/docopt.cpp")

does the trick.

Thanks for your consideration!

On Thu, Dec 4, 2014 at 10:54 PM, Adam Getchell 
wrote:

> I should note that I'm doing an out of source build, and that for my
> project the following line works:
>
> ┌─[*adam*][Hapkido][*±*][docopt *✓*][~/CDT-plusplus/build]
>
> └─▪ clang++ --std=c++11 --stdlib=libc++ -I ../src/docopt
> ../src/docopt/docopt.cpp ../src/cdt-docopt.cpp -o cdt_docopt
>
> On Thu, Dec 4, 2014 at 9:30 PM, Adam Getchell 
> wrote:
>
>> Hello all,
>>
>> I’m trying to use the docopt.cpp parser for my project[1]:
>>
>> https://github.com/docopt/docopt.cpp
>>
>> The usual invocation to build works:
>>
>> ┌─[*adam*][Hapkido][*±*][docopt *✗*][~/CDT-plusplus/src/docopt]
>> └─▪ clang++ --std=c++11 --stdlib=libc++ -I . docopt.cpp
>> examples/naval_fate.cpp -o naval_fate
>>
>> So, I want to add docopt.cpp and have the compiler look for header files
>> in the same directory, and add that to my executable.
>>
>> So far, what I’ve attempted is to add the lines:
>>
>> include_directories (BEFORE "src/docopt")
>> add_library(docopt.cpp "src/docopt/docopt.cpp”)
>>
>> My program uses CGAL[2], and all of those library headers are
>> incorporated using the create_single_source_cgal_program function in the
>> CGAL_CreateSingleSourceCGALProgram.cmake module.
>>
>> The error messages I’m getting correspond to the ones I get when
>> docopt.cpp is not included:
>>
>> ┌─[*adam*][Hapkido][*±*][docopt *✗*][~/CDT-plusplus/src/docopt]
>> └─▪ clang++ --std=c++11 --stdlib=libc++ -I . examples/naval_fate.cpp -o
>> naval_fate
>> Undefined symbols for architecture x86_64:
>>   "docopt::docopt(std::__1::basic_string> std::__1::char_traits, std::__1::allocator > const&,
>> std::__1::vector,
>> std::__1::allocator >,
>> std::__1::allocator> std::__1::char_traits, std::__1::allocator > > > const&, bool,
>> std::__1::basic_string,
>> std::__1::allocator > const&, bool)", referenced from:
>>   _main in naval_fate-780283.o
>>   "docopt::operator<<(std::__1::basic_ostream> std::__1::char_traits >&, docopt::value const&)", referenced from:
>>   _main in naval_fate-780283.o
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>>
>> Compare to:
>>
>> ┌─[*adam*][Hapkido][*±*][docopt *✗*][~/CDT-plusplus]
>> └─▪ ./build.sh
>> -- The C compiler identification is AppleClang 6.0.0.654
>> -- The CXX compiler identification is AppleClang 6.0.0.654
>> -- 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
>> -- Build type: Release
>> -- USING CXXFLAGS = ' -O3 -DNDEBUG'
>> -- USING EXEFLAGS = '
>> -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
>> '
>> -- Targetting Ninja
>> -- Using /usr/bin/c++ compiler.
>> -- DARWIN_VERSION=14
>> -- Mac Leopard detected
>> -- Requested component: Core
>> -- Requested component: MPFR
>> -- Requested component: GMP
>> -- Found Eigen3: /usr/local/include/eigen3 (found suitable version
>> "3.2.2", minimum required is "3.1.0")
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to: /Users/adam/CDT-plusplus/build
>> [10/13] Linking CXX executable cdt-docopt
>> FAILED: : && /usr/bin/c++   -O3 -DNDEBUG -Wl,-search_paths_first
>> -Wl,-headerpad_max_install_names
>> -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
>> CMakeFiles/cdt-docopt.dir/src/cdt-docopt.cpp.o  -o cdt-docopt
>> -L/Users/adam/gmock-1.7.0/lib/.libs
>> -L/Users/adam/gmock-1.7.0/gtest/lib/.libs /usr/local/lib/libmpfr.dylib
>> /usr/local/lib/libgmp.dylib /usr/local/lib/libCGAL_Core.dylib
>> /usr

Re: [CMake] Correct settings to add docopt.cpp to target list

2014-12-04 Thread Adam Getchell
I should note that I'm doing an out of source build, and that for my
project the following line works:

┌─[*adam*][Hapkido][*±*][docopt *✓*][~/CDT-plusplus/build]

└─▪ clang++ --std=c++11 --stdlib=libc++ -I ../src/docopt
../src/docopt/docopt.cpp ../src/cdt-docopt.cpp -o cdt_docopt

On Thu, Dec 4, 2014 at 9:30 PM, Adam Getchell 
wrote:

> Hello all,
>
> I’m trying to use the docopt.cpp parser for my project[1]:
>
> https://github.com/docopt/docopt.cpp
>
> The usual invocation to build works:
>
> ┌─[*adam*][Hapkido][*±*][docopt *✗*][~/CDT-plusplus/src/docopt]
> └─▪ clang++ --std=c++11 --stdlib=libc++ -I . docopt.cpp
> examples/naval_fate.cpp -o naval_fate
>
> So, I want to add docopt.cpp and have the compiler look for header files
> in the same directory, and add that to my executable.
>
> So far, what I’ve attempted is to add the lines:
>
> include_directories (BEFORE "src/docopt")
> add_library(docopt.cpp "src/docopt/docopt.cpp”)
>
> My program uses CGAL[2], and all of those library headers are incorporated
> using the create_single_source_cgal_program function in the
> CGAL_CreateSingleSourceCGALProgram.cmake module.
>
> The error messages I’m getting correspond to the ones I get when
> docopt.cpp is not included:
>
> ┌─[*adam*][Hapkido][*±*][docopt *✗*][~/CDT-plusplus/src/docopt]
> └─▪ clang++ --std=c++11 --stdlib=libc++ -I . examples/naval_fate.cpp -o
> naval_fate
> Undefined symbols for architecture x86_64:
>   "docopt::docopt(std::__1::basic_string std::__1::char_traits, std::__1::allocator > const&,
> std::__1::vector,
> std::__1::allocator >,
> std::__1::allocator std::__1::char_traits, std::__1::allocator > > > const&, bool,
> std::__1::basic_string,
> std::__1::allocator > const&, bool)", referenced from:
>   _main in naval_fate-780283.o
>   "docopt::operator<<(std::__1::basic_ostream std::__1::char_traits >&, docopt::value const&)", referenced from:
>   _main in naval_fate-780283.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> Compare to:
>
> ┌─[*adam*][Hapkido][*±*][docopt *✗*][~/CDT-plusplus]
> └─▪ ./build.sh
> -- The C compiler identification is AppleClang 6.0.0.654
> -- The CXX compiler identification is AppleClang 6.0.0.654
> -- 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
> -- Build type: Release
> -- USING CXXFLAGS = ' -O3 -DNDEBUG'
> -- USING EXEFLAGS = '
> -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
> '
> -- Targetting Ninja
> -- Using /usr/bin/c++ compiler.
> -- DARWIN_VERSION=14
> -- Mac Leopard detected
> -- Requested component: Core
> -- Requested component: MPFR
> -- Requested component: GMP
> -- Found Eigen3: /usr/local/include/eigen3 (found suitable version
> "3.2.2", minimum required is "3.1.0")
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /Users/adam/CDT-plusplus/build
> [10/13] Linking CXX executable cdt-docopt
> FAILED: : && /usr/bin/c++   -O3 -DNDEBUG -Wl,-search_paths_first
> -Wl,-headerpad_max_install_names
> -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
> CMakeFiles/cdt-docopt.dir/src/cdt-docopt.cpp.o  -o cdt-docopt
> -L/Users/adam/gmock-1.7.0/lib/.libs
> -L/Users/adam/gmock-1.7.0/gtest/lib/.libs /usr/local/lib/libmpfr.dylib
> /usr/local/lib/libgmp.dylib /usr/local/lib/libCGAL_Core.dylib
> /usr/local/lib/libCGAL.dylib /usr/local/lib/libboost_thread-mt.dylib
> /usr/local/lib/libboost_system-mt.dylib /usr/local/lib/libCGAL_Core.dylib
> /usr/local/lib/libCGAL.dylib /usr/local/lib/libboost_thread-mt.dylib
> /usr/local/lib/libboost_system-mt.dylib
> -Wl,-rpath,/Users/adam/gmock-1.7.0/lib/.libs
> -Wl,-rpath,/Users/adam/gmock-1.7.0/gtest/lib/.libs && :
> Undefined symbols for architecture x86_64:
>   "docopt::docopt(std::__1::basic_string std::__1::char_traits, std::__1::allocator > const&,
> std::__1::vector,
> std::__1::allocator >,
> std::__1::allocator std::__1::char_traits, std::__1::allocator > > > const&, bool,
> std::__1

[CMake] Correct settings to add docopt.cpp to target list

2014-12-04 Thread Adam Getchell
Hello all,

I’m trying to use the docopt.cpp parser for my project[1]:

https://github.com/docopt/docopt.cpp <https://github.com/docopt/docopt.cpp>

The usual invocation to build works:

┌─[adam][Hapkido][±][docopt ✗][~/CDT-plusplus/src/docopt]
└─▪ clang++ --std=c++11 --stdlib=libc++ -I . docopt.cpp examples/naval_fate.cpp 
-o naval_fate

So, I want to add docopt.cpp and have the compiler look for header files in the 
same directory, and add that to my executable.

So far, what I’ve attempted is to add the lines:

include_directories (BEFORE "src/docopt")
add_library(docopt.cpp "src/docopt/docopt.cpp”)

My program uses CGAL[2], and all of those library headers are incorporated 
using the create_single_source_cgal_program function in the 
CGAL_CreateSingleSourceCGALProgram.cmake module.

The error messages I’m getting correspond to the ones I get when docopt.cpp is 
not included:

┌─[adam][Hapkido][±][docopt ✗][~/CDT-plusplus/src/docopt]
└─▪ clang++ --std=c++11 --stdlib=libc++ -I . examples/naval_fate.cpp -o 
naval_fate
Undefined symbols for architecture x86_64:
  "docopt::docopt(std::__1::basic_string, 
std::__1::allocator > const&, 
std::__1::vector, 
std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&, bool, 
std::__1::basic_string, 
std::__1::allocator > const&, bool)", referenced from:
  _main in naval_fate-780283.o
  "docopt::operator<<(std::__1::basic_ostream 
>&, docopt::value const&)", referenced from:
  _main in naval_fate-780283.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Compare to:

┌─[adam][Hapkido][±][docopt ✗][~/CDT-plusplus]
└─▪ ./build.sh 
-- The C compiler identification is AppleClang 6.0.0.654
-- The CXX compiler identification is AppleClang 6.0.0.654
-- 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
-- Build type: Release
-- USING CXXFLAGS = ' -O3 -DNDEBUG'
-- USING EXEFLAGS = '  
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
 '
-- Targetting Ninja
-- Using /usr/bin/c++ compiler.
-- DARWIN_VERSION=14
-- Mac Leopard detected
-- Requested component: Core
-- Requested component: MPFR
-- Requested component: GMP
-- Found Eigen3: /usr/local/include/eigen3 (found suitable version "3.2.2", 
minimum required is "3.1.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/adam/CDT-plusplus/build
[10/13] Linking CXX executable cdt-docopt
FAILED: : && /usr/bin/c++   -O3 -DNDEBUG -Wl,-search_paths_first 
-Wl,-headerpad_max_install_names 
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
 CMakeFiles/cdt-docopt.dir/src/cdt-docopt.cpp.o  -o cdt-docopt 
-L/Users/adam/gmock-1.7.0/lib/.libs  -L/Users/adam/gmock-1.7.0/gtest/lib/.libs 
/usr/local/lib/libmpfr.dylib /usr/local/lib/libgmp.dylib 
/usr/local/lib/libCGAL_Core.dylib /usr/local/lib/libCGAL.dylib 
/usr/local/lib/libboost_thread-mt.dylib /usr/local/lib/libboost_system-mt.dylib 
/usr/local/lib/libCGAL_Core.dylib /usr/local/lib/libCGAL.dylib 
/usr/local/lib/libboost_thread-mt.dylib /usr/local/lib/libboost_system-mt.dylib 
-Wl,-rpath,/Users/adam/gmock-1.7.0/lib/.libs 
-Wl,-rpath,/Users/adam/gmock-1.7.0/gtest/lib/.libs && :
Undefined symbols for architecture x86_64:
  "docopt::docopt(std::__1::basic_string, 
std::__1::allocator > const&, 
std::__1::vector, 
std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&, bool, 
std::__1::basic_string, 
std::__1::allocator > const&, bool)", referenced from:
  _main in cdt-docopt.cpp.o
  "docopt::operator<<(std::__1::basic_ostream 
>&, docopt::value const&)", referenced from:
  _main in cdt-docopt.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[10/13] Building CXX object 
CMakeFiles/unittests.dir/unittests/Triangulated2SphereTest.cpp.o
ninja: build stopped: subcommand failed.

Any suggestions?

[1] https://github.com/acgetchell/CDT-plusplus/tree/docopt 
<https://github.com/acgetchell/CDT-plusplus/tree/docopt>
[2] https://www.cgal.org <https://www.cgal.org/>

Adam Getchell
about.me/adamgetchell

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ

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

Re: [CMake] CMake and user friendliness

2014-09-22 Thread Adam Strzelecki
Please install cmake bash_completion and then it will be easy as typing: cmake 
-D

--Adam
-- 

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] Feature Request: CMAKE_GENERATOR environment variable for default generator

2014-06-12 Thread Adam Strzelecki
>alias c=''\''C:/Program Files (x86)/CMake/bin/cmake.exe'\'' -G Ninja'

Aliasing is kind of solution I use now, since cmake allows -G specified twice. 
But IMHO environment variable would be nice addition. Btw. not using Windows 
here ;)

Cheers,
-- 
Adam
-- 

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


[CMake] Feature Request: CMAKE_GENERATOR environment variable for default generator

2014-06-12 Thread Adam Strzelecki
Long story short currently default generator is hard-coded in CMake depending 
on platform. It would be convenient to let user specify it's favorite generator 
in .profile/.bash_profile so it spares lot of command line typing.

I'd love to make CMAKE_GENERATOR=Ninja then :)

WDYT?

-- 
Adam
-- 

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


Re: [CMake] Why simple `cmake` does not launch default generator on current directory?

2014-06-12 Thread Adam Strzelecki
> Because that would create an in-source build, and you almost never want that. 
> One wants to build out of source. Sadly CMake will stumble if you try to 
> create an out-of-source build from a directory that is an in-source build, so 
> not having that default of "cmake ." actually saves everyone a lot of trouble.

It is clear to me that out-of-source builds are better for many reasons, but I 
don't see how `cmake` dumping 3 pages of usage not mentioning anything about 
that lets user to understand that.

Moreover there is a lack of consequence whether path argument is obligatory or 
not, because `cmake -GNinja` or `cmake -DDUMMY=1` works in source directory 
without needing to specify extra dot.

In-source builds may be convenient too if you're working remotely via ssh in 
git managed folder, which I do a lot. This saves you lot of `cd` typing and it 
is quicker to do `git clean ...` than move forth and back to build folder.

If CMake is supposed to be meta-`make`, why it doesn't behave like `make`? If 
it suppose to help understand what is going on it should output rather:

===
CMake Warning: Current directory is source directory. Out-of-source builds are 
recommended.
Specify `cmake .` to skip this warning or create separate build folder.
===

But I am really against that, since command line user shouldn't be treated like 
stupid user. Anyway for beginners GUI is preferred way to go.

Regards,
-- 
Adam
-- 

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


[CMake] Why simple `cmake` does not launch default generator on current directory?

2014-06-11 Thread Adam Strzelecki
Hello,

We started using CMake recently in our projects. And it is really a timesaver 
comparing to Qmake/autotools, however there is one thing that bothers me.

Why typing simple: cmake in command line doesn't trigger configure with default 
generator (i.e. Makefile)? It just prints help, which is anyway accessible via 
cmake -h/--help.

This is really weird comparing to other tools such as ./configure, quake, make, 
that do not expect any parameter to launch them up.

Fortunately there is `cmake .`, but the dot is kinda superfluous.

Regards,
-- 
Adam
-- 

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


Re: [CMake] CMAKE_COMPILER variable

2014-06-06 Thread Adam
I think the "CMAKE_COMPILER" variable you're referring to is just a custom
variable passed to your external project, which it uses to build the
standard variables "CMAKE_C_COMPILER" & "CMAKE_CXX_COMPILER".  This is why
your not finding anything.

Have a look at these pages
http://www.cmake.org/Wiki/CMake_Cross_Compiling#Setting_up_the_system_and_toolchain
http://www.cmake.org/Wiki/CMake_Useful_Variables



On Sat, Jun 7, 2014 at 6:30 AM, Michael Enright 
wrote:

> I've got an External_Project_Add in my superbuild that adds a CMake-built
> library to the build. It attempts to use the CMAKE_COMPILER variable in
> order to define CMAKE_C_COMPILER for this library's build.
>
> This external project's build is flakey. I intend to diagnose this myself
> so I don't plan to supply a reduction or anything like that, I'm just
> trying to gather information.
>
> To that end, I need an authoritative definition of CMAKE_COMPILER, i.e. I
> have been searching for a web page where CMAKE_COMPILER is described. Apart
> from googling I have also just manually reviewed
> http://www.cmake.org/cmake/help/cmake2.6docs.html
> and
> http://www.cmake.org/cmake/help/v2.8.12/cmake.html
>
>
> Neither of those contain the string "CMAKE_COMPILER" except as substrings
> of other names such as CMAKE_COMPILER_2005.
>
> Can anyone provide a link or say anything about this variable?
>
>
>
>
> --
>
> 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://www.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:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] cmake project patterns / examples

2014-06-03 Thread Adam
Thanks for the comments I've update the wiki. Top-level only now marked as
anti-pattern
https://github.com/toomuchatonce/cmake-examples/wiki/cmake-patterns-and-examples

If there are other patterns / anti-patterns you've seen please send me a
pull request and I'll add them.

I'm particularly interested in super-build patterns that allow sub-projects
(for both inhouse and 3rdparty components) to be shared between projects.





On Wed, Jun 4, 2014 at 5:56 AM, Chuck Atkins 
wrote:

> "Just put all the build commands in the top level cmake file."
>
> Definitely an anti-pattern.  As you mentioned, it definitely doesn't
> scale.  The problem with even doing this for a simple project is that it
> builds this behavior for people trying to learn cmake through simple
> examples.  This very very quickly turns in to a 3k line top level
> CMakeLists.txt  for even moderately sized projects.  I would really
> discourage this one as "don't do it ever" because of the bad behaviours it
> builds early on.
>
> - Chuck
>
> On Tue, Jun 3, 2014 at 1:22 PM, Iosif Neitzke <
> iosif.neitzke+cm...@gmail.com> wrote:
>
>> Great to see these examples with pros and cons.
>>
>> I believe the staticlibs-include example [0] pattern, though mentioned
>> in Mastering CMake [1], generally is deprecated in favor of
>> add_subdirectory with CMakeLists.txt at each level for self-contained
>> projects.
>>
>> [0]
>> https://github.com/toomuchatonce/cmake-examples/tree/master/staticlibs-include
>>
>> [1] Mastering CMake, 6th Edition, Chapter 7: Converting Existing
>> Systems to CMake, Source Code Directory Structures, page 116
>>
>> On Mon, Jun 2, 2014 at 5:23 PM, Adam Boseley 
>> wrote:
>> >
>> > There's a lot of legacy examples around the web but not too many using
>> the
>> > newer features.  What is the current best practise?
>> >
>> > Here's some simple examples
>> >
>> https://github.com/toomuchatonce/cmake-examples/wiki/cmake-patterns-and-examples
>> >
>> > Are these patterns or anti-patterns?
>> >
>> > Regards,
>> > Adam
>> >
>> > --
>> >
>> > 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://www.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:
>> http://www.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:
> http://www.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:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] cmake project patterns / examples

2014-06-02 Thread Adam Boseley
There's a lot of legacy examples around the web but not too many using the
newer features.  What is the current best practise?

Here's some simple examples
https://github.com/toomuchatonce/cmake-examples/wiki/cmake-patterns-and-examples

Are these patterns or anti-patterns?

Regards,
Adam
-- 

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

[CMake] How to sign up project for public CDASH

2013-11-26 Thread Adam Getchell
Hello all,

I’m following the directions posted here:

http://www.cmake.org/Wiki/CMake_Testing_With_CTest

I’d like to get my dashboard up on the public one:

http://open.cdash.org/index.php?project=PublicDashboard

I’ve obtained an account on CTest.

How do I register my project?

Thanks,

Adam Getchell




--

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


Re: [CMake] Temp workaround for FindPythonLibs on Win7 64-bit

2013-05-31 Thread Adam Wolf
If this gets looked at, maybe we can add my Linux FindPythonLibs
improvements at the same time? ;)

http://cmake.3232098.n2.nabble.com/FindPythonLibs-Bug-0013794-fix-td7584055.html

Adam Wolf

On Fri, May 31, 2013 at 11:54 AM, Jeremy Carter  wrote:
> Hi,
>
> It has been established that the FindPythonLibs module fails to find
> 64-bit Python on Win7 64-bit, due to the fact that CMake can't read
> the 64-bit portion of the Windows Registry (and that's where the
> module looks to find Python). See:
> http://www.cmake.org/Bug/view.php?id=11303 .
>
> I made a temporary fix that requires the Python libs folder to be in
> the Windows Path. It hasn't been tested on platforms other than
> Windows 7 64-bit, so I'm sorry if it breaks things, and it's the first
> time I've posted on this list and also the first time I've patched
> anything, anyway, here's the patch I'm using until there's an official
> CMake fix:
>
> # -- begin patch --
>
> --- C:\Program Files (x86)\CMake
> 2.8\share\cmake-2.8\Modules\FindPythonLibs.cmake2013-05-15
> 13:46:30 -0400
> +++ FindPythonLibs.cmake2013-05-31 12:50:10 -0400
> @@ -31,6 +31,13 @@
>  
> #=
>  # (To distribute this file outside of CMake, substitute the full
>  #  License text for the above reference.)
> +#=
> +# This is a modified version of FindPythonLibs.cmake, hacked to support
> +# finding Python 64-bit on Windows 7 64-bit. It requires the Python libs
> +# directory to be in the Windows Path, since CMake is unable to read the
> +# 64-bit Windows Registry.
> +#
> +# Modified by Jeremy Carter (jeremy [at] jeremycarter [dot] ca) on 
> 2013-05-31.
>
>  include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
>  # Search for the python framework on Apple.
> @@ -81,6 +88,11 @@
>
>  foreach(_CURRENT_VERSION ${_Python_VERSIONS})
>string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
> +
> +  # Registry lookup doesn't work on Windows 7 64-bit with 64-bit Python.
> +  # Find Python in Windows Path instead.
> +  set(WINDOWS_PATH $ENV{Path})
> +
>if(WIN32)
>  find_library(PYTHON_DEBUG_LIBRARY
>NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
> @@ -89,6 +101,7 @@
>
> [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
>
> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
>
> [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
> +  ${WINDOWS_PATH} # Not tested. Added to look in Windows Path.
>)
>endif()
>
> @@ -102,6 +115,7 @@
>  PATHS
>
> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
>
> [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
> +  ${WINDOWS_PATH} # Added to look in Windows Path.
>  # Avoid finding the .dll in the PATH.  We want the .lib.
>  NO_SYSTEM_ENVIRONMENT_PATH
>)
> @@ -129,12 +143,16 @@
>  endforeach()
>endif()
>
> +  # Added this because find_path() wasn't finding Python include dir
> from $ENV{Path} for some reason.
> +  get_filename_component(WINDOWS_PYTHON_LIB_PATH ${PYTHON_LIBRARY} PATH)
> +
>find_path(PYTHON_INCLUDE_DIR
>  NAMES Python.h
>  PATHS
>${PYTHON_FRAMEWORK_INCLUDES}
>
> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
>
> [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
> +  ${WINDOWS_PYTHON_LIB_PATH}/../include # The Python include
> directory is probably here.
>  PATH_SUFFIXES
>python${_CURRENT_VERSION}mu
>python${_CURRENT_VERSION}m
>
> # -- end patch --
>
> This might work in the short term, but CMake should probably be fixed
> so that this hack isn't necessary. I'm also open to suggestions on how
> this could be done better.
>
> Regards,
> Jeremy Carter
> --
>
> 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
--

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] FindPythonLibs Bug #0013794 fix

2013-04-12 Thread Adam Wolf
Hi folks,

While we're talking Python, I wrote a small patch to FindPythonLibs
that looks to see if PYTHON_VERSION_MAJOR and PYTHON_VERSION_MINOR are
set (by FindPythonInterp), and if so, it puts them in the python
versions list, after the user specified versions, but before the
Python3, Python2, and Python1 versions.

I know you want to redo the FindPython stuff, but I'm hoping this is a
small enough patch, with hopefully minimal side-effects, that will
help fix the CMake experience on both Fedora
(https://bugzilla.redhat.com/show_bug.cgi?id=876118) and Ubuntu as
well as any other other system that has newer libraries installed than
the default interpreter.

This appears to fix Bug #0013794.
http://public.kitware.com/Bug/view.php?id=13794

I have attached the patch as a file, but I can also do a pull request
or any other requested code submission process.

Adam Wolf
Wayne and Layne, LLC


adamwwolf-FindPythonLibs.patch
Description: Binary data
--

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] Bug? add_custom_command() ignores head file outputs

2012-08-24 Thread Adam B
On 08/24/2012 11:09 AM, Andreas Pakulat wrote:
> Hi,
>
> On Fri, Aug 24, 2012 at 7:27 PM, Adam B  wrote:
>> Hello all,
>>
>> I'm relatively new to CMake but I've encountered some unexpected behavior.
>> Perhaps it's by design or perhaps it's a bug - you tell me.  The short story
>> is this:
> It is a bug, but not in CMake, its in your cmake code.
>
>> It appears that add_custom_command() is ignored if the only OUTPUT is a C
>> header file (.h).  The generated makefiles do not include the custom
>> command.  However, if I also list a C source file (.c) as a second output,
>> the makefiles get the command.
> If you look at the add_custom_command documentation you'll notice that
> it says "if a target defined in the same directory depends on the
> output of a custom command a dependency rule is set up so the custom
> command runs before the target is being built" (slightly different
> wording, written from the top of my head). Your target however only
> has the .c file in its source list and hence nothing in your target
> depends on an output of the custom command and hence no such rule is
> set up. You can either include the .h file in the list of sources for
> your target (CMake does not generate compile-rules for files it
> recognizes as C/C++ headers), you can setup a custom target that
> depends on the .h file and has some no-op as command and make your
> executable depend on the custom target or (as you already did) have
> the .c file in the output of the custom command.
The light comes on!  Thanks for the detailed explanation, Andreas.  Adding the 
.h file to the executable sources list did the trick.  (And thank you Eike for 
suggesting that too.)

> Andreas



Videx, Inc. | 1105 NE Circle Blvd. | Corvallis, OR 97330 | (541) 738-5500
This email is intended only for the addressee(s) and may include material that 
is privileged, confidential, and protected from disclosure.  No contract is 
intended.  ©2012 Videx, Inc.

--

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] Bug? add_custom_command() ignores head file outputs

2012-08-24 Thread Adam B
Hello all,

I'm relatively new to CMake but I've encountered some unexpected behavior.  
Perhaps it's by design or perhaps it's a bug - you tell me.  The short story is 
this:

It appears that add_custom_command() is ignored if the only OUTPUT is a C 
header file (.h).  The generated makefiles do not include the custom command.  
However, if I also list a C source file (.c) as a second output, the makefiles 
get the command.

Here's a simplified setup to reproduce the problem:

-project_dir/---

 CMakeLists.txt
 hello.c
 hello.h
 update_hello_h.sh

CMakeLists.txt-

cmake_minimum_required(VERSION 2.8)
project(cmake_test)

set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM ON)  #so hello.h never gets 
cleaned away

add_custom_command(OUTPUT hello.h COMMAND ./update_hello_h.sh DEPENDS 
update_hello_h.sh)

add_executable(hello hello.c)

hello.c

#include 
#include "hello.h"
int main(int argc, char ** argv)
{
 printf(HELLO_MSG "\n");
 return 0;
}

---hello.h

#define HELLO_MSG "Hello Fri Aug 24 09:01:53 PDT 2012"

---update_hello_h.sh-

#!/bin/sh
echo "#define HELLO_MSG" \"Hello `date`\" > hello.h

--

What I would expect is for CMake to add a makefile rule to execute 
./update_hello_h.sh if it's newer than hello.h.  No such rule gets generated.  
However, if you add hello.c like so:

 add_custom_command(OUTPUT hello.h hello.c COMMAND ./update_hello_h.sh 
DEPENDS update_hello_h.sh)

Then a rule gets generated.  Is this a bug or am I missing something?  I feel 
like I'm lying to CMake by telling it that hello.c is an output when it really 
isn't.

I'm using CMake 2.8.0 on Ubuntu 10.04.

Much thanks!
- Adam B.


Videx, Inc. | 1105 NE Circle Blvd. | Corvallis, OR 97330 | (541) 738-5500
This email is intended only for the addressee(s) and may include material that 
is privileged, confidential, and protected from disclosure.  No contract is 
intended.  ©2012 Videx, Inc.

--

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] OS X Frameworks with spaces in filename

2011-10-21 Thread Adam Somers
Sorry if this is not the correct list to post questions.  Please direct me
to the proper place if so.

I'm having trouble linking my OS X application to a specific framework using
CMake without explicitly setting linker flags (somewhat defeating the
purpose of using CMake for cross-platform building).  Say I have a framework
called "My Framework.framework".  CMake successfully finds the framework
when I run:

find_library(MY_LIB \"My\ Framework\")

Then I link to my target with:

target_link_libraries(MyTarget ${MY_LIB})

The resulting linker flag is:

-Framework My Framework

This of course is incorrect and will cause gcc to try to link to "My" and
"Framework separately.

The solution is to write the linker flags myself, as follows:
set(CMAKE_EXE_LINKER_FLAGS -framework\ \"My\ Framework\")

Is there a better way?

BTW, I tried to fix up the name by replacing " " with "\ " i.e.

string(REPLACE " " "\\ " MY_LIB_FIX ${MY_LIB})

Such that MY_LIB_FIX is /Library/Frameworks/My\ Framework.framework.  But to
my dismay, CMake interprets this format differently and produces a warning
that says "[the path] is a full-path but not a valid library file name."
 The the resulting linker flag is -l rather than the required -framework.

Any help greatly appreciated!
--

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 adds "lib" prefix to library. Bug?

2010-11-23 Thread Adam J Richardson
Hi list.

Not sure if this is a bug or something stupid I've done. On several
Windows build environments (two XP, two 7, this happens with 2.8.2 and
2.8.3), I'm getting the error:

c:/compilers/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: 
cannot find -llibodbc32

That's clear enough. It's also clear what the problem is: there is no
liblibodbc32.a in my environment. There is however a libodbc32.a, which
I would expect it to pick up.

With VERBOSE=1, make gives me a long g++ command ending with:

... -Wl,-Bstatic -llibodbc32 -Wl,-Bdynamic -lkernel32 -luser32 -lgdi32
-lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32

Which is correct apart from the -llibodbc32 part. (I'm not entirely
clear on why CMake felt it necessary to specify that it's a static lib
when it didn't with the previous ones.)

I've debugged my FindODBC.cmake with "message(STATUS ${blah})"
instructions and it returns "odbc32", which is correct.

So my question is: why is CMake adding an extra "lib"? I can work
around it for now, but I'd like to solve this one properly.

Thanks,
Adam J Richardson



CMakeLists.txt snippet:

if (ODBC_FOUND)
   set(T_LIBS ${T_LIBS} ${ODBC_LIBRARIES})
#   message(STATUS "ODBC: ${ODBC_LIBRARIES}")
else()
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_ODBC=1")
   message(STATUS "ODBC not found, omitting from build.")
endif()

FindODBC.cmake sans comments:

SET( ODBC_FOUND 0 )
FIND_PATH(ODBC_INCLUDE_DIRECTORIES sql.h
  DOC "Specify the directory containing sql.h."
)
FIND_LIBRARY( ODBC_LIBRARIES 
  NAMES iodbc odbc odbcinst odbc32
  DOC "Specify the ODBC driver manager library here."
)
IF (ODBC_LIBRARIES)
  IF (ODBC_INCLUDE_DIRECTORIES)
SET( ODBC_FOUND 1 )
  ENDIF (ODBC_INCLUDE_DIRECTORIES)
ENDIF (ODBC_LIBRARIES)
MARK_AS_ADVANCED( ODBC_FOUND ODBC_LIBRARY ODBC_LIBRARIES ODBC_EXTRA_LIBRARIES 
ODBC_INCLUDE_DIRECTORIES )


signature.asc
Description: PGP signature
___
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] Extra include/lib paths - multiple entries

2010-11-18 Thread Adam J Richardson
On Wed, 17 Nov 2010 13:12:42 +0100
Yngve Inntjore Levinsen  wrote:

> On Wednesday 17 November 2010 12:30:06 Adam J Richardson wrote:
> > Is this a correct specification for multiple include/lib paths in
> > environment variables? If not, what should I use instead? Sometimes
> > it seems to work, other times not...
> > 
> >   CMAKE_INCLUDE_PATH=C:/Compilers/Includes;C:/Compilers/MinGW/include
> >   CMAKE_LIBRARY_PATH=C:/Compilers/Libs;C:/Compilers/MinGW/lib
> 
> This is how I would write it:
> INCLUDE_DIRECTORIES(C:/Compilers/Includes C:/Compilers/MinGW/include)
> TARGET_LINK_LIBRARIES( C:/Compilers/Libs
> C:/Compilers/MinGW/lib)
> 
> I mostly use *nix systems though, so I am not perfectly sure how to
> get it correct on Windows..

Thanks for the reply Yngve. I wasn't clear: I need to specify the paths
in the environment, not the CMakeLists.txt file. I use mostly *nix too,
so adding Win-specific bits to the CMakeLists.txt isn't acceptable.

I'm guessing on the *nix buildslaves I would have env vars:

   CMAKE_INCLUDE_PATH=/usr/include:/usr/myfunkylib/include
   CMAKE_LIBRARY_PATH=/usr/lib:/usr/myfunkylib/lib

using colons as separators rather than semicolons as on Windows.

Right? Or not? Should I be using one or the other for both types of
environment, since CMake is xplat? Or is my approach entirely wrong? I
would like to use CMAKE_*_PATH since those are included automatically
and I'm a lazy developer. ;) 


signature.asc
Description: PGP signature
___
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] Extra include/lib paths - multiple entries

2010-11-17 Thread Adam J Richardson
Hi list,

Is this a correct specification for multiple include/lib paths in
environment variables? If not, what should I use instead? Sometimes it
seems to work, other times not...

  CMAKE_INCLUDE_PATH=C:/Compilers/Includes;C:/Compilers/MinGW/include
  CMAKE_LIBRARY_PATH=C:/Compilers/Libs;C:/Compilers/MinGW/lib

Thanks,
Adam J Richardson


signature.asc
Description: PGP signature
___
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] fun with Boost - swap absolute library path for -L and -l?

2010-11-11 Thread Adam J Richardson
> On Thu, 11 Nov 2010 07:07:48 -0500
> cmake-requ...@cmake.org wrote:
> 
> > Any help is greatly appreciated!
> 
> I'd help if I could. Unfortunately I'm still stuck on this. Usually I
> can work around a problem given enough time, but this is a real
> stumper. Actually I do have a suggestion (see below) but it's kind of
> ugly.

This always happens. Declare complete stumpitude and almost immediately
find a solution. This is the problem: I'm linking statically and
boost_thread wants to link dynamically.

The clue is in the first error in the build log: "undefined reference
to `_imp___blablabla'". The "_imp___" part gives it away. The fix is to
define BOOST_THREAD_USE_LIB in your CMakeLists.txt:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_THREAD_USE_LIB=1")

I haven't tested it, but it builds without complaint now.

HtH,
Adam J Richardson


signature.asc
Description: PGP signature
___
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] fun with Boost - swap absolute library path for -L and -l?

2010-11-11 Thread Adam J Richardson
On Thu, 11 Nov 2010 07:07:48 -0500
cmake-requ...@cmake.org wrote:

> Any help is greatly appreciated!

I'd help if I could. Unfortunately I'm still stuck on this. Usually I
can work around a problem given enough time, but this is a real
stumper. Actually I do have a suggestion (see below) but it's kind of
ugly.

> Adam J Richardson  writes:
> > (That is, if I manually separate
> > "C:\Compilers\Libs\libboost_thread-mgw44-mt-1_44.a" into
> > "-LC:\Compilers\Libs -lboost_thread-mgw44-mt-1_44".)
> > 
> > Is there a way to have CMake do this by itself and not use absolute
> > paths? I've tried setting CMP0003 to OLD but it doesn't seem to do
> > that.  
>
> I've run into the same problem recently.
>
> It seems to be because the underlying find_library() call returns full
> paths instead of just library names.  Linking against libraries as
> inputs (specifying as full paths) instead of libraries (specifying
> name with -l) seems to lead to inconsistent results on different
> platforms.

Is this actually a CMake bug? Just after posting it occurred to me that
this might be a MinGW bug. Shouldn't g++ find the library whether you
give it "C:\Compilers\Libs\libboost_thread-mgw44-mt-1_44.a" or
"-LC:\Compilers\Libs -lboost_thread-mgw44-mt-1_44"?

> The FindBoost script does set a Boost_LIBRARY_DIRS variable, so you
> can use link_directories() to basically add the -L option.  But I'm at
> a loss as to how to properly set the -l options.

I suppose you could manually

set_target_properties(targ PROPERTIES LINK_FLAGS "${LINK_FLAGS}
-lboost_thread")

but that seems a little hackish. No, I'll poke some more at g++ and see
what I can come up with.

Regards,
Adam J Richardson


signature.asc
Description: PGP signature
___
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] Bug fix requests for the *next* release of CMake...

2010-11-11 Thread Adam J Richardson
> > If I have ignored one of your non-bug-issue points from a reply to
> > this thread, it's because it was not a bug number. If you still have
> > an issue, open a bug and reply here with its number or start a new
> > thread!!

Argh. Fine. Here's a bug number: #0011445

> Let me know if you or somebody you know wants to be that volunteer.

Unfortunately I have my fingers in way too many pies to find time to be
a maintainer. :( 


signature.asc
Description: PGP signature
___
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] Bug fix requests for the *next* release of CMake...

2010-11-05 Thread Adam J Richardson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi David,

> Replies requested.

CMake is already pretty awesome from my POV, but since you ask...

> Replies on this thread should just be a collector for bug numbers.

Afraid I don't have a bug number, but I can explain quickly.

> If you have a particular issue that you think should be fixed for
> inclusion in 2.8.4, please bring it up now.

Could you guys have a chat with the Boost guys and fix the "future
safety" of FindBoost.cmake somehow? Fiddling with ADDITIONAL_VERSIONS
is really a pain on a build farm.

Oh, and include Mateusz Loskot's FindODBC.cmake in the release?

Thanks,
Adam J Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkzT3GwACgkQSUH6dLOqvqlyOQCfaC2+BL+jkULzetoh3bduWoHU
tmMAniddpSiMW4KpeRjpS0me9C+3RNjm
=4TE7
-END PGP SIGNATURE-
___
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] Linking Boost on Linux on 64bit host and 32bit target

2010-11-04 Thread Adam J Richardson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 04 Nov 2010 04:35:57 -0400
cmake-requ...@cmake.org wrote:
> Hi all~

Hi Kent.

> I have a project using Boost that should compile for both 64bit and
> 32bit on a 64bit host.  This works fine for a 64bit target, but I
> can't get this to work for a 32bit target.

I'm having problems linking Boost too. But enough about me.

> In order to compile for 32bit on a 64bit host, I have a -D parameter
> called BUILD64.  Here is my logic to initialize this var:
> 
> if( WIN32 )
>   set( BUILD64 ${CMAKE_CL_64} )
> else()
>   option( BUILD64 "Build a 64-bit product" OFF )
>   if( BUILD64 )
>   message( STATUS "64-bit build" )
>   endif( )
> endif()

Are you sure this logic is right? It looks very odd. Does CMake set
WIN32 for a 64-bit Windows toolchain? Didn't you say you were building
on Linux?

> The syntax for finding boost is thus:
> set( Boost_USE_MULTITHREADED ON )
> set( Boost_USE_STATIC_LIBS   ON )
> set( Boost_DETAILED_FAILURE_MSG   ON )
> # set( Boost_DEBUG ON )
> find_package( Boost 1.33.0 COMPONENTS program_options )

You don't set ADDITIONAL_VERSIONS. That's probably not the problem.
IIRC, it's:

set(Boost_ADDITIONAL_VERSIONS "1.44 1.44.0")

... if you wanted to try it anyway.

Regards,
Adam J Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkzSgx0ACgkQSUH6dLOqvqmfKwCg6qttDVOXnpqHYoZwfjzUyHax
ubMAniQAF6EYxsIUYkqXPQiMwFxop6uB
=ngaQ
-END PGP SIGNATURE-
___
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] FindODBC.cmake

2010-11-02 Thread Adam J Richardson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, 01 Nov 2010 20:04:44 +
Mateusz Loskot  wrote:
> > Thanks Mateusz, that's great! I only needed to add "odbc32" to the
> > list of library names (MinGW's OBDC implementation is in
> > libodbc32.a).
> 
> I'm glad it helped and thanks for the fix suggestion by the way.
> I have just updated my FindODBC.cmake :-)

Good news. I've tested the amended FindODBC.cmake on Ubuntu 32-bit and
Win32 and it works. Could it be submitted to CMake for inclusion in
Modules?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkzP2JIACgkQSUH6dLOqvqlZCwCfTCojXurhz2p7OkAYrmgrCqD3
SU8An0w8NQgwa2zj8xSVeu+h9scj6bbM
=cXh2
-END PGP SIGNATURE-
___
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] fun with Boost - swap absolute library path for -L and -l?

2010-11-01 Thread Adam J Richardson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

I'm having some fun making link errors with the help of Boost on Win32.

With a main.cc of:

"
#include "boost/thread.hpp"

int main(int, char **) {
   boost::thread t;
   return 0;
}
"

and a CMakeLists.txt of:

"
cmake_minimum_required(VERSION "2.8")
project("orrible")
add_executable(orrible orrible/main.cc)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_ADDITIONAL_VERSIONS "1.44" "1.44.0")
find_package(Boost 1.38 REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIR})
target_link_libraries(orrible ${Boost_LIBRARIES})
"

I can produce the error:

"
CMakeFiles/orrible.dir/orrible/main.cc.obj:main.cc:(.text+0x17): undefined refer
ence to `_imp___ZN5boost6threadC1Ev'
CMakeFiles/orrible.dir/orrible/main.cc.obj:main.cc:(.text+0x2a): undefined refer
ence to `_imp___ZN5boost6threadD1Ev'
collect2: ld returned 1 exit status
make[2]: *** [orrible.exe] Error 1
make[1]: *** [CMakeFiles/orrible.dir/all] Error 2
make: *** [all] Error 2
"

Making with VERBOSE=1, we see the command line:

"
C:\Compilers\MinGW\bin\g++.exe -Wl,@CMakeFiles\orrible.dir\objects1.rsp  -o
orrible.exe -Wl,--out-implib,liborrible.dll.a -Wl,--major-image-version,0,--mino
r-image-version,0  C:\Compilers\Libs\libboost_thread-mgw44-mt-1_44.a -lkernel32
- -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 
-ladv
api32
"

Oddly enough, it links without complaint if I manually change the
command line to:

"
C:\Compilers\MinGW\bin\g++.exe
- -Wl,@CMakeFiles\orrible.dir\objects1.rsp  -oorrible.exe
- -Wl,--out-implib,liborrible.dll.a
- -Wl,--major-image-version,0,--minor-image-version,0 -LC:\Compilers\Libs
- -lboost_thread-mgw44-mt-1_44 -lkernel32 -luser32 -lgdi32 -lwinspool
- -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
"

(That is, if I manually separate
"C:\Compilers\Libs\libboost_thread-mgw44-mt-1_44.a" into
"-LC:\Compilers\Libs -lboost_thread-mgw44-mt-1_44".)

Is there a way to have CMake do this by itself and not use absolute
paths? I've tried setting CMP0003 to OLD but it doesn't seem to do that.

Thanks,
Adam J Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkzO7NQACgkQSUH6dLOqvqmM5QCgwAD9sffVFYn5/XxBD0t2KqxL
f7YAn0iOmlQ1C4OAvo/NiTVcN/Ox6sNX
=pzU7
-END PGP SIGNATURE-
___
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] FindODBC.cmake

2010-11-01 Thread Adam J Richardson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, 01 Nov 2010 14:25:24 +
"Mateusz Loskot"  wrote:
> Hi,
> You may find the one in SOCI repo useful
> http://soci.git.sf.net/
> 
> And go to src/cmake/modules

Thanks Mateusz, that's great! I only needed to add "odbc32" to the list
of library names (MinGW's OBDC implementation is in libodbc32.a).
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkzO3VEACgkQSUH6dLOqvqlcuACgl4nzrna/zg9R7NK9X2DHBJ3o
aq8AoN1b7OQeVZbfRc8X6nJAHe63OPuZ
=nbOL
-END PGP SIGNATURE-
___
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] FindODBC.cmake

2010-11-01 Thread Adam J Richardson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

Does anyone know of a good FindODBC.cmake I can grab from somewhere? My
Modules directory lacks one. :/

If not I'll write a quick one for inclusion in the new release. I'll
assume either Win32 standard or unixodbc is fine since they're
compatible with each other.

Thanks,
Adam J Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkzOqQkACgkQSUH6dLOqvqkgrwCfR9lrKOZQOwVaqWC4tWJnFDd4
jlAAn0CE5RZy+3sLWFIkLdGv42jdHaR1
=0QA1
-END PGP SIGNATURE-
___
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 hangs on new install

2010-10-28 Thread Adam J Richardson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> Message-ID:
> 

Hi Phil.

> Sono ideas nowhere nohow?

Well, I did have one idea. A wild stab in the dark, probably nothing
whatsoever to do with your issue. Apologies in advance for the low
quality of this complete guess.

> cmake -DCMAKE_TOOLCHAIN_FILE:string="%~dp0\zosport.cmake" -G"Unix
> Makefiles" .\

You are building on Windows, yes? Whenever I try to use ".\" in a
command prompt, batch file or command file on Windows, it does horrible
things. I have to substitute a full or partial path. Could this be the
issue?

Regards,
Adam J Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkzJMSoACgkQSUH6dLOqvqlOMwCdHXpEp/nIYGYd+u86GCx9PIoB
dYQAnjuKpOX44b0wsDKgQytuwGX7xxFG
=XlSY
-END PGP SIGNATURE-
___
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] config dependent defines

2010-10-18 Thread Adam J Richardson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> Your users will hate you for that, because they will not be able to
> override the compile-flags without modifying the CMakeLists.txt file.
> 
> You can set the COMPILE_DEFINITIONS_DEBUG property on individual
> targets using SET_TARGET_PROPERTIES() or on directories with
> SET_DIRECTORY_PROPERTIES.

I've been meaning to ask, Michael. Exactly how would a user expect to
override the defaults without modifying the CMakeLists.txt file? Isn't
that the easiest way to override the defaults?

Is it because of the FORCE option they will hate him?

Regards,
Adam J Richardson
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAky8Cr8ACgkQSUH6dLOqvqnYUgCfbZB1KtewDVQ/ZMdPeeYDHD6V
KFoAn3M3nETZeJlnW8yLAYt4xq6Lq7sO
=ByUi
-END PGP SIGNATURE-
___
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.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


  1   2   >