Re: [CMake] Best way to Generate String

2010-03-06 Thread Mateusz Loskot
aaron_wri...@selinc.com wrote:
> Is this the best way to generate a comment bar, such as this:
> 
> 
> 
> or this:
> 
> 
> 
> or this:
> 
> 
> 
> IF(OUTPUT_FILE_EXT MATCHES "^\\.h|\\.cpp$")
>SET(COMMENT_CHARACTER "/")
> ELSEIF(OUTPUT_FILE_EXT MATCHES "^\\.sql$")
>SET(COMMENT_CHARACTER "-")
> ELSEIF(OUTPUT_FILE_EXT MATCHES "^\\.nsi|\\.nsh$")
>SET(COMMENT_CHARACTER "#")
> ELSE()
>MESSAGE(WARNING "Unknown file type")
> ENDIF()
> 
> STRING(RANDOM LENGTH 80 ALPHABET "${COMMENT_CHARACTER}" COMMENT_BAR)


IMHO, it looks OK.


> The only reason I ask is that is seems weird to use the STRING(RANDOM 
> function to get this done.

The RANDOM is just a generalized generator.
In your case, you specify one-character alphabet
and it is still a random string of values from one element interval.
I don't see anything strange here myself.


Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
___
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] Canonical use of FindPackageHandleStandardArgs

2010-03-06 Thread Mateusz Loskot
Ryan Pavlik wrote:
> I took a quick look at your MySQL script and can offer these
> suggestions:

Ryan,

Thank you very much for your valuable comments
and I'm going to improve my scripts according them.

> - Be sure to set the plural versions of the variables (INCLUDE_DIRS, 
> LIBRARIES) to include the dependencies (these should not be cached),
> and leave the singular version for just a single path/file (these
> should be cached, as by default

Good point. I'll have to re-read the Modules/readme.txt guidelines

> In your emailed example: I presume the mylib in step 2 is different
> than the mylib in step 1 and 3/4, because otherwise you have an
> infinitely-recursive find script. Please clarify, preferably with an
> actual example.

It's an interesting observation. I'm not

> If the lib in step 2 is a dependency, convention varies, but it seems
>  prudent to me to always find dependencies quietly: this prevents
> them from showing up in lists from FeatureSummary, etc.  Anything you
> require in that dependency package should be passed to your 
> find_package_handle_standard_args call which will make the
> appropriate noises if it shouldn't be quiet and it can't be found.

OK, I think I got the point.

> If you're not doing find scripts that depend on other find scripts,

All the scripts I've written so far are standalone scripts.

> then look in the archives from a month or so ago: I posted some
> "sample" find scripts that are modern and clean in style.

You mean the mailing list archives or a repository?

> You can also take a peek at everything except FindDirectShow.cmake (I
> didn't write that one or rewrite it beyond running my cleanup app on
> it, and it's sorely in need of work) here:
> http://github.com/rpavlik/vrpn/tree/master/vrpn/cmake/

Great, I'll check it.

> Hope this helps!

Absolutely, it helps! I'm glad getting my scripts reviewed.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
___
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] Problem with CHECK_FUNCTION_EXISTS and strcasecmp

2010-03-13 Thread Mateusz Loskot
Michael Surette wrote:
> I am updating the CMake build files for a cross-platform project.  One
> of the tests is for strcasecmp for which I use CHECK_FUNCTION_EXISTS. If
> it's not found the code generates its own function by that name.
> 
> This works well with GCC under Linux, including cross-compiling with
> MinGW, as well as MinGW under Windows.
> 
> Testing this with MSVS 2008 Express under Windows XP, it fails to find
> the function but gives errors and fails when I try to build.
> 
> If I manually edit the config.h file generated by CMake so that it
> misreports that there is a strcasecmp function available it compiles well.
> 
> My conclusion is that either this function exists or a macro is defining
> it, but it's not being found by CHECK_FUNCTION_EXISTS.  I've greped
> through the header files, but find no reference to it.
> 
> How can I find this function reliably?

CMake macro is right because Visual C++ does not define strcasecmp.
This function is defined by POSIX (not even C99). Visual C++ does not
implement POSIX. For Visual C++, you should look for equivalents, it is:
_stricmp or _strnicmp

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
___
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 and boost

2010-03-19 Thread Mateusz Loskot
Nehme Bilal wrote:
> Hello all,
>
> I am a not very familiar with Cmake but I am starting a
> new project based on cmake and trying to add boost
> libraries to my project.
> Fortunately boost now provide a cmake configuration

FYI, the CMake configuration for Boost is unofficial.
No decision has been made by Boost to officially include it
or when it would happen.

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

___
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] Need info on how cmake messages output is formatted

2018-09-07 Thread Mateusz Loskot
On Fri, 7 Sep 2018 at 20:08, Martin Weber  wrote:
> Any pointers to cmake sources are also welcome.

AFAIC, the message is printed via
cmMessenger::DisplayMessage
called by
cmMessenger::IssueMessage
which is typically called by
cmake::IssueMessage

So, searching the CMake sources for
invocations of ->IssueMessage
and uses of cmake::MessageType and its members eg. cmake::FATAL_ERROR
may help to collect a picture on how messages are composed.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] FindMPI.cmake in 3.11.4

2018-09-14 Thread Mateusz Loskot
On Fri, 14 Sep 2018 at 20:57, Burlen Loring  wrote:
> why did they MPI_C_LIBRARIES and MPI_C_INCLUDE_DIRS/PATH get changed from 
> cache variables to not chached variables?

Possibly, that change was due to clean up to correct the module
according to the actual CMake conventions

https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#standard-variable-names

"""
Xxx_INCLUDE_DIRS
  The final set of include directories listed in one variable for use
by client code. This should not be a cache entry.

Xxx_LIBRARIES
  The libraries to link against to use Xxx. These should include full
paths. This should not be a cache entry.
"""

Also, find_package_handle_standard_args description also gives similar
hint on the naming:

https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html
"""
Therefore these should typically be cache entries such as FOO_LIBRARY
and not output variables like FOO_LIBRARIES.
"""

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] How to have Visual Studio 15 2017 actually use a 64 bit toolchain.

2018-09-21 Thread Mateusz Loskot
On Fri, 21 Sep 2018 at 16:13, Michael Jackson
 wrote:
>
> For those that want to actually use Visual Studio 15 2017 is there anything 
> in CMake or an environment variable that can be set?

Isn't host=x64 for that purpose?

https://cmake.org/cmake/help/v3.12/variable/CMAKE_GENERATOR_TOOLSET.html

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Mateusz Loskot
On Thu, 27 Sep 2018 at 23:34, Dorier, Matthieu  wrote:
>
> When I call find_package(XercesC REQUIRED) and XercesC is not in a standard 
> location, I have to set XercesC_INCLUDE_DIR to its include directory and 
> XercesC_LIBRARY to the location of the library.

Correct. If Find-module can not guess, you help it by setting
FOO_INCLUDE_DIR and FOO_LIBRARY.

> If I set XercesC_LIBRARY to the directory containing the library (not to the 
> fullpath of the library itself), cmake finds XercesC but sets 
> XercesC_LIBRARIES to the folder instead of the library, and the same for the 
> XercesC::XercesC target. It seems I truly have to set XercesC_LIBRARY to the 
> name of the library rather than the path to the folder containing it, which 
> kinds of defies the point of find_package...

Find-modules are guessers and as such they do not guarantee they will
find anything.
Sometimes you need to help it, by setting some standard variables,
https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html

Xxx_INCLUDE_DIR - Where to find headers for using the Xxx library.
Xxx_LIBRARY - The path of the Xxx library

Then, Find-module can also perform extra checks of the explicitly
specified library
for eg.  version, symbols, functions, etc.

> I use to rely on a custom FindXercesC.cmake file that was using XercesC_ROOT 
> to figure all this out.
> Is there any way to do the same here?

There seem to be no Xxx_ROOT_DIR handled by this module
https://cmake.org/cmake/help/latest/module/FindXercesC.html

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

Powered by www.kitware.com

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

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

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

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

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


[CMake] Writing foo-config.cmake with find_dependency

2018-10-01 Thread Mateusz Loskot
Hi,

After 10+ years of maintaining a horrible kind o CMake configuration
for a project I maintain, SOCI [1], I'm in the middle of rewriting it [2]
according to the modern CMake principles. At least, I'm trying to.

The library has number of dependencies on third-party libraries,
namely database access client libraries. I've reached the point
where I need to 'list' those dependencies in soci-config.cmake [3]
Namely, I need to make friend with find_dependency.

In SOCI, I maintain number of Find-modules, eg. FindSQLite3.cmake,
FindOracle.cmake, etc. Those are also an ancient CMake scripts,
but I think my problem/question is orthogonal to rewriting those to
target-aware modules or keep those old-style w/ FOO_LIBRARIES, etc.

Now, if I have a custom `FindSQLite3.cmake` module and I do
target_link_libraries(soci_sqlite3 PUBLIC ${SQLITE3_LIBRARIES})
in CMakeLists.txt of the SOCI library, then in soci-config.cmake I do
find_dependency(SQLite3)
Is that correct?

Now, am I supposed to deploy the FindSQLite3.cmake along
soci-config.cmake to match the ${SQLITE3_LIBRARIES}?
What if a user of SOCI (or even CMake distribution) comes with
custom FindSQLite3.cmake which actually defines targets
instead of old-style variables
or defines SQLITE_LIBRARIES (without 3 in  SQLITE)?

How to handle such situations?
What should I read to wrap my head around the find_dependency
for my use case?

[1] https://github.com/SOCI/soci/
[2] https://github.com/mloskot/soci/tree/ml/modern-cmake
[3] https://github.com/mloskot/soci/blob/ml/modern-cmake/cmake/soci-config.cmake

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Writing foo-config.cmake with find_dependency

2018-10-04 Thread Mateusz Loskot
On Mon, 1 Oct 2018 at 21:45, Mateusz Loskot  wrote:
>
> The library has number of dependencies on third-party libraries,
> namely database access client libraries. I've reached the point
> where I need to 'list' those dependencies in soci-config.cmake [3]
> Namely, I need to make friend with find_dependency.
>
> In SOCI, I maintain number of Find-modules, eg. FindSQLite3.cmake,
> FindOracle.cmake, etc. Those are also an ancient CMake scripts,
> but I think my problem/question is orthogonal to rewriting those to
> target-aware modules or keep those old-style w/ FOO_LIBRARIES, etc.
>
> Now, if I have a custom `FindSQLite3.cmake` module and I do
> target_link_libraries(soci_sqlite3 PUBLIC ${SQLITE3_LIBRARIES})
> in CMakeLists.txt of the SOCI library, then in soci-config.cmake I do
> find_dependency(SQLite3)
> Is that correct?
>
> Now, am I supposed to deploy the FindSQLite3.cmake along
> soci-config.cmake to match the ${SQLITE3_LIBRARIES}?
> What if a user of SOCI (or even CMake distribution) comes with
> custom FindSQLite3.cmake which actually defines targets
> instead of old-style variables
> or defines SQLITE_LIBRARIES (without 3 in  SQLITE)?
>
> How to handle such situations?


Or, what to put into soci-config.cmake to screw things up the least,
to handle easiest scenario possible?

I'll appreciate any insights.

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

Powered by www.kitware.com

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

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

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

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

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


[CMake] Finding Boost in versioned layout on Linux

2018-10-24 Thread Mateusz Loskot
Hi,

I know the version layout of Boost build is preferred or
even specific to Windows, but I like it in general, ie. on Linux.
It lazily allows me to get everything built with single command:

b2 variant=debug,release address-model=32,64 --layout=versioned stage

The versioned layout impose some challenges while find_package-ing
at least I've experienced it using FindBoost.cmake from latest CMake 3.12.

For example, running CMake in Linux environment with GCC 5.5.0 for

find_package(Boost 1.65.0 REQUIRED COMPONENTS system)

will attempt to search for

...
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1420 ]
guessed _boost_COMPILER = -gcc55
...
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1760 ]
Searching for SYSTEM_LIBRARY_RELEASE:
boost_system-gcc55-mt-1_69;boost_system-gcc55-mt;boost_system-mt-1_69;boost_system-mt;boost_system
...

The issue is that b2  generated names like

libboost_system-gcc5-mt-d-x64-1_69.a

So, I had to bend CMake this way to find Boost for me:

cmake -DBoost_COMPILER=-gcc5 -DCMAKE_CXX_COMPILER_ARCHITECTURE_ID=x64 ..

