Re: [CMake] add_executable question

2015-01-21 Thread Iosif Neitzke
set( PROJ_NAME Test01 )

file( GLOB ${PROJ_NAME}_SRC *.h *.cpp )
add_executable( ${PROJ_NAME} ${${PROJ_NAME}_SRC} )

On Thu, Jan 22, 2015 at 1:05 AM, Eric Noulard  wrote:
>
>
> 2015-01-22 3:41 GMT+01:00 Joshua Robinson :
>>
>>
>> Greetings,
>>
>> Can I add a variable, was set before, to add_executable ?
>
>
> I guess yes. However if "PROJ_NAME" value was used in
>
> project(Test01 C CXX)
>
> then there may be a conflict between "project name" and a "target name"
>>
>>
>> set(PROJ_NAME Test01)
>> ,,,
>> file( GLOB ${PROJ_NAME}_SRC "*.h" "*.cpp" )
>
>
> Globbing for source is a bad practice (unless it is for generated files)
> which make it difficult to properly track dependencies.
> You may search the ML archive for discussion about that.
>
>>
>> add_executable( ${PROJ_NAME}  ${PROJ_NAME}_SRC)
>> ...
>>
>> error in add_executable(..)
>
>
> what kind of error?
> Please give us more information like the exact error spitted out by cmake.
>
>
> --
> Eric
> L'élection n'est pas la démocratie -- http://www.le-message.org
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] add_executable question

2015-01-21 Thread Eric Noulard
2015-01-22 3:41 GMT+01:00 Joshua Robinson :

>
> Greetings,
>
> Can I add a variable, was set before, to add_executable ?
>

I guess yes. However if "PROJ_NAME" value was used in

project(Test01 C CXX)

then there may be a conflict between "project name" and a "target name"

>
> set(PROJ_NAME Test01)
> ,,,
> file( GLOB ${PROJ_NAME}_SRC "*.h" "*.cpp" )
>

Globbing for source is a bad practice (unless it is for generated files)
which make it difficult to properly track dependencies.
You may search the ML archive for discussion about that.


> add_executable( ${PROJ_NAME}  ${PROJ_NAME}_SRC)
> ...
>
> error in add_executable(..)
>

what kind of error?
Please give us more information like the exact error spitted out by cmake.


-- 
Eric
L'élection n'est pas la démocratie -- http://www.le-message.org
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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] Pre-compiled headers

2015-01-21 Thread Scott Aron Bloom
Is there any builtin CMake support for compiler independent support for 
pre-compiled headers?

I have found a couple of hacks out there for MSVC, and some for gcc.. but 
nothing that is all inclusive, and frankly none that look up to the quality of 
CMake :)

Scott

-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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] add_executable question

2015-01-21 Thread Joshua Robinson
Greetings,

Can I add a variable, was set before, to add_executable ?

set(PROJ_NAME Test01)
,,,
file( GLOB ${PROJ_NAME}_SRC "*.h" "*.cpp" )
add_executable( ${PROJ_NAME}  ${PROJ_NAME}_SRC)
...

error in add_executable(..)

Any help is appreciated.

Best Regards,
Joshua Robinson
-- 

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] Problem with library link order

2015-01-21 Thread Brad King
On 01/20/2015 12:57 PM, Tom Kacvinsky wrote:
> there are some static archives we build that depend on a third party
> static archive (one we don't build - it comes with the Ada compiler
> we are using), yet the third part archive is on the link line (as
> given by the link.txt file) *before* the static archives we build.

If you have a library

  add_library(mylib STATIC mylib.c)

and it depends on a third-party library then tell CMake so:

  target_link_libraries(mylib otherlib)

Then CMake will guarantee that an occurrence of otherlib appears on
the link line after mylib.

> duplicated shared libraries

These generally don't hurt anything.  CMake 3.1 will de-duplicate
shared libraries that come from logical targets (created via
add_library either as a build target or as an imported library).

> Can anyone point me in the right direction?

FYI, the ordering algorithm is documented in source comments here:

 
http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmComputeLinkDepends.cxx;hb=v3.1.0#l25

-Brad

-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] cmake --build parallel options (was: VS2012 builds using v3.1.0 are a lot slower than v2.8.12)

2015-01-21 Thread Paul Smith
On Wed, 2015-01-21 at 11:12 -0500, Brad King wrote:
> Rather than requiring users to run
> 
>  cmake --build . -- $tool_specific_parallel_option
> 
> to get a parallel build we could instead extend the "cmake --build"
> command to support an option mapping to the right parallel option
> underneath:
> 
>  cmake --build . --parallel
>  cmake --build . --parallel=$n

Unfortunately (for you guys :-)) I think this will end up being the only
reliably portable answer...

It was what I was going to suggest before I saw this email :-p :-)

-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] cmake --build parallel options (was: VS2012 builds using v3.1.0 are a lot slower than v2.8.12)

2015-01-21 Thread Brad King
On 01/21/2015 11:00 AM, Hendrik Sattler wrote:
> This makes cmake --build much less predictable across cmake versions and 
> cmake projects.
> How can I find out if msbuild is chosen without inspecting the cmake project?

One can't, but that is a fault of VS and/or Intel Fortran for having cases
that require devenv or msbuild, not a fault of CMake for trying to deal
with it.  Since 3.0 we always picks msbuild unless Fortran is involved.
This is fairly predictable moving forward.

> - get the CMAKE_VS_MSBUILD... from cache and at set CMAKE_MAKE_PROGRAM from 
> it.
> 
> @Paul: You can probably modify the CMAKE_VS_MSBUILD... variable to add /m.

The CMAKE_VS_MSBUILD_COMMAND variable:

 http://www.cmake.org/cmake/help/v3.1/variable/CMAKE_VS_MSBUILD_COMMAND.html

is not cached.  It is available to CMakeLists.txt code.

> But to compile in parallel should be s decision of the user, not the
> project, and thus a decision of the caller of cmake --build.

Rather than requiring users to run

 cmake --build . -- $tool_specific_parallel_option

to get a parallel build we could instead extend the "cmake --build"
command to support an option mapping to the right parallel option
underneath:

 cmake --build . --parallel
 cmake --build . --parallel=$n

-Brad

-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Specify 32-bit compilation to Clang

2015-01-21 Thread Robert Dailey
Thanks for your help so far. Your 3rd command produced the output
below. I'll keep looking into this but just wanted to share. I'm not
sure why it isn't working, and I'm not completely familiar with linux
development so it will take me a while to figure this out.