I'm not asking any specific questions here.
I just thought that might be helpful to other users of FindBoost.cmake.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Finding Boost in versioned layout on Linux

2018-10-24 Thread Mateusz Loskot
On Wed, 24 Oct 2018 at 22:17, Brad King  wrote:
> On 10/24/2018 01:22 PM, Mateusz Loskot wrote:
> > So, I had to bend CMake this way to find Boost for me:
> >
> > cmake -DBoost_COMPILER=-gcc5 -DCMAKE_CXX_COMPILER_ARCHITECTURE_ID=x64 ..
>
> See these issues:
>
> https://gitlab.kitware.com/cmake/cmake/issues/17701
> https://gitlab.kitware.com/cmake/cmake/issues/17702

Yes, I'm aware [1] of these, but thank you for reminder.
I meant this post as a work around related to #17701

[1] https://gitlab.kitware.com/cmake/cmake/issues/17701#note_398070

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] [ANNOUNCE] CMake 3.13.0-rc2 is ready for testing

2018-10-25 Thread Mateusz Loskot
On Thu, 25 Oct 2018 at 17:06, Robert Maynard  wrote:
>
> CMake 3.13 Release Notes
> 
> [...]
>
> Modules
> ---
> [...]

FindBoost.cmake changes seem to be missing from this section

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] [ANNOUNCE] CMake 3.13.0-rc2 is ready for testing

2018-10-25 Thread Mateusz Loskot
On Thu, 25 Oct 2018 at 17:12, Brad King  wrote:
> On 10/25/2018 11:10 AM, Mateusz Loskot wrote:
> > FindBoost.cmake changes seem to be missing from this section
>
> We don't record every version update or implementation change
> in release notes.  The interface of the module has not changed.

Got it. Sorry for noise.

-- 
Mateusz Loskot, http://mateusz.loskot.net
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] CMake Can't Find Boost.Filesystem in Docker Container

2018-10-28 Thread Mateusz Loskot
On Sun, 28 Oct 2018 at 11:26, Osman Zakir  wrote:
> In the Dockerfile for my project, the build process can't go any farther from 
> the point where I'm trying to build the Jinja2Cpp library.  CMake isn't able 
> to find Boost.Filesystem, but it's still able to build the library and write 
> the files to "/usr/local/Jinja2Cpp/build" just fine.

TL;TR: That sounds like Boost.Filesystem is not required, just remove
from `find_package` COMPONENTS list.

First, I'd ensure the build works locally, not in any docker image.
If it does not work, request verbose output from `FindBoost.cmake` output b

set(Boost_DEBUG ON)
find_package(Boost ...)

Read it carefully and compare what details the module determines, if
they are correct.
For example, it may detect -gcc55- tag while your environment has
libboost_filesystem...-gcc5-...lib, etc.
There are many details involved and many places where it can get wrong.
For instance, see some listed here
https://github.com/boostorg/gil/blob/develop/CONTRIBUTING.md
search for section
"TIP: If CMake is failing to find Boost libraries, you can try a few hacks:"


Your report above is very general, not sufficient at all to pin point
where may possible problem be.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] CMake Can't Find Boost.Filesystem in Docker Container

2018-10-28 Thread Mateusz Loskot
On Sun, 28 Oct 2018 at 12:44, Osman Zakir  wrote:
>
> The build does work locally, and I don't get that particular error either.  
> I'm using Windows 10 Home on my local machine (which also means I have to use 
> Docker Toolbox with VirtualBox, since the Home edition doesn't have Hyper-V). 
>  I can't use Windows containers in Docker images with Docker Toolbox, so I'm 
> having to use a Linux one.  Ubuntu 18.04 in my case.

Install Ubutun 18.04 on Virtual Box and try things out there.

FindBoost.cmake may be moody - it may fail due to many many things.
Boost deployment and FindBoost differs significantly on Windows vs Linux.
Boost can be installed using various naming conventions or layouts,
eg. versioned layout.
CMake changes also affect FindBoost.cmake at times.
Just go to https://gitlab.kitware.com/cmake/cmake/ and search for
FindBoost to see what is happening.
You will have to dig the issue deep and the digging may be difficult
and frustrating.
That is why I would work things on Linux locally (VM) first - Docker
just adds up to the overall complexity.

I see no way to solve your problem for you.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] About FindBoost.cmake

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 00:29, Osman Zakir  wrote:
>
> I noticed that FindBoost.cmake has "-d" set as the Boost debug ABI tag even 
> though the Boost libraries actually use "-gd".

-d comes from variant=debug option when you build Boost
-g comes from runtime-debugging=on

You've got it explained here
https://www.boost.org/doc/libs/1_68_0/more/getting_started/windows.html

> I installed the latet release of CMake just now, which has Boost 1.68.0 
> listed as a test version, and it has this problem too.

IMO, what you describe is not a problem.
-gd is perfectly valid combination, and on Windows where versioned
layout of Boost is the default, you will see names like

d:\boost.win\stage\lib>ls -1 *file*
libboost_filesystem-vc141-mt-gd-x32-1_69.lib
libboost_filesystem-vc141-mt-gd-x64-1_69.lib
libboost_filesystem-vc141-mt-x32-1_69.lib
libboost_filesystem-vc141-mt-x64-1_69.lib

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] About FindBoost.cmake

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 10:17, Osman Zakir  wrote:
>
> Yes, but this might also be why it can't find more than "some" of the Boost 
> libraries.  It looks for "-d" even though I'm using the "-gd" ones.

How do you know it looks for -d?
Sorry, but you are not showing any cmake command line,
any bit of your CMakeLists.txt how you invoke find_package,
and nothing from output you are getting.

set(Boost_DEBUG ON)
find_package(Boost 1.68.0 REQUIRED COMPONENTS filesystem)

then, in a sample project

mkdir build
cd build
cmake ..

and it looks for -gd

-- [ C:/Program
Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1430 ]
_boost_MULTITHREADED = -mt
-- [ C:/Program
Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1506 ]
_boost_RELEASE_ABI_TAG = -
-- [ C:/Program
Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1508 ]
_boost_DEBUG_ABI_TAG = -gd

FindBoost is a complex animal, it deals with tons of cases, it
frequently stops working.
So, crystal sphere -based investigation does not quite apply :)

BTW, pease respond to the mailing list, not privately.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Installing CMake in Ubuntu Linux from command-line via wget

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 10:22, Osman Zakir  wrote:
>
> I want to install the latest release version of CMake in my Ubuntu Docker 
> image (from the Dockerfile), but I'm having trouble.  I have this command:
>
> "
> RUN wget https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.tar.gz  \
>&& tar cmake-3.12.3-Linux-x86_64.tar.gz  \
>&& rm -rf cmake-3.12.3-Linux-x86_64.tar.gz  \
>&& cd cmake-3.12.3-Linux-x86_64  \
>&& apt-get install

Hmm, are you cerctain apt-get is capable of installing from .tar.gz?

wget -O cmake-linux.sh
https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.sh
sudo sh cmake-linux.sh -- --skip-license --prefix=/usr/local
cmake --version

I guess, it may be a good idea to update https://cmake.org/install/

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] About FindBoost.cmake

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 10:24, Mateusz Loskot  wrote:
> On Tue, 30 Oct 2018 at 10:17, Osman Zakir  wrote:
> >
> > Yes, but this might also be why it can't find more than "some" of the Boost 
> > libraries.  It looks for "-d" even though I'm using the "-gd" ones.
>
> How do you know it looks for -d?
> Sorry, but you are not showing any cmake command line,
> any bit of your CMakeLists.txt how you invoke find_package,
> and nothing from output you are getting.
>
> set(Boost_DEBUG ON)
> find_package(Boost 1.68.0 REQUIRED COMPONENTS filesystem)
>
> then, in a sample project
>
> mkdir build
> cd build
> cmake ..
>
> and it looks for -gd
>
> -- [ C:/Program
> Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1430 ]
> _boost_MULTITHREADED = -mt
> -- [ C:/Program
> Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1506 ]
> _boost_RELEASE_ABI_TAG = -
> -- [ C:/Program
> Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1508 ]
> _boost_DEBUG_ABI_TAG = -gd

I've run some test.

I've got Boost (current develop branch) build in stage directory, as
you see it is --layout=versioned

D:\boost.win\stage\lib (develop -> origin)  ls -1 *system*
libboost_filesystem-vc141-mt-gd-x32-1_69.lib
libboost_filesystem-vc141-mt-gd-x64-1_69.lib
libboost_filesystem-vc141-mt-x32-1_69.lib
libboost_filesystem-vc141-mt-x64-1_69.lib
libboost_system-vc141-mt-gd-x32-1_69.lib
libboost_system-vc141-mt-gd-x64-1_69.lib
libboost_system-vc141-mt-x32-1_69.lib
libboost_system-vc141-mt-x64-1_69.lib

In test project D:\_\workshop\test_boost\CMakeLists.txt

set(Boost_ADDITIONAL_VERSIONS 1.69)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.69.0 REQUIRED COMPONENTS filesystem system)

Then, configure:

D:\_\workshop\test_boost\_build.vs2017 cmake -A x64
-DBOOST_ROOT:PATH=D:\boost.win ..
-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.15.26730.0
-- The CXX compiler identification is MSVC 19.15.26730.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft
Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft
Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
-- works
...
-- Boost version: 1.69.0
-- Found the following Boost libraries:
--   filesystem
--   system
...

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] About FindBoost.cmake

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 10:54, Mateusz Loskot  wrote:
> [...]
> D:\_\workshop\test_boost\_build.vs2017 cmake -A x64
> -DBOOST_ROOT:PATH=D:\boost.win ..
> -- Building for: Visual Studio 15 2017
> -- The C compiler identification is MSVC 19.15.26730.0
> -- The CXX compiler identification is MSVC 19.15.26730.0
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft
> Visual 
> Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft
> Visual 
> Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
> -- works
> ...
> -- Boost version: 1.69.0
> -- Found the following Boost libraries:
> --   filesystem
> --   system
> ...

I forgo to mention above I run

cmake --version
cmake version 3.12.2


-- 
Mateusz Loskot, http://mateusz.loskot.net
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] About FindBoost.cmake

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 12:09, Osman Zakir  wrote:
>
> Nice. So what command did you run to configure CMake?

I included full cmake invocation command line in my response you replied to.
Just re-read it below.

Once again, please, respond to cmake@cmake.org mailing list, not privately!

ML

> 
> From: CMake  on behalf of Mateusz Loskot 
> 
> Sent: Tuesday, October 30, 2018 2:55 PM
> To: cmake@cmake.org
> Subject: Re: [CMake] About FindBoost.cmake
>
> On Tue, 30 Oct 2018 at 10:54, Mateusz Loskot  wrote:
> > [...]
> > D:\_\workshop\test_boost\_build.vs2017 cmake -A x64
> > -DBOOST_ROOT:PATH=D:\boost.win ..
> > -- Building for: Visual Studio 15 2017
> > -- The C compiler identification is MSVC 19.15.26730.0
> > -- The CXX compiler identification is MSVC 19.15.26730.0
> > -- Check for working C compiler: C:/Program Files (x86)/Microsoft
> > Visual 
> > Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
> > -- Check for working C compiler: C:/Program Files (x86)/Microsoft
> > Visual 
> > Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
> > -- works
> > ...
> > -- Boost version: 1.69.0
> > -- Found the following Boost libraries:
> > --   filesystem
> > --   system
> > ...
>
> I forgo to mention above I run
>
> cmake --version
> cmake version 3.12.2
>
>
> --
> Mateusz Loskot, http://mateusz.loskot.net


-- 
Mateusz Loskot, http://mateusz.loskot.net
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] About FindBoost.cmake

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 12:25, Osman Zakir  wrote:
>
> So just "make -A x64 -DBOOST_ROOT:PATH=D:\boost.win"?


No. The comand I pasted reads

"cmake -A x64 -DBOOST_ROOT:PATH=D:\boost.win"
^^^ cmake not make


> Speaking of x64 vs. x86, I think CMake needs to be able to include the option 
> to build for either x86 or x64 in the same VS project file.  I read on the 
> CMake forums that this is being worked on, but what's the story on that?

Sorry, no idea what you talking about. Perhaps it's better to read the
docs first:

-A 
Specify platform name if supported by generator.


For this paricular VS use case, I could have used

cmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT:PATH=D:\boost.win ..
which should be equivalent to
cmake -A x64 -DBOOST_ROOT:PATH=D:\boost.win


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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Installing CMake in Ubuntu Linux from command-line via wget

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 12:31, Raymond Wan  wrote:
>
> If you insist on the latest version, then where you have
> "apt-get install" should be replaced with commands that
> Mateusz has already said.  That is, the steps mentioned here:
>
> https://cmake.org/install/

Raymond, the web page explains how to build from sources.
That is the 3rd way of installing CMake.

1. apt-get install cmake
2. Bash installer or manually unpacking .tar.gz. eg.
cmake-3.12.3-Linux-x86_64.tar.gz

wget -O cmake-linux.sh
https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.sh
sudo sh cmake-linux.sh -- --skip-license --prefix=/usr/local

3. Build from sources as per https://cmake.org/install/

> (Perhaps the cmake-linux.sh that Mateusz mentioned works...I
> personally haven't installed a version from cmake.org for a
> very long time, so I wouldn't know.)

I can assure you the option 2. works perfectly

I use it daily to juggle CMake on number of Linux environments

https://github.com/mloskot/wsl-config/blob/master/wsl/scripts/install-cmake-latest.sh

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Installing CMake in Ubuntu Linux from command-line via wget

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 12:59, Osman Zakir  wrote:
>
> I put "apt-get install" in the CMake folder that I got from unpacking the 
> .tar file.  Would that not install the CMake in that directory?

No!
The .tar.gz is not a .deb package, it does not contain a .deb package.

You need to read about apt and .deb packages

> What do I have to do in order for it to install the CMake executable I 
> downloaded

Unpack the .tar.gz, that's it.
Optionally, copy somewhere you prefer in your Linux environment.

> and also add it to my PATH?

export PATH=/path/where/you/unpacked/cmaketarg/bin:$PATH


Alternatively,
iIf you stopped stubbornly trying the apt-get and
if you tried my suggestion

wget -O cmake-linux.sh
https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.sh
sudo sh cmake-linux.sh -- --skip-license --prefix=/usr/local

you would get CMake installed in the standard prefix /usr/local
with cmake executable deployed in /usr/local/bin/cmake
and having /usr/local/bin typically in PATH
you would get cmake in your PATH out of the box.

Just forget about using apt-get with the downloaded .tar.gz, forget it!
Or, learn about Debian packages, apt, etc. just not here!

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Installing CMake in Ubuntu Linux from command-line via wget

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 13:26, Osman Zakir  wrote:
>
> I thought I'd already said that I can't use sudo or anything else with root 
> access privileges.

I forgot about this constraint.

Then, make use of the custom --prefix

mkdir $HOME/usr
wget -O cmake-linux.sh
https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.sh
sh cmake-linux.sh -- --skip-license --prefix=$HOME/usr
export PATH=$HOME/usr/bin:$PATH

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Docker container can't find cmake executable

2018-10-30 Thread Mateusz Loskot
On Tue, 30 Oct 2018 at 18:10, Osman Zakir  wrote:
>
> So I have to do "ENV export PATH=$HOME/usr/bin:$PATH"?  Is that what you mean?

Your question is off-topic here. Try Docker forums, StackOverflow, ...

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

Powered by www.kitware.com

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

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

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

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

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


[CMake] [MR2579] FindBoost: Improve compiler prefix detection for GCC 5+ and clang 4+

2018-11-08 Thread Mateusz Loskot
Hi,

FYI, I proposed changes to FindBoost that may be of interest of users
relying on the upcoming Boost 1.69 ie. current master or develop branches

https://gitlab.kitware.com/cmake/cmake/merge_requests/2579

Feedback is welcome.

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

Powered by www.kitware.com

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

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

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

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

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


[CMake] [MSVC] Setting warning level on target feels like long-time bug

2018-12-08 Thread Mateusz Loskot
Hi,

I define a target for a library, and set warning level for MSVC compiler:

target_compile_options(mylib PRIVATE $<$:-W4>)

Although this works well, the compiler throws this warning:

cl : Command line warning D9025: overriding '/W3' with '/W4'

I want to get rid of this warning, so I fix it this way

if(MSVC)
  string(REGEX REPLACE "/W3" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
  string(REGEX REPLACE "-W3" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()

target_compile_options(mylib PRIVATE $<$:-W4>)

This works like charm, but leaves me with sour feeling that
something is not right here.The REGEX REPLACE clean-up
has become such a habit, it's almost canonical thing I do in
all my CMake-based projects.

Shouldn't CMake drop the default when target_compile_options is called?
Is this behaviour by design, for MSVC?
Could anyone help me to understand if this is actually a bug
or am I misunderstanding anything?

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

Powered by www.kitware.com

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

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

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

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

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


[CMake] Can CXX_CLANG_TIDY use .clang-tidy file?

2018-12-08 Thread Mateusz Loskot
Hi,

Am I correct clang-tidy run via CXX_CLANG_TIDY
ignores .clang-tidy configuration file?

I've tried number of ways to help it find the file,
i.e. copied the file to binary directories from where it seems run via
usr/local/bin/cmake -E __run_co_compile --tidy=/usr/bin/clang-tidy-7

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] [MSVC] Setting warning level on target feels like long-time bug

2018-12-09 Thread Mateusz Loskot
On Sun, 9 Dec 2018 at 12:14, Craig Scott  wrote:
>
> From what I understand from a very limited quick search just now,
> it seems that /W3 is the default warning level for Visual Studio

Yes, it is the default level indeed.

> but CMake explicitly adds it as a default compiler flag in 
> CMAKE__FLAGS_INIT.
> This makes me wonder if it has always been the default, otherwise it isn't 
> clear why it was deemed necessary to add it.

Yes, I'd suspect it was added as 'just in case'  too eagerly.

> More to the point, unless there's a reason not to, perhaps we could consider 
> removing it from the default flags CMake sets.
> I think this would largely address the situation you're describing and 
> shouldn't actually change the behavior of existing projects.

Yes, it should be removed.
Unless I'm missing an important reason behind the explicit -W3.

No, "This has been the default since CMake began" [1], is not enough
rationale to keep it.

In the old times of manual editing of CMAKE_CXX_FLAGS, it was not a huge deal
- in fact, fiddling with CMAKE_CXX_FLAGS was quite canonical way of
doing things..
But with the advent of target_compile_options, the string call
requirement is just unacceptable.

[1] https://gitlab.kitware.com/cmake/cmake/issues/18317

> I've CC'ed the developer's list and suggest that follow-up discussion should 
> occur there.

FYI, I've just subscribed to the developer's list.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] [MSVC] Setting warning level on target feels like long-time bug

2018-12-09 Thread Mateusz Loskot
On Sun, 9 Dec 2018 at 14:09, Marc CHEVRIER  wrote:
>
> I think the discussion is shifting from the initial problem which was 
> unwanted warning « Command line warning D9025: overriding '/W3' with '/W4' ».

I disagree with your opinion.
Fixing just the warning would be a symptomatic treatment.

> Changing defaults is not a good idea from my point of view because relying on 
> defaults can be problematic if Microsoft decide to change the default 
> behaviour.

Although I think it is a long shot at something that is (highly)
unlikely to change, YAGNI consideration,
I understand CMake developers may be reluctant to change the long-time defaults.

> The real question is how to manage cleanly target specific flags overriding 
> global or directory defaults?

From end-user point of view (I have not checekd CMake implementation),
I'd either do not explicitly set -W defaults or strip any -W option
prior re-setting
with (possibly) new value passed to target_compile_options.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Can CXX_CLANG_TIDY use .clang-tidy file?

2018-12-12 Thread Mateusz Loskot
On Mon, 10 Dec 2018 at 18:31, Bill Hoffman via CMake  wrote:
> On 12/8/2018 7:47 PM, Mateusz Loskot wrote:
> >
> > Am I correct clang-tidy run via CXX_CLANG_TIDY
> > ignores .clang-tidy configuration file?
> >
> > I've tried number of ways to help it find the file,
> > i.e. copied the file to binary directories from where it seems run via
> > usr/local/bin/cmake -E __run_co_compile --tidy=/usr/bin/clang-tidy-7
>
> I don't think anything was done to turn that off on purpose.  Can you
> run the command from the command line and get it to work?  If so, you
> should be able to get the same arguments to the clang tidy that CMake is
> running.

Bill,

Thank you for the hint. It helped to discover it turns out to be a silly issue.

My .clang-tidy listed checks that would issue no warnings for the
target source files :)

Since, apparently, clang-tidy via
/usr/local/bin/cmake -E __run_co_compile --tidy=/usr/bin/clang-tidy-7
runs in quiet mode, while when run directly /usr/bin/clang-tidy-7,
it outputs a brief summary even if no analysis warnings are issued.
That left me with impression, .clang-tidy is not used.

To summary, for records and others looking for similar answers, here
is what works for me:

1. .clang-tidy is in source root directory

2. Top-level CMakeLists.txt

```
find_program(CLANG_TIDY
  NAMES clang-tidy-7 clang-tidy-6.0 clang-tidy-5.0 clang-tidy-4.0 clang-tidy
```

and

```
set_target_properties(test_headers_all_in_one
  PROPERTIES
CXX_CLANG_TIDY ${CLANG_TIDY})
```

Notice, since checks are specified in .clang-tidy configuration file,
no arguments need to be specified to clang-tidy.

3. Build analysed target

```
$ cd project
$ cmake -S . -B _build -DBoost_ARCHITECTURE=-x64 ..
$ VERBOSE=1 cmake --build _build --target test_headers_all_in_one

# alternative to the last command may be

$ cd _build
$ VERBOSE=1 make test_headers_all_in_one
```

Both, will run clang-tidy with checks read from .clang-tidy config,
and output of any warnings.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] target_link_libraries not populating INCLUDE_DIRECTORIES?

2018-12-21 Thread Mateusz Loskot
On Fri, 21 Dec 2018, 09:30 Ciccio Pasticcio  TARGET_INCLUDE_DIRECTORIES(PRIVATE private/ PUBLIC inc/)
> ...
> The manpage of TARGET_LINK_LIBRARIES says:
> PRIVATE and PUBLIC items will populate the INCLUDE_DIRECTORIES
<https://cmake.org/cmake/help/v3.13/prop_tgt/INCLUDE_DIRECTORIES.html#prop_tgt:INCLUDE_DIRECTORIES>
property
of .

Yea, but are missing the actual  from your call.

Mateusz Loskot, mate...@loskot.net
(Sent from mobile)
-- 

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] Setting MSVC runtime type on CMake command line?

2019-01-12 Thread Mateusz Loskot
On Sat, 12 Jan 2019 at 14:20, Osman Zakir  wrote:
>
> I tried to set the runtime to static by passing the "-DMSVC_RUNTIME_TYPE=/MT"
> argument when running CMake, but it generated a warning

Could you paste link to the CMake docs page where this variable is described?

> So what's the correct way to do this?

Modify C/C++ flags. For example, something along these lines

string(REGEX REPLACE "/MD" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REGEX REPLACE "-MT" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
target_compile_options(myexe PRIVATE $<$:-MT>)

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Remove compilation flags for a given target

2019-04-04 Thread Mateusz Loskot
On Thu, 4 Apr 2019 at 14:47, Benjamin Orgogozo  wrote:
>
> If I'm right (I'm far from being a cmake expert) there are two ways to
> define "global" compilation flags:
> 1- set the CXX_COMPILE_FLAGS variable;
> 2- use add_compile_options($<$:-WMyFavouriteWarning).

The list should rather be, in preference/priority order

1. https://cmake.org/cmake/help/latest/command/target_compile_options.html
2. add_compile_options

And, if you really, really need
3. append to CMAKE_CXX_FLAGS

> Since I don't want to *add* a compilation flags but remove one, I would
> like to retrieve the properties of the target
> (get_target_property(my_compilation_flags TARGET COMPILE_FLAGS)), and
> then modify those and use it to set the properties of the target.
>
> Two questions for me remain:
> 1- How do I get *all* the compilation flags used for a target?
> get_target_property doesn't return flags is CXX_COMPILE_FLAGS nor those
> added by add_compile_options.

Are you certain you've got the variable name right?
https://cmake.org/cmake/help/latest/search.html?q=CXX_COMPILE_FLAGS

> 2- How do I *replace* compilation flags and don't *add* compilation
> flags? Both target_compile_options and set_target_properties seems to
> *add* flags and don't replace.