robert@robert-OptiPlex-745 ~ $ clang++ -m32 -Wl,--verbose test.cpp|grep libgcc
/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so when searching
for -lstdc++
/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a when searching
for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching
for -lgcc_s
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so succeeded
/usr/bin/ld: cannot find -lgcc_s
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.a failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../i386-linux-gnu/libgcc_s.so
failed
/usr/bin/ld: skipping incompatible
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for
-lgcc
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../i386-linux-gnu/libgcc_s.a
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../lib32/libgcc_s.so
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../lib32/libgcc_s.a
failed
/usr/bin/ldattempt to open /usr/bin/../lib/i386-linux-gnu/libgcc_s.so failed
: cannot find -lgcc
attempt to open /usr/bin/../lib/i386-linux-gnu/libgcc_s.a failed
attempt to open /usr/bin/../lib32/libgcc_s.so failed
attempt to open /usr/bin/../lib32/libgcc_s.a failed
attempt to open /lib/i386-linux-gnu/libgcc_s.so failed
attempt to open /lib/i386-linux-gnu/libgcc_s.a failed
attempt to open /lib/../lib32/libgcc_s.so failed
attempt to open /lib/../lib32/libgcc_s.a failed
attempt to open /usr/lib/i386-linux-gnu/libgcc_s.so failed
attempt to open /usr/lib/i386-linux-gnu/libgcc_s.a failed
attempt to open /usr/lib/../lib32/libgcc_s.so failed
attempt to open /usr/lib/../lib32/libgcc_s.a failed
attempt to open /usr/lib/x86_64-linux-gnu/../../lib32/libgcc_s.so failed
attempt to open /usr/lib/x86_64-linux-gnu/../../lib32/libgcc_s.a failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libgcc_s.so failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../libgcc_s.a failed
attempt to open /usr/bin/../lib/libgcc_s.so failed
attempt to open /usr/bin/../lib/libgcc_s.a failed
attempt to open /lib/libgcc_s.so failed
attempt to open /lib/libgcc_s.a failed
attempt to open /usr/lib/libgcc_s.so failed
attempt to open /usr/lib/libgcc_s.a failed
attempt to open /usr/i386-linux-gnu/lib32/libgcc_s.so failed
attempt to open /usr/i386-linux-gnu/lib32/libgcc_s.a failed
attempt to open /usr/x86_64-linux-gnu/lib32/libgcc_s.so failed
attempt to open /usr/x86_64-linux-gnu/lib32/libgcc_s.a failed
attempt to open //usr/local/lib/i386-linux-gnu/libgcc_s.so failed
attempt to open //usr/local/lib/i386-linux-gnu/libgcc_s.a failed
attempt to open //usr/local/lib32/libgcc_s.so failed
attempt to open //usr/local/lib32/libgcc_s.a failed
attempt to open //lib/i386-linux-gnu/libgcc_s.so failed
attempt to open //lib/i386-linux-gnu/libgcc_s.a failed
attempt to open //lib32/libgcc_s.so failed
attempt to open //lib32/libgcc_s.a failed
attempt to open //usr/lib/i386-linux-gnu/libgcc_s.so failed
attempt to open //usr/lib/i386-linux-gnu/libgcc_s.a failed
attempt to open //usr/lib32/libgcc_s.so failed
attempt to open //usr/lib32/libgcc_s.a failed
attempt to open //usr/local/lib/libgcc_s.so failed
attempt to open //usr/local/lib/libgcc_s.a failed
attempt to open //lib/libgcc_s.so failed
attempt to open //lib/libgcc_s.a failed
attempt to open //usr/lib/libgcc_s.so failed
attempt to open //usr/lib/libgcc_s.a failed
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.so failed
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.a succeeded
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../i386-linux-gnu/libgcc.so
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../i386-linux-gnu/libgcc.a
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../lib32/libgcc.so
failed
attempt to open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../lib32/libgcc.a
failed
attempt to open /usr/bin/../lib/i386-linux-gnu/libgcc.so failed
attempt to open /usr/bin/../lib/i386-linux-gnu/libgcc.a failed
attempt to open /usr/bin/../lib32/libgcc.so failed
attempt to open /usr/bin/../lib32/libgcc.a failed
attempt to open /lib/i386-linux-gnu/libgcc.so failed
attempt to open /lib/i386-linux-gnu/libgcc.a failed
attempt to open /lib/../lib32/libgcc.so failed
attempt to open /lib/../lib32/libgcc.a failed
attempt to open /usr/lib/i386-linux-gnu/libgcc.so failed
attempt to open /usr/lib/i386-linux-gnu/libgcc.a failed
attempt to open /usr/lib/../lib32/libgcc.so failed
attempt to open /usr/lib/../lib32/l

Re: [CMake] VS2012 builds using v3.1.0 are a lot slower than v2.8.12

2015-01-21 Thread Hendrik Sattler
Hi,

This makes cmake --build much less predictable across cmake versions and cmake 
projects.
How can I find out if msbuild is chosen without inspecting the cmake project?
Specifying this manually is not really an option... too complicated.

Or like that:
- run CMake
- get the CMAKE_VS_MSBUILD... from cache and at set 
CMAKE_MAKE_PROGRAM from it.

@Paul: You can probably modify the CMAKE_VS_MSBUILD... variable to add /m. But 
to compile in parallel should be s decision of the user, not the project, and 
thus a decision of the caller of cmake --build.

HS