See  https://cmake.org/pipermail/cmake/2018-December/068716.html

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Boost 1.70.0 -- FindBoost issues? No linker libraries found

2019-04-15 Thread Mateusz Loskot
On Tue, 16 Apr 2019 at 01:01, Andrew Maclean  wrote:
>
>  In build.ninja all the requested linker libraries are there e.g. 
> /usr/local/lib/libboost_date_time.so>
> Boost 1.70
> When using Boost 1.70 all I get in the CMakeLists.txt file are entries like:
> //The directory containing a CMake configuration file for boost_date_time.
> boost_date_time_DIR:PATH=/usr/local/lib/cmake/boost_date_time-1.70.0

Installation of Boost 1.70 generates and deploys a brand new BoostConfig.cmake
machinery which is still being tested.

Try setting -DBoost_NO_BOOST_CMAKE=ON to get the old FindBoost.cmake behaviour
https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake#L238

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] c++2a

2019-05-07 Thread Mateusz Loskot
On Tue, 7 May 2019 at 01:15, Angel Campoverde
 wrote:
>
> I am looking at:
>
> https://cmake.org/cmake/help/v3.14/prop_tgt/CXX_STANDARD.html
>
> and I see that I can pass 20, for c++20. However I do not have that in my 
> compiler,
> I only have c++2a and gnu++2a, this means that CMake goes back to c++17

No, it doesn't mean that.

The valid values documented for CXX_STANDARD are CMake generalisation
and not what is directly passed via -std= or /std: or whatever option
your compiler uses.

If you run this cmake command
cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=OFF ..
and then
VERBOSE=1 make
you will clearly see that CMake generated the compiler
command lines with -std=c++2a

IFF, you are using version of GCC or clang that supports c++2a, obviously
(i.e. GCC 8/clang 6 or later. I'm not entirely confident about clang)

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] c++2a

2019-05-07 Thread Mateusz Loskot
On Tue, 7 May 2019 at 18:24, Angel Campoverde
 wrote:
>
> No, It does not work, I told Cmake to use c++ 20, but it still goes back to 
> c++17. You can see what I get here:
>
> https://pastebin.com/5ub18cMU

Next time, please specify what compiler you are using.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] c++2a

2019-05-07 Thread Mateusz Loskot
On Tue, 7 May 2019 at 20:38, Angel Campoverde
 wrote:
> Next time please ask what computer I am using.

CMake results are intrinsically compiler-specific.
Your issue is compiler-specific.

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

p.s. Please, stop it.
-- 

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 guidelines and design patterns - recommendations?

2019-07-11 Thread Mateusz Loskot
https://crascit.com/professional-cmake/

And search for Daniel Pfeifer's talk on YouTube

Mateusz Loskot, mate...@loskot.net
(Sent from mobile, may suffer from top-posting)

On Thu, 11 Jul 2019, 12:56 hex,  wrote:

> hello community,
>
>
> Does anyone have a book recommendation for modern CMake with focus on
> design patterns?
>
>
> thank you
>
> --
>
> 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 locations for boost in cmake

2019-10-24 Thread Mateusz Loskot
On Thu, 24 Oct 2019 at 19:05, Mahmood Naderan via CMake  wrote:
>
> I have read https://cmake.org/cmake/help/v3.0/module/FindBoost.html which 
> states some variables for boost library.
> I want to know where should I set these variables. For example, in the 
> terminal, I have written
>
> $ export Boost_NO_SYSTEM_PATHS=ON

When you read word `variables` in CMake documentation,
it means CMake variables (also known as cache entries).
Otherwise, it would be qualified using word `environment`.

The CMake variables can be set via command line option -D [1]

[1] https://cmake.org/cmake/help/latest/manual/cmake.1.html

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Alternative locations for boost in cmake

2019-10-24 Thread Mateusz Loskot
On Thu, 24 Oct 2019 at 20:44, Mahmood Naderan  wrote:
>
> Thank you. I tried this command:
>
> cmake -DBoost_NO_SYSTEM_PATHS=ON 
> -DBOOST_INCLUDE_DIR=/storage/users/mnaderan/boost_1_65_1/build/include/ 
> -DBoost_LIBRARY_DIRS=/storage/users/mnaderan/boost_1_65_1/build/lib/ 
> -DBoost_ADDITIONAL_VERSIONS=1.65.1 ..
>
> The paths are correct as you can see below:
>
> $ ls /storage/users/mnaderan/boost_1_65_1/build/lib/
> libboost_atomic.a  libboost_math_tr1l.so.1.65.1
> libboost_atomic.so libboost_math_tr1.so

>
> However, the cmake command fails with the following error message
>
> -- Could NOT find Boost
> CMake Warning at 
> /storage/users/mnaderan/tools/cmake-3.9.0/share/cmake-3.9/Modules/FindBoost.cmake:769
>  (message):
>   Imported targets not available for Boost version

You are using very old CMake 3.9 which has no idea about Boost 1.65
https://github.com/Kitware/CMake/blob/v3.9.0/Modules/FindBoost.cmake#L769

Rule #1: Use latest version of CMake, ALWAYS!

There is absolutely no reason or excuse to not to use the latest as there are
- deb packages available https://apt.kitware.com/
- generic installer for any Linux and Windows

Updating CMake is easy-peasy for us lazy programmers with a bit of scripting:
https://github.com/mloskot/wsl-config/blob/master/scripts/install-cmake-latest.sh
https://github.com/mloskot/wsl-config/blob/master/scripts/install-cmake-latest.ps1

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Alternative locations for boost in cmake

2019-10-25 Thread Mateusz Loskot
On Fri, 25 Oct 2019 at 09:54, Mahmood Naderan  wrote:
>
> Even with the latest 3.15.4, I get the same error
>
>   Could NOT find Boost (missing: Boost_INCLUDE_DIR system filesystem timer
>   chrono) (Required is at least version "1.58")

You can try `-DBoost_DEBUG=ON that may give more clues what is happening

In some situations (environment, toolset, Boost build layout, etc.)
FindBoost.cmake,
which by the way is a **guesser** not a rock solid configuration file
like pkg-config that never fails,
may need some extra hints.
Here is copy of suggestions from project I maintain
https://github.com/boostorg/gil/blob/develop/CONTRIBUTING.md#using-cmake

```
TIP: If CMake is failing to find Boost libraries, especially built
with --layout=versioned, you can try a few hacks:

-DBoost_ARCHITECTURE=-x64 to help CMake find Boost 1.66 and above add
an architecture tag to the library file names in versioned build The
option added in CMake 3.13.0.

-DBoost_COMPILER=-gcc5 or -DBoost_COMPILER=-vc141 to help CMake
earlier than 3.13 match your compiler with toolset used in the Boost
library file names (i.e. libboost_unit_test_framework-gcc5-mt-x64-1_69
and not -gcc55-). Fixed in CMake 3.13.0.

if CMake is still failing to find Boost, you may try -DBoost_DEBUG=ON
to get detailed diagnostics output from FindBoost.cmake module.
```

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] How to Switch to Static Runtime on Command Line?

2019-10-28 Thread Mateusz Loskot
On Mon, 28 Oct 2019 at 12:01, Osman Zakir  wrote:
>
> I'm trying to build LLVM 10.0.0 with CMake on the command line (Developer 
> Command Prompt for VS2019)
> and I need to know how to switch to a static runtime.

This may help (CMake 3.15 or later only):

https://cmake.org/cmake/help/latest/policy/CMP0091.html
https://cmake.org/cmake/help/v3.15/prop_tgt/MSVC_RUNTIME_LIBRARY.html

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] How to Switch to Static Runtime on Command Line?

2019-10-28 Thread Mateusz Loskot
On Mon, 28 Oct 2019 at 12:22, Osman Zakir  wrote:
>
> And I should do "-DCMAKE_MSVC_RUNTIME_LIBRARY=/MT"

Man, read the docs I pasted!!!
https://cmake.org/cmake/help/v3.15/prop_tgt/MSVC_RUNTIME_LIBRARY.html

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] How to Switch to Static Runtime on Command Line?

2019-10-28 Thread Mateusz Loskot
On Mon, 28 Oct 2019 at 13:09, Osman Zakir  wrote:
>
> I did read that.
> I tried to specify CMAKE_MSVC_RUNTIME_LIBRARY and MSVC_RUNTIME_LIBRARY as 
> /MT, -MT and MT, but nothing worked.

I'm sorry, but that confirms you did not read that document.

Hint 1: "The allowed values are"

Hint 2: In CMake, for XXX property there is a corresponding variable
https://cmake.org/cmake/help/v3.15/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] How to Switch to Static Runtime on Command Line?

2019-10-28 Thread Mateusz Loskot
On Mon, 28 Oct 2019 at 13:23, Eric Doenges  wrote:

> I think it is worth adding to what Mateusz wrote that the
> MSVC_RUNTIME_LIBRARY property / CMAKE_MSVC_RUNTIME_LIBRARY variable are
> only available if policy CMP0091 is set to NEW
>

Yes, indeed. FWIW, it is also documented in the frame "Note" on docs page
of the property/variable.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] CMake's FindBoost Module Can't Detect Boost Version

2019-12-17 Thread Mateusz Loskot
On Tue, 17 Dec 2019 at 16:39, Osman Zakir  wrote:
>
> I built Boost 1.72.0 while passing the "--layout=versioned" flag to b2, but 
> when I tried to rebuild Jinja2Cpp with the newer version of Boost using 
> CMake, it failed to generate project files and said it couldn't filesystem 
> and system and also couldn't detect version information.  Could someone 
> please help me out with this?

I recall you have been asking similar questions in the past about Jinja2Cpp.

You have received number of useful suggestions [1], e.g. to use
-DBoost_DEBUG=ON,
and investigate detailed diagnostics, to try -DBoost_COMPILER=...
and -DBoost_ARCHITECTURE hints, etc.
Please, apply this knowledge.

Finally, your questions are poorly formulated e.g. my crystal sphere has broken
and I can't figure out what compiler, toolset, cmake version, etc. you are on.
Next time, try to help people help you [2]

[1] https://cmake.org/pipermail/cmake/2018-October/068477.html
[2] http://www.catb.org/~esr/faqs/smart-questions.html

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

Powered by kitware.com/cmake

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

Visit other Kitware open-source projects at https://www.kitware.com/platforms

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

This mailing list is deprecated in favor of https://discourse.cmake.org


Re: [CMake] CMake's FindBoost Module Can't Detect Boost Version

2019-12-17 Thread Mateusz Loskot
On Tue, 17 Dec 2019 at 18:43, Osman Zakir  wrote:
>
> I tried passing -DBoost_COMPILER and -DBoost_DEBUG

That is incorrect!

The options must read  -DBoost_DEBUG=ON
and -DBoost_COMPILER=-vc141 or vc142, depending on
what b2.exe generated in names for your MSVC version.

> but it seems it's only looking for up to Boost 1.71.0; the test versions go 
> up to there only.
> Should I edit the FindBoost.cmake file to have it look for version 1.72.0 as 
> well?

If you have read/searched the FindBoost docs page
https://cmake.org/cmake/help/latest/module/FindBoost.html?highlight=version
you would have learned that you can specify
-DBoost_ADDITIONAL_VERSIONS=1.72

> I don't know about all of the flags I need to pass, but if it can find the 
> Boost version then it should be able to detect all of the stuff on its own, 
> right?

It should, but it still may need hints like Boost_COMPILER, or
Boost_ARCHITECTURE.

FindBoost is a Find-module.
A Find-module is a ***guesser***.
A guesser has right to fail to guess...no hard promises.

https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html

"Unlike a package configuration file, it is not shipped with upstream,
but is used by downstream to find the files by guessing locations of
files with platform-specific hints."

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

Powered by kitware.com/cmake

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

Visit other Kitware open-source projects at https://www.kitware.com/platforms

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

This mailing list is deprecated in favor of https://discourse.cmake.org


Re: [CMake] Problem with set_source_files_properties

2012-01-05 Thread Mateusz Loskot
On 5 January 2012 12:31, vivek goel  wrote:
> I am using code
> where f contains the file name
>
>
> set(MY_PATH "-D__RELATIVE_PATH__=\\\"ab\\\"")
> set_source_files_properties(${f} PROPERTIES
>   COMPILE_FLAGS ${MY_PATH})
>
> I am not able to see -D__RELATIVE_PATH__ inside compilation flags.

You have read the 2nd paragraph of COMPILE_FLAGS section in manual, haven't you.

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

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] error of mixed dynamic/static link to Boost in windows VS2008

2012-01-06 Thread Mateusz Loskot
On 6 January 2012 05:30, Forest Yang  wrote:
>  I am writing a library using boost_regex. For the unit test part, I
> am using boost_unit_test_framework and needs to be dynamical linked.
> Everything worked great on Linux but not the Windows VS 2008.
>
>  I used the BoostPro binary installer, got boost components like:
> boost_regex-vc90-mt-gd-1_47.dll and .lib,  also the
> libboost_regex-vc90-mt-gd-1_47.lib file. After the FIND_PACKAGE(Boost
> Components ...) I got the boost_*-vc90-mt-gd-1_47.lib version, (no
> prefix lib), however, when I compile the unit test executable, it has
> an error fatal error LNK1104: cannot open file
> 'libboost_regex-vc90-mt-gd-1_47.lib' If I add its directory C:\Program
> Files\boost\boost_1_47\lib to the linker's "Additional Library
> Directory" in VS2008 everything went OK.
>
>  My question is
>
> 1. Where this "libboost*" comes from ? all my CMake script are giving
> boost_* instead of libboost_* libraries.
> 2. When to set this linker directory so I do not need to add this
> manually in VS2008.

The libboost_* libraries are dragged in by auto-linking on Windows.
Auto-linking is ON by default on Windows.
You have to explicitly disable it.

Go to CMake installation directory, locate FindBoost.cmake file,
open this file and read the comments where you have it explained very well.

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

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] Some issues with visual studio

2012-01-08 Thread Mateusz Loskot
On 8 January 2012 15:21, Renato Utsch  wrote:
> Yes, but I want to be able to change with CMake, but if I can't do
> that, at least I want to be able to set the default to the Release
> version :X

You have to understand there is difference between generators like
makefiles and generators for projects for IDEs which allow to switch
between build configurations from within IDE, like Visual Studio does.

IMHO, CMAKE_BUILD_TYPE is irrelevant for IDEs like Visual Studio
and valid workflow is equivalent to this:

cmake -G "Visual Studio 2010"
msbuild myproj.sln /p:Configuration=Debug

or

load myproj.sln in VS IDE and change configuration there.

Obviously, for makefiles, CMAKE_BUILD_TYPE is the way to go.

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

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] Some issues with visual studio

2012-01-08 Thread Mateusz Loskot
On 8 January 2012 16:04, Eric Noulard  wrote:
> 2012/1/8 Renato Utsch :
>> So I can do this by adding a command line parameter to do that. But
>> can't I simply set an option that behaves exactly as --config Debug ?
>
> May be you could try to find out how Visual Studio
> is choosing the default built type?

Eric, spot on!

Renato, if you create new project from within Visual Studio,
what build configuration is used as default? Debug.
Your problem has nothing to do with CMake.

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

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] Progress report strange behaviour with mixed file permissions

2012-01-13 Thread Mateusz Loskot
Hi,

A friend of mine has asked me to confirm if there may be a bug in CMake
related to file permissions on Unix. Here is the story:

There are some files under CMakeFiles/ directory owned by "root"
and not overridable by "strk" (non-root user).

Having such setup results in a pretty funny behaviour:
you do can run "make" but the progress widget always
reports the same percentage. I was at 83% from start
to finish. Pretty puzzling :)

The above was with cmake version 2.8.1.

Could any one point where is the problem?
CMake misuse or bug indeed?

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

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] Progress report strange behaviour with mixed file permissions

2012-01-13 Thread Mateusz Loskot
On 13 January 2012 11:30, David Cole  wrote:
> On Fri, Jan 13, 2012 at 5:48 AM, Mateusz Loskot  wrote:
>>
>> A friend of mine has asked me to confirm if there may be a bug in CMake
>> related to file permissions on Unix. Here is the story:
>>
>> There are some files under CMakeFiles/ directory owned by "root"
>> and not overridable by "strk" (non-root user).
>>
>> Having such setup results in a pretty funny behaviour:
>> you do can run "make" but the progress widget always
>> reports the same percentage. I was at 83% from start
>> to finish. Pretty puzzling :)
>>
>> The above was with cmake version 2.8.1.
>>
>> Could any one point where is the problem?
>> CMake misuse or bug indeed?
>
>
> Sounds to me like somebody ran cmake as root, and then ran it again as
> non-root... Choose non-root and be consistent. There's absolutely no
> reason to run cmake as root, ever.
>
> I don't think there's a CMake bug here, but if you can come up with
> steps to reproduce the problem without running CMake as root, then
> we'll investigate further.

David & Daniel, thanks!

I'll confirm with my friend and follow-up if needed.

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

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] Embarcadero C++ nightly test

2012-02-22 Thread Mateusz Loskot
On 23 February 2012 13:27, H Xu  wrote:
> The compiler could be downloaded from here:
> http://www.embarcadero.com/products/cbuilder/downloads
>
> Although it says the trial is a 30-day trial, in fact, the command line tool
> of the downloaded package, as far as I know, could be run for unlimited time
> without paying any money.So why not test it officially?

The fact it is technically possible, without a nag screen, etc.
does not mean it is legal. So, better check the EULA.

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

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] How to configure target or command to preprocess C file?

2012-07-08 Thread Mateusz Loskot
Hi,

I'm porting build configuration based on GNU Autotools to CMake
and I have to deal with C preprocessing to generate a file.

The input for preprocessor is SQL file with C preprocessor directives
used, like #include "another.sql", etc.

Currently, Makefile uses the following rule to generate plain SQL file
as output:

myfile.sql: myfile.sql.in.c
cpp -I../common $< | grep -v '^#' > $@

So, the myfile.sql is meant to be one of products of the build process,
similar to share libraries or executables.

What CMake tools should I use to achieve the same effect?

It's unclear to me if I should use add_custom_command,
add_custom_target or combine both.

Obviously, I'm looking for a portable solution that would work at least
with GNU GCC and Visual Studio toolsets. I presume I will have to define
platform-specific custom commands, one for cpp preprocessor, one for cl.exe.
Or, does CMake provide some kind of abstraction for C-preprocessing?

I scanned the archives, but I only found preprocessing of fortran files
or solutions based on make capabilities (make myfile.i).
So, it's not quite what I'm looking for.

Could anyone help me with this?

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

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] How to configure target or command to preprocess C file?

2012-07-09 Thread Mateusz Loskot
On 8 July 2012 13:34, Mateusz Loskot  wrote:
> Hi,
>
> I'm porting build configuration based on GNU Autotools to CMake
> and I have to deal with C preprocessing to generate a file.
>
> The input for preprocessor is SQL file with C preprocessor directives
> used, like #include "another.sql", etc.
> [...]

FYI, I also posted this question to StackOverflow

http://stackoverflow.com/questions/11383314/how-to-configure-cmake-target-or-command-to-preprocess-c-file

Perhaps there are some SO users here, then feel free to copy your answer to SO.

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

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] How to pass a flag to be used by cmake?

2012-07-09 Thread Mateusz Loskot
On 9 July 2012 11:47, Georgios Petasis  wrote:
> I want to build 32-bit binaries on a 64-bit Linux system, with gcc.
> In projects that use configure, this is easy:
>
> export CFLAGS=-m32
>
> But how can I do the same with cmake projects?

You do the same

> cmake does not seem to use CFLAGS. Is there a variable I can define when I
> run cmake, to pass the -m32 flag to gcc?

The list archives is a mine for basic problems solutions:

http://www.cmake.org/pipermail/cmake/2009-April/028853.html

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

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] Problems with MSVC 2010 generator

2012-07-09 Thread Mateusz Loskot
On 9 July 2012 12:12, Dominik Szczerba  wrote:
> Hi,
>
> In one, but not another, cmake-based bigger C++ project I am getting
> the following errors trigger by a test.cxx file consiting only of one
> line: #include .
>
> 1>c:\Program Files (x86)\Microsoft Visual Studio
> 10.0\VC\include\string(543): error C2039: '_Stolx' : is not a member
> of '`global namespace''

Are you sure you haven't messed with _HAS_CPP0X macro?

> The problem will not be there for C-only code (#include ...),
> and as mentioned, also not in another C++ project.

# CMakeLists.txt
project(Minimal)
cmake_minimum_required(VERSION 2.8.0)
add_executable(minimal test.cxx)

// test.cxx
#include 
int main() {}

Everything compiles for me using Visual Studio 2010 (*without* SP1)

Or, show your minimal CMakeLists.txt

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

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] Problems with MSVC 2010 generator

2012-07-09 Thread Mateusz Loskot
On 9 July 2012 14:20, Rolf Eike Beer  wrote:
> The reason is very likely that MS compilers are broken regarding the
> difference between <> and "" in #include statements,

Please, refer to
- C99 standard (e.g. N1336), 6.10.2 Source file inclusion, clause 1 and 2
- C++ standard (e.g. N3290), 16.2 Source file inclusion, clauses 2 and 3
and notice the "implementation-defined" specified for both!.

> i.e. they always work as "".

This as "" is implementation-defined.

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

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] How to configure target or command to preprocess C file?

2012-07-11 Thread Mateusz Loskot
On 9 July 2012 08:17, Petr Kmoch  wrote:
> [...]
> You have to create a custom command (using the OUTPUT signature) to
> actually do the preprocessing. If you're targetting gcc and Visual
> Studio, the command could look something like this:
>
> add_custom_command(
>   OUTPUT myfile.sql
>   COMMAND "${CMAKE_C_COMPILER}" -E myfile.sql.in -I ../common
>   MAIN_DEPENDENCY myfile.sql.in
>   COMMENT "Preprocessing myfile.sql.in"
>   VERBATIM
> )
>
> [..]
> Now you need something to "drive" this command.
> [...]
>
> add_custom_target(
>   ProcessSQL ALL
>   DEPENDS myfile.sql
>   COMMENT "Preprocessing SQL files"
>   VERBATIM
> )

Hi Petr,

Your solution is perfect fit for my problem.
Thank you for the great explanation!

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

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] Order of COMMENT display for custom command and target

2012-07-11 Thread Mateusz Loskot
Hi,

I'm working with add_custom_command and add_custom_target commands
as implemented in CMake 2.8.8.
For my command and target, I set COMMENT property.

I'd like to understand the actual order in which COMMENT messages are
displayed for command vs target.
The documentation says:

"If COMMENT is set, the value will be displayed as a message
before the commands are executed at build time."

When I look at the CMake output, the semantic of 'before' is slightly confusing.
Here is quick example:

$ cat ../CMakeLists.txt
cmake_minimum_required (VERSION 2.8)
project (Hello)

add_custom_command(OUTPUT my.out
  COMMAND echo "touch my.out"
  COMMENT "Touching my.out"
  VERBATIM
)
add_custom_target(MyOut ALL
  DEPENDS my.out
  COMMENT "Making MyOut"
  VERBATIM)


The custom target depends on custom command.
AFAIU, processing order is as follows:
1. The target is built, dependency discovered.
2. The command is built.

In details, given the documentation on COMMENT displaying included
above, I'd expect this:

1. The target MyOut requested to build
1.1. COMMENT "Making MyOut" is displayed, before building target
1.2. The target MyOUT is built, dependency discovered.
2. The command requested to build:
2.1. COMMENT "Touching my.out" is displayed, before executing command
2.2.   COMMAND echo "touch my.out" executed


However, actual output of the build looks like this:

mloskot build $ cmake ../
...
mloskot build $ make
[ 50%] Touching my.out
touch my.out
[100%] Making MyOut
[100%] Built target MyOut
mloskot build $

The COMMENT messages are displayed in reverse order than
I'd expect according to my interpretation of the manual.
I'd also say that the reverse order is counter-intuitive, isn't it?

Is my interpretation incorrect or there is anything in my
CMakeLists.txt or anywhere?

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

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] New version of FindGit.cmake compatible with FindSubversion.cmake

2012-07-11 Thread Mateusz Loskot
Folks,

Can we simply replace the basic version of FindGit.cmake module
available in the current release and Git repo with this version from Slicer?

https://github.com/Slicer/Slicer/blob/master/CMake/FindGit.cmake

Git is a tool of enormous importance nowadays, as Subversion is.
It's pity functionality of those two modules is kept in sync.

The Slicer's version has been referred several times here anyway.

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

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] New version of FindGit.cmake compatible with FindSubversion.cmake