Am 21. Januar 2015 15:05:32 MEZ, schrieb Brad King :
>On 01/20/2015 03:40 PM, Paul Smith wrote:
>> Where can I go to find out more about how cmake --build chooses
>whether
>> to use msbuild vs. devenv?
>
>The behavior was updated in 3.0 and is now described here:
>
> http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_MAKE_PROGRAM.html
>
>In 2.8.12 and below we always stored CMAKE_MAKE_PROGRAM in
>CMakeCache.txt
>instead of waiting until build time to choose it.  This was problematic
>because it was initialized before configuring the project so we could
>not
>know whether devenv had to be chosen for Intel Fortran support or not,
>so it always chose devenv if available.  However, devenv does not work
>when using an alternative PlatformToolset with CMAKE_GENERATOR_TOOLSET:
>
>http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/46795/focus=46969
>
>Therefore we had to switch to build-time selection of the build tool.
>The change was mentioned in the 3.0 release notes:
>
> http://www.cmake.org/cmake/help/v3.0/release/3.0.0.html#other-changes
> "Selection of the proper msbuild or devenv tool is now performed as
>  late as possible when the solution (.sln) file is available so it
>  can depend on project content."
>
>On 01/21/2015 05:53 AM, Yves Frederix wrote:
>> options like  'cmake --build . --config Release -- /m'. I checked and
>> this indeed works as expected.
>
>Yes.
>
>> The above explains all my initial observations. However, the fix is
>> not very handy. As I understood, one does not know until build time
>> what exact build (devenv or msbuild) will be used by CMake
>
>MSBuild will be used for VS >= 10 unless Fortran code is involved.  You
>can also add -DCMAKE_MAKE_PROGRAM=/path/to/msbuild.exe to explicitly
>specify it.  Once that is in CMakeCache.txt then it will always be used
>by "cmake --build".
>
>-Brad

-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] VS2012 builds using v3.1.0 are a lot slower than v2.8.12

2015-01-21 Thread Brad King
On 01/20/2015 03:40 PM, Paul Smith wrote:
> Where can I go to find out more about how cmake --build chooses whether
> to use msbuild vs. devenv?

The behavior was updated in 3.0 and is now described here:

 http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_MAKE_PROGRAM.html

In 2.8.12 and below we always stored CMAKE_MAKE_PROGRAM in CMakeCache.txt
instead of waiting until build time to choose it.  This was problematic
because it was initialized before configuring the project so we could not
know whether devenv had to be chosen for Intel Fortran support or not,
so it always chose devenv if available.  However, devenv does not work
when using an alternative PlatformToolset with CMAKE_GENERATOR_TOOLSET:

 
http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/46795/focus=46969

Therefore we had to switch to build-time selection of the build tool.
The change was mentioned in the 3.0 release notes:

 http://www.cmake.org/cmake/help/v3.0/release/3.0.0.html#other-changes
 "Selection of the proper msbuild or devenv tool is now performed as
  late as possible when the solution (.sln) file is available so it
  can depend on project content."

On 01/21/2015 05:53 AM, Yves Frederix wrote:
> options like  'cmake --build . --config Release -- /m'. I checked and
> this indeed works as expected.

Yes.

> The above explains all my initial observations. However, the fix is
> not very handy. As I understood, one does not know until build time
> what exact build (devenv or msbuild) will be used by CMake

MSBuild will be used for VS >= 10 unless Fortran code is involved.  You
can also add -DCMAKE_MAKE_PROGRAM=/path/to/msbuild.exe to explicitly
specify it.  Once that is in CMakeCache.txt then it will always be used
by "cmake --build".

-Brad

-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Problem with library link order

2015-01-21 Thread Tom Kacvinsky
Unfortunately, that is not what I've found.  There are libraries we build
that have their own target_link_libraries, and if these libraries are used
on the target_link_libraries for an executable, its dependencies are also
pulled into the executables link line.  This is expected, handling of
transitive dependencies.  What is not expected is when I add libraries we
don't build, or object files, the link order gets messed up.  That and we
see duplicates of libraries.  For instance, when I pull in the the Qt
libraries, they always show up twice.  Perhaps this is because of
transitive dependencies.