2012-07-11 Thread Mateusz Loskot
On 12 July 2012 00:24, Aashish Chaudhary  wrote:
> Hi Mateusz,
>
> I don't have both files in front of me. Whats the difference between
> the one in the slicer and once in the CMake?

CMake's current version [1] defines:

 #   GIT_EXECUTABLE - path to git command line client
#   GIT_FOUND - true if the command line client was found
#   GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)

Slicer's version [2] defines:

# The module defines the following variables:
#   GIT_EXECUTABLE - path to git command line client
#   GIT_FOUND - true if the command line client was found
#
# If the command line client executable is found the macro
#  GIT_WC_INFO( )
# is defined to extract information of a git working copy at
# a given location.
#
# The macro defines the following variables:
#  _WC_REVISION_HASH - Current SHA1 hash
#  _WC_REVISION - Current SHA1 hash
#  _WC_REVISION_NAME - Name associated with
_WC_REVISION_HASH
#  _WC_URL - output of command `git config --get remote.origin.url'
#  _WC_ROOT - Same value as working copy URL
#  _WC_GITSVN - Set to false
#
# ... and also the following ones if it's a git-svn repository:
#  _WC_GITSVN - Set to True if it is a
#  _WC_INFO - output of command `git svn info'
#  _WC_URL - url of the associated SVN repository
#  _WC_ROOT - root url of the associated SVN repository
#  _WC_REVISION - current SVN revision number
#  _WC_LAST_CHANGED_AUTHOR - author of last commit
#  _WC_LAST_CHANGED_DATE - date of last commit
#  _WC_LAST_CHANGED_REV - revision of last commit
#  _WC_LAST_CHANGED_LOG - last log of base revision


[1] 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/FindGit.cmake;h=f89d1afa3713629b240803f9cb868dfe070771d5;hb=HEAD
[2] https://github.com/Slicer/Slicer/blob/master/CMake/FindGit.cmake

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

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] New version of FindGit.cmake compatible with FindSubversion.cmake

2012-07-12 Thread Mateusz Loskot
On 12 July 2012 07:52, Rolf Eike Beer  wrote:
> Mateusz Loskot wrote:
>> On 12 July 2012 00:24, Aashish Chaudhary  
>> wrote:
>> >
>> > I don't have both files in front of me. Whats the difference between
>> > the one in the slicer and once in the CMake?
>>
>> CMake's current version [1] defines:
>>
>>  #   GIT_EXECUTABLE - path to git command line client
>> #   GIT_FOUND - true if the command line client was found
>> #   GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
>>
>> Slicer's version [2] defines:
>>
>> # The module defines the following variables:
>> #   GIT_EXECUTABLE - path to git command line client
>> #   GIT_FOUND - true if the command line client was found
>> #
>> # If the command line client executable is found the macro
>> #  GIT_WC_INFO( )
>> # is defined to extract information of a git working copy at
>> # a given location.
>> #
>> # The macro defines the following variables:
>> #  _WC_REVISION_HASH - Current SHA1 hash
>> #  _WC_REVISION - Current SHA1 hash
>> #  _WC_REVISION_NAME - Name associated with
>> _WC_REVISION_HASH
>> #  _WC_URL - output of command `git config --get
>> remote.origin.url' #  _WC_ROOT - Same value as working copy URL
>> #  _WC_GITSVN - Set to false
>> #
>> # ... and also the following ones if it's a git-svn repository:
>> #  _WC_GITSVN - Set to True if it is a
>> #  _WC_INFO - output of command `git svn info'
>> #  _WC_URL - url of the associated SVN repository
>> #  _WC_ROOT - root url of the associated SVN repository
>> #  _WC_REVISION - current SVN revision number
>> #  _WC_LAST_CHANGED_AUTHOR - author of last commit
>> #  _WC_LAST_CHANGED_DATE - date of last commit
>> #  _WC_LAST_CHANGED_REV - revision of last commit
>> #  _WC_LAST_CHANGED_LOG - last log of base revision
>
> I'm not against that change, but I find the documentation a bit misleading.
> When reading it my first thought was that _WC_REVISION and _WC_GITSVN are 
> junk,
> just to learn later that they have different meaning when it's a git-svn repo.

That's what documentation is for, to clarify unobvious.

> Looking at the code I think that line 115 (which is: if(NOT
> "${git_config_output}" STREQUAL "")) could be simplified to
> "if(git_config_output)". The warning in line 144 looks suspicious to me, that
> would e.g. trigger on a local only git repo, no? Maybe make this an
> AUTHOR_WARNING?

Let's assume it is a requirement specific to the Slicer project.
I think, the warning could be simply removed.

> And obviously the version extraction code is missing, but this should be
> trivially fixable.

What version you mean? Git program version?
Or, the TODO comment in line 71 of the Slicer's FindGit.cmake?

My main point is to get someone from CMake team to simply grab the
Slicer's version
and commit to CMake upstream. Can't see reasons why it couldn't be
submitted really.

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

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] New version of FindGit.cmake compatible with FindSubversion.cmake

2012-07-12 Thread Mateusz Loskot
On 12 July 2012 14:24, Jean-Christophe Fillion-Robin
 wrote:
> I also think contributing this module back to CMake would be great.

+1

> This has been discuss on the list [1], few things need to be fixed and as
> discussed documentation updated.

Thanks for pointing that.

> The module could also probably be split into: FindGit.cmake and
> GitInfo.cmake (or similar name)

I agree, I just didn't want to make my request too bold.
The FindSubversion.cmake has also contributed to the general mess and
lack of unification across modules, so I assumed FindGit.cmake in current
shape would be accepted.

> First, we could improve the module within Slicer :) [2], then, when we are
> all happy with it, I believe the module could probably be contributed back
> to CMake [3].

Or, just improve it, submit to CMake and tell the Slicer folks here is
new version,
if you like, use it.

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

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] add additional lib

2012-07-12 Thread Mateusz Loskot
On 12 July 2012 17:30, Yixun Liu  wrote:
> Hi,
> I am using
> # Find VTK
> FIND_PACKAGE(VTK REQUIRED)
> IF(VTK_FOUND)
>   INCLUDE(${VTK_USE_FILE})
> ENDIF(VTK_FOUND)
>
> VTK_LIBRARIES does not include one lib.
>
> TARGET_LINK_LIBRARIES(ProjecctName  ${VTK_LIBRARIES}
>
> How to add this lib into the variable VTK_LIBRARIES  or
> TARGET_LINK_LIBRARIES?

http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:target_link_libraries

 [item1 [item2 [...]]]

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

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] add additional lib

2012-07-12 Thread Mateusz Loskot
On 12 July 2012 18:44, Yixun Liu  wrote:
> BTW, do you know how to set CMakeList to make it produce a window-based
> application rather than a console-based application?

I'm sorry, but I'm not sure what you mean.
You asked about adding extra libs to linker.
I neither have idea how it's relevant to console vs window-based app,
or what you mean as "make it produce".

p.s. Please, be careful when you reply to post to cmake list,
but not to my address exclusively.

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

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] Writing a custom Find*.cmake file for Pantheios

2012-07-17 Thread Mateusz Loskot
On 17 July 2012 03:11, Philipp Berger  wrote:
> Third question: Is there an easy way to deal with the singular/plural
> variables, for example _INCLUDE_DIR and _INCLUDE_DIRS? How exactly is the
> syntax for setting those (String, List, etc)?

You need to check the readme.txt [1] for guidelines.
The Compatibility section [3] on wiki gives some explanation too.
You may also find useful details in my thread on
"Canonical use of FindPackageHandleStandardArgs" [3]

[1] http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/readme.txt
[2] http://www.cmake.org/Wiki/CMake:Module_Maintainers#Compatibility
[3] http://www.cmake.org/pipermail/cmake/2010-March/035596.html

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

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] Link errors on Wiki/CMake

2012-07-18 Thread Mateusz Loskot
On 17 July 2012 14:34, Micha Renner  wrote:
>
> The following links of www.cmake.org/Wiki/CMake generate 404 Errors
> [...]

BTW, I try to maintain a short list of CMake tutorials here:

http://stackoverflow.com/a/2194183/151641

I have to admit, it's a floating matter.

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

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] Link errors on Wiki/CMake

2012-07-19 Thread Mateusz Loskot
On 19 July 2012 14:45, Bill Hoffman  wrote:
> On 7/18/2012 6:35 PM, Mateusz Loskot wrote:
>>
>> On 17 July 2012 14:34, Micha Renner  wrote:
>>>
>>>
>>> The following links of www.cmake.org/Wiki/CMake generate 404 Errors
>>> [...]
>>
>>
>> BTW, I try to maintain a short list of CMake tutorials here:
>>
>> http://stackoverflow.com/a/2194183/151641
>>
>> I have to admit, it's a floating matter.
>>
>> Best regards,
>>
> I noticed some complaints about fortran.  This article might help:
>
> http://www.netlib.org/lapack/lawnspdf/lawn270.pdf
>
> Also, there is this webinar on CMake:
> http://www.kitware.com/media/webinars.html#introcmake
>
>
> -Bill
>
>
> --
> Bill Hoffman
> Kitware, Inc.
> 28 Corporate Drive
> Clifton Park, NY 12065
> bill.hoff...@kitware.com
> http://www.kitware.com
> 518 881-4905 (Direct)
> 518 371-3971 x105
> Fax (518) 371-4573
>
>
>
> --
>
> 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

Thanks Bill. The SO answer updated.

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

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] Creating executable - including an external *.o

2012-07-22 Thread Mateusz Loskot
On 22 July 2012 13:07, Nicholas Yue  wrote:
>
> In the add_executable() command, I would like to include that single
> MyGC.o during link time, how does one specify a single object file for
> linking in an executable?

"add_executable may reference the objects using an
expression of the form $ as a source"

http://cmake.org/cmake/help/v2.8.8/cmake.html

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

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] Reg :: Boost Build

2012-09-07 Thread Mateusz Loskot
On 7 September 2012 10:25, Sumit Adhikari  wrote:

> Dear All,
>
> I see from google there were a significant discussion with boost
> developers and cmake people on migration of boost build system to cmake
> from jam.
>
> - I would like to know, were there any significant development ?
>
>
You want to read this:
https://svn.boost.org/trac/boost/wiki/CMake
and this
https://svn.boost.org/trac/boost/wiki/CMakeModularizationStatus
You may also find some some clarifications learning about Ryppl project
and reaching its community on the mailing list:
http://ryppl.org/

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

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] 'NMake Makefiles' generate does not support parallel builds (/MP)?

2012-09-21 Thread Mateusz Loskot
On 21 September 2012 15:20, Bill Hoffman  wrote:
> On 9/20/2012 7:42 PM, Loaden wrote:
>>
>> As I know, qmake support /MP on command line builds after set ENV
>> CL=/MP, and nmake can do parallel builds.
>> Follow the MS docs:
>> cl a.cpp b.cpp c.cpp /MP should works well on command line.
>> Seems CMake does not implements this.
>> So, can I request a feature for this?
>
> I suppose you can put a request in but I don't think we have the cycles to
> do it as it is a difficult problem to solve.

FYI, it would require to employ so called NMAKE batch-mode, which is
not trivial to configure, indeed.
Especially, if input/output paths need to be handled, etc.

Here is my question on using NMAKE batch-mode with tree of directories
I asked  a few years ago on microsoft.public.vc.ide_general [1] and
recently re-asked in SO [2] and MSDN [3].
My question remains unanswered.

[1] 
https://groups.google.com/d/topic/microsoft.public.vc.ide_general/YFJnuCTlxj4/discussion
[2] 
http://stackoverflow.com/questions/12010215/using-nmake-batch-mode-with-tree-of-directories
[3] 
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/4639db99-e9db-46ea-b3f5-bdb9d926410b

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

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] COPYING-CMAKE-SCRIPTS file removed?

2012-10-12 Thread Mateusz Loskot
Hi,

Has the COPYING-CMAKE-SCRIPTS file been removed
from the CMake sources?

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

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] How to get Visual Studio to use more than a single core for compiling

2012-11-27 Thread Mateusz Loskot
On 27 November 2012 14:23, John Drescher  wrote:

> On Tue, Nov 27, 2012 at 7:21 AM, Michael Jackson
>  wrote:
> >
> >
> > On Nov 27, 2012, at 12:46 AM, Titus von Boxberg  wrote:
> >
> >> Am 27.11.2012 05:24, schrieb Michael Jackson:
> >>> That will teach me to hit enter in GMail..
> >>>
> >>> My question is this: What is the magic CMake incantation to get Visual
> >>> Studio 2010 to use more than a single processor when compiling my
> >>> project?
> >> You could add /MP to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
> >>
> >> Regards
> >> Titus
> >> --
> >>
> >
> >
> > Thanks for the tip. I'll give it a try.
>
> I can tell you that sometimes its hard to get Visual Studio to make
> good use of your cores (especially if you have 8 or 12 threads) even
> though multithreded building is on. I believe there are too many parts
> of the chain that are single threaded only.


It's fairly easy to make both, VS and cl.exe, utilise multiple cores,
even using command line. The problem is that build configurations like
NMAKE require significant gymnastics:

http://public.kitware.com/pipermail/cmake/2012-September/052116.html

It is easier with VS projects:

http://www.cmake.org/pipermail/cmake/2009-April/028669.html

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

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] How to get Visual Studio to use more than a single core for compiling

2012-11-27 Thread Mateusz Loskot
On 27 November 2012 14:47, John Drescher  wrote:

> On Tue, Nov 27, 2012 at 9:41 AM, Mateusz Loskot 
> wrote:
> > On 27 November 2012 14:23, John Drescher  wrote:
> >>
> >> On Tue, Nov 27, 2012 at 7:21 AM, Michael Jackson
> >>  wrote:
> >> >
> >> >
> >> > On Nov 27, 2012, at 12:46 AM, Titus von Boxberg  wrote:
> >> >
> >> >> Am 27.11.2012 05:24, schrieb Michael Jackson:
> >> >>> That will teach me to hit enter in GMail..
> >> >>>
> >> >>> My question is this: What is the magic CMake incantation to get
> Visual
> >> >>> Studio 2010 to use more than a single processor when compiling my
> >> >>> project?
> >> >> You could add /MP to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
> >> >>
> >> >> Regards
> >> >> Titus
> >> >> --
> >> >>
> >> >
> >> >
> >> > Thanks for the tip. I'll give it a try.
> >>
> >> I can tell you that sometimes its hard to get Visual Studio to make
> >> good use of your cores (especially if you have 8 or 12 threads) even
> >> though multithreded building is on. I believe there are too many parts
> >> of the chain that are single threaded only.
> >
> >
> > It's fairly easy to make both, VS and cl.exe, utilise multiple cores,
> > even using command line. The problem is that build configurations like
> > NMAKE require significant gymnastics:
> >
> > http://public.kitware.com/pipermail/cmake/2012-September/052116.html
> >
> > It is easier with VS projects:
> >
> > http://www.cmake.org/pipermail/cmake/2009-April/028669.html
>
> My comment was even though it will do multithreaded builds with VS
> projects for some projects it will build at very low CPU utilization
> for long periods while other projects it maxes out at 100% on all 12
> cores.


Right, perhaps complex inter-project dependencies halt the processes.



-- 
Mateusz Loskot, http://mateusz.loskot.net
--

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] Library locations returned by find_package() and find_library()

2012-12-06 Thread Mateusz Loskot
Hi,

The CMake 2.8.10 manual includes the following statement in the paragraph
about link_directories() command:

"Library locations returned by find_package() and find_library() are
absolute paths."

Would it be possible to include similar clarification in the sections for
find_package() and find_library()?

A user of my library asked why
XXX_INCLUDE_DIR takes directory location, but
XXX_LIBRARIES takes absolute path to library file(s).

I've found it difficult to explain the rationale really.
I could not find any back up in the manual.

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

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] Library locations returned by find_package() and find_library()

2012-12-06 Thread Mateusz Loskot
On 6 December 2012 18:45, Andreas Pakulat  wrote:
> On Thu, Dec 6, 2012 at 5:13 PM, Mateusz Loskot  wrote:
>> The CMake 2.8.10 manual includes the following statement in the paragraph
>> about link_directories() command:
>>
>> "Library locations returned by find_package() and find_library() are
>> absolute paths."
>>
>> Would it be possible to include similar clarification in the sections for
>> find_package() and find_library()?
>>
>> A user of my library asked why
>> XXX_INCLUDE_DIR takes directory location, but
>> XXX_LIBRARIES takes absolute path to library file(s).
>>
>> I've found it difficult to explain the rationale really.
>> I could not find any back up in the manual.
>
> Thats two unrelated things really.


Andreas,

Yes, that is perfectly clear these two are very different and
unrelated settings.

> For libraries cmake needs to know
> the absolute path if possible to setup proper dependencies in
> target_link_libraries and to make sure that the linker links against
> exactly that library and not some library with the same name that
> happens to be in a directory further in the front of the linker
> commandline.

These two reasons are what I'm looking for.

> For include directories things are different, since the mechanism for
> those is different. In particular the pre-processor does not allow
> include files to be listed on the commandline. Instead you give it a
> couple of directories where to search.

Yes, the pre-processor constraint is clear.

> Dependencies of this are
> generated by CMake parsing the source files.

That's new.

For Visual Studio users as well as GNU toolset users,
separation of linker directories from library names is quite common,
if not obvious. So, I think it would be good if the documentation provides
relevant explanation here.

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

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] How to extract the directory path from find_library ?

2012-12-14 Thread Mateusz Loskot
On 14 December 2012 13:32, Rolf Eike Beer  wrote:
> Am , schrieb Witold E Wolski:
>>
>> Hi,
>>
>> I am using
>>
>> FIND_LIBRARY(CPPUNIT_LIBRARY NAMES cppunit HINTS
>> ${CPPUNIT_INCLUDE_DIR}/../lib)
>>
>>
>> to find library locations. But what I am needing is the directory
>> containing the lib and not the full path.
>> How do I get it?
>
>
> cmake --help-command get_filename_component
>
> And if you think about using that for linking: all you need is the full
> path. Just pass that to target_link_libraries. Don't even think about
> messing around with link_directories().

Indeed and this should be well explained in the documentation.
I've met countless cases and users who are confused [1] about
file path vs folder path returned from the find_library and related commands.

Many, if not most those new to CMake still think along the configuration
of Visual Studio project with separate properties for library folder
and library names.

[1] http://www.cmake.org/pipermail/cmake/2012-December/052909.html

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

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

2013-01-04 Thread Mateusz Loskot
On 4 January 2013 14:12, Bill Hoffman  wrote:
> On 1/4/2013 6:50 AM, Kornel Benko wrote:
>>
>> Hi, I am searching for something appropriate to the
>>
>> autoconf AC_C_RESTRICT macro.
>>
>> Kornel
>>
> What does it do?

Bill,

It tests if C compiler supports C99 restrict keyword,
perhaps also implementation-specific form, e.g. __restrict, etc.

[1] http://en.wikipedia.org/wiki/Restrict

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

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

2013-01-04 Thread Mateusz Loskot
On 4 January 2013 14:46, Bill Hoffman  wrote:
> On 1/4/2013 9:24 AM, Mateusz Loskot wrote:
>>
>> It tests if C compiler supports C99 restrict keyword,
>> perhaps also implementation-specific form, e.g. __restrict, etc.
>>
>> [1]http://en.wikipedia.org/wiki/Restrict
>
> Should be able to do it with a CheckCSourceCompiles:
>
>
> http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:CheckCSourceCompiles

Yup:

CHECK_C_SOURCE_COMPILES (
  "int test (void *restrict x); int main (void) {return 0;}"
  HAVE_RESTRICT)

Lots of examples available:
https://github.com/pjanouch/aapng/blob/master/CMakeLists.txt
https://bitbucket.org/poulson/clique/src/ca43759adbe4/external/elemental/CMakeLists.txt

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

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] FindBoost.cmake issue while targeting 32-bit build on Linux 64-bit

2015-04-23 Thread Mateusz Loskot
Hi,

Here is the situation outlined:
- project has Boost as optional dependency
- running CMake on Linux 64-bit to build 32-bit binaries
- CXXFLAGS=-m32 is specified
- Boost 64-bit binaries are installed
- Boost 32-bit binaries are *not* installed

Expected result:
- Boost 32 is not found, Boost is *not* enabled
- 32-bit build is configured without Boost at all
- success

Actual result:
- Boost 64 is found, Boost is enabled
- 32-bit build is configured to link against Boost 64-bit libraries
- failure

Am I missing anything in the build configuration
or FindBoost.cmake is unable to do what I expect it to do,
by design or by a bug?

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

Powered by www.kitware.com

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

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

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

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

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


[CMake] Detecting -m32 build target on 64-bit host

2015-04-23 Thread Mateusz Loskot
Hi,

Surprisingly, I'm having trouble to figure out how to determine,
that in Linux 64-bit OS, I'm building a project with -m32 specified.
IOW, any CMake variable or macro to tell me target architecture
of a build that is being configured is 32 or 64 bit?

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Detecting -m32 build target on 64-bit host

2015-04-23 Thread Mateusz Loskot
On 23 April 2015 at 16:57, Nils Gladitz  wrote:
> On 04/23/2015 04:54 PM, Mateusz Loskot wrote:
>>
>> Hi,
>>
>> Surprisingly, I'm having trouble to figure out how to determine,
>> that in Linux 64-bit OS, I'm building a project with -m32 specified.
>> IOW, any CMake variable or macro to tell me target architecture
>> of a build that is being configured is 32 or 64 bit?
>
>
> CMAKE_SIZEOF_VOID_P [1] should be:
>   - 4 for 32-bit builds
>   - 8 for 64-bit builds

Nils,

I know this trick, but this is not what I'm looking for, unless I
misread the documentation.

The doc says:

"This is set to the size of a pointer on the machine"

but not size of pointer on *target* architecture of a build.

I believe I formulated my question clear.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Detecting -m32 build target on 64-bit host

2015-04-23 Thread Mateusz Loskot
On 23 April 2015 at 17:20, Nils Gladitz  wrote:
> On 23.04.2015 17:08, Mateusz Loskot wrote:
>>
>> I know this trick, but this is not what I'm looking for, unless I
>> misread the documentation.
>>
>> The doc says:
>>
>> "This is set to the size of a pointer on the machine"
>>
>> but not size of pointer on *target* architecture of a build.
>>
>> I believe I formulated my question clear.
>
>
> Yes, all try_compile()s and CMAKE_SIZEOF_VOID_P in particular are specific
> to the target.

So, the documentation is imprecise in this regard, isn't it?

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Detecting -m32 build target on 64-bit host

2015-04-23 Thread Mateusz Loskot
On 23 April 2015 at 17:50, Nils Gladitz  wrote:
> On 23.04.2015 17:32, Mateusz Loskot wrote:
>>
>> So, the documentation is imprecise in this regard, isn't it?
>>
>> Best regards,
>
>
> Is this better?
> http://www.cmake.org/cmake/help/git-next/variable/CMAKE_SIZEOF_VOID_P.html

It's better, indeed, but what about

"This is set to the size of a pointer on the target machine for which
the (machine) code is generated."

Thanks!

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Detecting -m32 build target on 64-bit host

2015-04-23 Thread Mateusz Loskot
On 23 April 2015 at 18:04, Nils Gladitz  wrote:
> On 23.04.2015 18:00, Mateusz Loskot wrote:
>>
>> It's better, indeed, but what about
>>
>> "This is set to the size of a pointer on the target machine for which
>> the (machine) code is generated."
>
>
> Hm that is in my opinion too redundant.
> There is only one target machine as far as cmake is concerned and there is
> no need to further disambiguate.

Right.
Thanks again.

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

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] FindBoost.cmake issue while targeting 32-bit build on Linux 64-bit

2015-04-23 Thread Mateusz Loskot
On 23 April 2015 at 20:58, Klaim - Joël Lamotte  wrote:
> I believe that this issue is with Boost not having a way to specify which
> target architecture is the build,
> which prevent any CMake script to be able to identify which build is
> installed.

Joel,

Thanks for confirming what's the issue.
I'm surprised it hasn't been addressed yet, seems folks apply some
workarounds external to FindBoost, but what they are...

Thanks for the pointers too, somehow I missed that issue
was discussed in those Boost threads.

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

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] Detecting -m32 build target on 64-bit host

2015-04-29 Thread Mateusz Loskot
On 24 April 2015 at 21:00, Gregor Jasny  wrote:
> On 23/04/15 16:54, Mateusz Loskot wrote:
>> Surprisingly, I'm having trouble to figure out how to determine,
>> that in Linux 64-bit OS, I'm building a project with -m32 specified.
>> IOW, any CMake variable or macro to tell me target architecture
>> of a build that is being configured is 32 or 64 bit?
>
> Does this help?
>
> include(CheckSymbolExists)
>
> if(WIN32)
>   check_symbol_exists("_M_AMD64" "" RTC_ARCH_X64)
>   if(NOT RTC_ARCH_X64)
> check_symbol_exists("_M_IX86" "" RTC_ARCH_X86)
>   endif(NOT RTC_ARCH_X64)
>   # add check for arm here
>   # see http://msdn.microsoft.com/en-us/library/b0084kay.aspx
> else(WIN32)
>   check_symbol_exists("__i386__" "" RTC_ARCH_X86)
>   check_symbol_exists("__x86_64__" "" RTC_ARCH_X64)
>   check_symbol_exists("__arm__" "" RTC_ARCH_ARM)
> endif(WIN32)

Gregor, yes, indeed.

Thanks!

-- 
Mateusz  Loskot, http://mateusz.loskot.net
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] CXXFLAGS and CMAKE_REQUIRED_FLAGS correspondance

2015-04-29 Thread Mateusz Loskot
Hi,

Let's consider 32-bit build target on 64-bit host,
is this canonical way of setting the flags?

CXXFLAGS="-m32" cmake ../src

# in my CMakeLists.txt
CMAKE_REQUIRED_FLAGS=${CXXFLAGS}

If I don't set CMAKE_REQUIRED_FLAGS with -m32, then obviously
CheckSymbolExists (and others) may give unexpected results.

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

Powered by www.kitware.com

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

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

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

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

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


[CMake] Check for working C compiler using: Visual Studio 10 -- broken

2013-03-05 Thread Mateusz Loskot
Hi,

Here is my environment:
- Windows 7 (64-bit).
- CMake 2.8.10.2
- Visual Studio 2010 Professional
- Visual Studio 2012 Professional (Update 1)

All VS installations work well with hand-crafted projects,
no problems building from IDE, no problems building from
corresponding command line prompts.

I launch Visual Studio Command Prompt (2010) and try to configure
CMake-based project, and I'm getting the status from the subject line.

Here is detailed CMake output:


d:\dev\soci\_git\build-sqlite3>cmake -G "Visual Studio 10" ..\soci\src
-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- broken
CMake Error at C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  10.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: D:/dev/soci/_git/build-sqlite3/CMakeFiles/CMakeTmp

  Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com
  CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec2214779388

  Microsoft (R) Visual Studio Version 10.0.30319.1.
  Copyright (C) Microsoft Corp.  All rights reserved.

  1>-- Build started: Project: cmTryCompileExec2214779388, Configuration:
  Debug Win32 --

  1>Build started 05/03/2013 15:34:40.
  1>PrepareForBuild:
  1> Creating directory
  "D:\dev\soci\_git\build-sqlite3\CMakeFiles\CMakeTmp\Debug\".
  1>InitializeBuildStatus:
  1> Creating
  
"cmTryCompileExec2214779388.dir\Debug\cmTryCompileExec2214779388.unsuccessfulbuild"
  because "AlwaysCreate" was specified.
  1>ClCompile:
  1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
16.00.30319.01 for 80x86
  1> Copyright (C) Microsoft Corporation.  All rights reserved.
  1>
  1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
  "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
  /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2214779388.dir\Debug\\"
  
/Fd"D:/dev/soci/_git/build-sqlite3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2214779388.pdb"
  /Gd /TC /analyze- /errorReport:prompt testCCompiler.c /Zm1000
  1>
  1> testCCompiler.c
  1>LINK : fatal error LNK1123: failure during conversion to COFF:
file invalid or corrupt
  1>
  1>Build FAILED.
  1>
  1>Time Elapsed 00:00:00.44
  == Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==

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

-- Configuring incomplete, errors occurred!

d:\dev\soci\_git\build-sqlite3>



I have searched Web and this kind of error seems to be recurring,
some users even suggest to uninstall/reinstall Visual Studio...
Note, both VS versions work well with projects I already have.

I'm confused, what is the correct solution?

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

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] Check for working C compiler using: Visual Studio 10 -- broken

2013-03-05 Thread Mateusz Loskot
On 5 March 2013 15:58, David Cole  wrote:
> Is your VS 2010 up to date with respect to available service packs?

Nope, I don't use SP1.
But, before VS2012 installation yesterday, everything worked perfectly well
(with regard to CMake).

> Does this same exact thing happen every time when you are starting from a
> clean build tree?

Yes, it does.

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

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] Check for working C compiler using: Visual Studio 10 -- broken

2013-03-05 Thread Mateusz Loskot
On 5 March 2013 15:58, Bill Hoffman  wrote:
> On 3/5/2013 10:45 AM, Mateusz Loskot wrote:
>>
>> Here is my environment:
>> - Windows 7 (64-bit).
>> - CMake 2.8.10.2
>> - Visual Studio 2010 Professional
>> - Visual Studio 2012 Professional (Update 1)
>>
>> All VS installations work well with hand-crafted projects,
>> no problems building from IDE, no problems building from
>> corresponding command line prompts.
>>
>> I launch Visual Studio Command Prompt (2010) and try to configure
>> CMake-based project, and I'm getting the status from the subject line.
>>
>> Here is detailed CMake output:
>>
>>
>> 
>> d:\dev\soci\_git\build-sqlite3>cmake -G "Visual Studio 10" ..\soci\src
>> -- The C compiler identification is MSVC 16.0.30319.1
>> -- The CXX compiler identification is MSVC 16.0.30319.1
>> -- Check for working C compiler using: Visual Studio 10
>> -- Check for working C compiler using: Visual Studio 10 -- broken
>> CMake Error at C:/Program Files (x86)/CMake
>> 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
>>The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
>>10.0/VC/bin/cl.exe" is not able to compile a simple test program.
>>
>>It fails with the following output:
>>
>> Change Dir: D:/dev/soci/_git/build-sqlite3/CMakeFiles/CMakeTmp
>>
>>Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com
>>CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec2214779388
>>
>>Microsoft (R) Visual Studio Version 10.0.30319.1.
>>Copyright (C) Microsoft Corp.  All rights reserved.
>>
>>1>-- Build started: Project: cmTryCompileExec2214779388,
>> Configuration:
>>Debug Win32 --
>>
>>1>Build started 05/03/2013 15:34:40.
>>1>PrepareForBuild:
>>1> Creating directory
>>"D:\dev\soci\_git\build-sqlite3\CMakeFiles\CMakeTmp\Debug\".
>>1>InitializeBuildStatus:
>>1> Creating
>>
>> "cmTryCompileExec2214779388.dir\Debug\cmTryCompileExec2214779388.unsuccessfulbuild"
>>because "AlwaysCreate" was specified.
>>1>ClCompile:
>>1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
>> 16.00.30319.01 for 80x86
>>1> Copyright (C) Microsoft Corporation.  All rights reserved.
>>1>
>>1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
>>"CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
>>/Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2214779388.dir\Debug\\"
>>
>> /Fd"D:/dev/soci/_git/build-sqlite3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2214779388.pdb"
>>/Gd /TC /analyze- /errorReport:prompt testCCompiler.c /Zm1000
>>1>
>>1> testCCompiler.c
>>1>LINK : fatal error LNK1123: failure during conversion to COFF:
>> file invalid or corrupt
>>1>
>>1>Build FAILED.
>>1>
>>1>Time Elapsed 00:00:00.44
>>== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
>> ==
>>
>>CMake will not be able to correctly generate this project.
>> Call Stack (most recent call first):
>>CMakeLists.txt:15 (project)
>>
>> -- Configuring incomplete, errors occurred!
>>
>> d:\dev\soci\_git\build-sqlite3>
>>
>> 
>>
>>
>> I have searched Web and this kind of error seems to be recurring,
>> some users even suggest to uninstall/reinstall Visual Studio...
>> Note, both VS versions work well with projects I already have.
>>
>> I'm confused, what is the correct solution?
>
>
> I found this:
>
> http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c

Bill,

I think I know this error well, but I experienced that at different occasion
not related to CMake. AFAIK, it simply means object files or binaries
being linked are
incompatible (i.e. one .obj built with VC++ from VS2010, the other
.obj by VS2012)

> You could run cmake --debug-trycompile, then load the .sln file in the
> CMakeTmp directory with the IDE and see why it does not work.  Sounds like a
> .NET version issue.  I would try some of the stuff in that stackoverflow link.

Nice tip with the solution in the CMakeTmp, I had no idea about it.

I figured out that the VS2010 project there, cmTryCompileExec3417082516.vcxproj,
specifies for linker  /INCREMENTAL:YES
If I change to /INCREMENTAL:NO, then it builds.

Still not sure how the VS2010/VS2012 toolsets interfere here,
but it looks like this mess is not related to any problems with CMake.

Thanks!

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

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] Check for working C compiler using: Visual Studio 10 -- broken

2013-03-06 Thread Mateusz Loskot
On 5 March 2013 17:09, Bill Hoffman  wrote:
> On 3/5/2013 11:40 AM, Mateusz Loskot wrote:
>>
>> Nice tip with the solution in the CMakeTmp, I had no idea about it.
>>
>> I figured out that the VS2010 project there,
>> cmTryCompileExec3417082516.vcxproj,
>> specifies for linker  /INCREMENTAL:YES
>> If I change to /INCREMENTAL:NO, then it builds.
>>
>> Still not sure how the VS2010/VS2012 toolsets interfere here,
>> but it looks like this mess is not related to any problems with CMake.
>
> Seems to match what is in that stackoverflow article.

Yes, I have made a circle and came back to that solution.

> Taking off incremental seemed to fix the problem for them as well.   If you 
> read that
> thread close, there seems to be ways to fix the problem...

Installing VS2010 SP1 as the only sensible option.

Thanks!

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

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] Check for working C compiler using: Visual Studio 10 -- broken

2013-03-07 Thread Mateusz Loskot
On 6 March 2013 11:52, Mateusz Loskot  wrote:
> On 5 March 2013 17:09, Bill Hoffman  wrote:
>>
>> Taking off incremental seemed to fix the problem for them as well.   If you 
>> read that
>> thread close, there seems to be ways to fix the problem...
>
> Installing VS2010 SP1 as the only sensible option.

I've found quicker and less intrusive solution [1] that works for those
who can't/don't want to upgrade to VS2010 SP1

Simply, take cvtres.exe from VS2010 SP1
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
 or from VS2012
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe
and copy it over the cvtres.exe in VS2010 RTM installation (the one without SP1)
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe

[1] 
http://social.msdn.microsoft.com/Forums/da-DK/vssetup/thread/d10adba0-e082-494a-bb16-2bfc039faa80

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

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] FInd threads - iOS

2013-03-14 Thread Mateusz Loskot
On 14 March 2013 18:44, Casey Basichis  wrote:
>
> On the SOCI mailing list they directed me to this, that suggests the
> Threading may have been a problem on iOS.
>
> http://stackoverflow.com/a/14198386/151641

Casey,

Thanks for posting this issue here.
Just FYI, I'm watching this list too, so if any fixes or improvements for SOCI
come up, I'd like to pick them up and apply to SOCI.

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

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] Explicit _LIBRARIES and _INCLUDE_DIRS

2013-03-22 Thread Mateusz Loskot
Hi,

I'm trying to build software which uses libE57 library which has
Xerces as dependency.
I build Xerces too as part of my project and I deploy it in custom locations
and Xerces library has custom name.

libE57 provides FindXerces.cmake [1] and I've been trying to figure
out how I can
make this module find Xerces I provide, I tried to explicitly the two variables:
Xerces_INCLUDE_DIR
Xerces_LIBRARY
on invocation of cmake, but obviously this FindXerces.cmake is still nagging me
about XERCES_ROOT

This is first time when I have to deal with CMake-based software and custom
names and locations of libraries, so I'm not sure either I'm missing some
important tricks here or this FindXerces.cmake is just poorly written module
and it does not check if user passes _INCLUDE or _LIBRARY directly.

I know I can also use CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH,
but how to deal with custom library names, when this module expects
two options only [2].

Could anyone advise about workaround?

Is this an issue in the FindXerces.cmake and would you say it's worth
to submit bug report to libE57?

[1] 
http://sourceforge.net/p/e57-3d-imgfmt/code/331/tree/trunk/cmake/Modules/FindXerces.cmake
[2] 
http://sourceforge.net/p/e57-3d-imgfmt/code/331/tree/trunk/cmake/Modules/FindXerces.cmake#l44

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

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