In any case, there appears to be no fine grain control of link
libraries/ordering and it is driving me nuts.

I'll see if I can come up with a reproducer.  It'll be a while before I can
get one to the list.

Tom

On Tue, Jan 20, 2015 at 10:07 PM, J Decker  wrote:

> library link order is exactly as you specify in target_link_libraries...
> each line following the last of the prior list so reording your library
> link list should be doable
>
> On Tue, Jan 20, 2015 at 9:57 AM, Tom Kacvinsky <
> tom.kacvin...@vectorcast.com> wrote:
>
>> HI,
>>
>> I am using cmake 2.8,11.2 on Linux.  I am having a problem with the order
>> of libraries on the link line.  In particular, there are some static
>> archives we build that depend on a third party static archive (one we don't
>> build - it comes with the Ada compiler we are using), yet the tghird part
>> archive is on the link line (as given by the link.txt file) *before* the
>> static archives we build.  There are also problems with duplicated shared
>> libraries and a few other issues related to linking.  I have not bee able
>> to suss out what cmake is doing to construct the list of link libraries
>> used, and how it orders them.  It is very important that we have the right
>> order of libraries
>>
>> Unfortunately, our cmake files are too complicated to post here, and also
>> depend on a working Ada compiler plus the plplot projects Ada support cmake
>> "modules".  Coming up with a simple reproducer is also difficult given the
>> latter constaints.
>>
>> Can anyone point me in the right direction?  If there is a heuristic I
>> can follow - like ordering our libraries in target_link_libraries()
>> differently - I would like to hear about it.
>>
>> Thanks,
>>
>> Tom
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>>
>
>
-- 

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] VS2012 builds using v3.1.0 are a lot slower than v2.8.12

2015-01-21 Thread Yves Frederix
Ok, so it all seems to boil down to the following:

 - 2.8.12: "cmake --build" uses devenv to build, which in turn picks
up a setting ("maximum number of parallel project builds") from the VS
IDE at build time. As this was set to 8 on my machine, by default the
build used parallellization with 8 cores with a fast parallel build as
a result. I verified that after changing this setting in the IDE to 1,
the build no longer works in parallel, with longer build times as a
result.

 - 3.x: "cmake --build" uses MSBuild, which uses a command line switch
/m to control the same behavior. In absence of this command line
switch, the default behavior is equivalent to /m1 (see
https://msdn.microsoft.com/en-us/library/ms164311.aspx), which means a
non-parallel build and longer build times than for 2.8.12. A way to
test this in practice, is to run a build command with native build
options like  'cmake --build . --config Release -- /m'. I checked and
this indeed works as expected.

The above explains all my initial observations. However, the fix is
not very handy. As I understood, one does not know until build time
what exact build (devenv or msbuild) will be used by CMake, so simply
always adding '-- /m' to the build command will not work (devenv
doesn't like /m). Assuming that changing the default command line
options to MSBuild inside CMake is not a valid solution, I am
wondering if there is currently a way to set additional build options
for MSBuild only from inside the CMakeLists.txt file? Or,
alternatively, is there a way to check which build program will be
used before actually running the build?

Yves


On Tue, Jan 20, 2015 at 10:46 PM, Paul Smith  wrote:
> On Tue, 2015-01-20 at 16:02 -0500, Paul Smith wrote:
>> > I think devenv is used instead of msbuild when the solution has
>> > fortran projects.
>>
>> I certainly don't have any Fortran projects--!!
>
> I think I figured it out: on our build servers we don't delete
> everything and start over from scratch all the time (only for our
> official release builds).
>
> We recently upgraded our cmake from 2.8.12.2 to 3.1.0 and I think that
> the systems where we were seeing this problem had CMakeCache.txt files
> left over from when we were using CMake 2.8.12.2, and those files had
> CMAKE_MAKE_PROGRAM set (we never set it by hand, even back then, but
> maybe the older version of cmake added it to the cache on its own?) to
> devenv.
>
> Certainly when I went in and looked at CMakeCache.txt that value was set
> to "devenv.exe".  If I regenerated the CMakeCache.txt from scratch, it
> was no longer set.
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Specify 32-bit compilation to Clang

2015-01-21 Thread Nils Gladitz

I am not sure what else it could be.
Here are some queries I did on my system where it seems to be working; 
perhaps it will help you backtrack the issue:


Ubuntu 14.04.1 LTS (64-bit)

# gcc --version :
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2

# clang --version :
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 
3.4)


# clang++ -m32 -Wl,--verbose test.cpp|grep libgcc
attempt to open /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/32/libgcc_s.so 
succeeded

-lgcc_s (/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/32/libgcc_s.so)

# file a.out
a.out: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), 
dynamically linked (uses shared libs), for GNU/Linux 2.6.24, 
BuildID[sha1]=e15359bda06cce657369b3ae9d526c926deea6f2, not stripped


# apt-file search /usr/lib/gcc/x86_64-linux-gnu/4.8/32/libgcc_s.so
lib32gcc-4.8-dev: /usr/lib/gcc/x86_64-linux-gnu/4.8/32/libgcc_s.so

g++-multilib has an indirect dependency on lib32gcc-4.8-dev.

Nils
--

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] CPack in CMake 3.1.0 doesn't install files

2015-01-21 Thread NoRulez
Hi,

it should also not work when you build a test project in release mode and then 
in the build directory type "cpack -G ZIP" for example. (Without the -C option)

In the CTestScript is also added the -C option to ensure it uses the release 
mode, but it doesn't work either.

When you then open the cmake_install.cmake files, you will see that the 
CMAKE_INSTALL_CONFIG_NAME variable is empty on line 15.

In CMake 3.0.2 the variable is set with the value "Release".

Best Regards


> Am 20.01.2015 um 18:40 schrieb Robert Maynard :
> 
> Hi,
> 
> I haven't seen this issue but if you have a self-contained and reduced
> (preferably plain CMake ) test case, I would be happy to run it and
> verify if this is a regression.
> 
>> On Tue, Jan 20, 2015 at 2:37 AM, NoRulez  wrote:
>> No one?
>> 
>> Has something changed between 3.0.2 to 3.1.0 which prevents cpack to copy 
>> the generated *.exe file to the _CPack_Packages directory? Or did i need an 
>> additional variable to be set in 3.1.0?
>> 
>> Thanks in advance
>> 
>> Best Regards
>> 
>> 
>>> Am 16.01.2015 um 12:09 schrieb NoRulez :
>>> 
>>> If I switch back to 3.0.2 everything is working like a charm
>>> 
>>> Best Regards
>>> 
 Am 15.01.2015 um 17:49 schrieb NoRulez :
 
 Hello,
 
 we have only upgraded to the last release 3.1.0 from 3.0.2 and get the 
 following when cpack is executed in a CTestScript:
 
 error: fixup_bundle: not a valid bundle
 
 The files are ceated, but they are not copied to the _CPack_Packages folder
 
 Then I found out that the variable "CMAKE_INSTALL_CONFIG_NAME" is empty in 
 the cmake_install.cmake files
 
 Any hints?
 
 Best Regards
 
 --
 
 Powered by www.kitware.com
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Kitware offers various services to support the CMake community. For more 
 information on each offering, please visit:
 
 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/mailman/listinfo/cmake
>>> --
>>> 
>>> Powered by www.kitware.com
>>> 
>>> Please keep messages on-topic and check the CMake FAQ at: 
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>> 
>>> Kitware offers various services to support the CMake community. For more 
>>> information on each offering, please visit:
>>> 
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>> 
>>> Visit other Kitware open-source projects at 
>>> http://www.kitware.com/opensource/opensource.html
>>> 
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake
>> --
>> 
>> Powered by www.kitware.com
>> 
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Kitware offers various services to support the CMake community. For more 
>> information on each offering, please visit:
>> 
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>> 
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

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

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

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