[Cmake-commits] CMake branch, master, updated. v3.12.2-700-gaa4d3e1

2018-09-21 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  aa4d3e18d28ef7fec017738970f57793ef313f82 (commit)
  from  227b2be9d6a77efd95c4e99aab8e6255cb95a380 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa4d3e18d28ef7fec017738970f57793ef313f82
commit aa4d3e18d28ef7fec017738970f57793ef313f82
Author: Kitware Robot 
AuthorDate: Sat Sep 22 00:01:10 2018 -0400
Commit: Kitware Robot 
CommitDate: Sat Sep 22 00:01:10 2018 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 22d519f..e022866 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 12)
-set(CMake_VERSION_PATCH 20180921)
+set(CMake_VERSION_PATCH 20180922)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


Re: [CMake] How to duplicate a source file and rename it

2018-09-21 Thread Ke Gao
It just can't copy to the same source directory.

On Fri, Sep 21, 2018 at 4:32 PM J Decker  wrote:

>
>
> On Fri, Sep 21, 2018 at 3:29 PM J Decker  wrote:
>
>>
>>
>> On Fri, Sep 21, 2018 at 3:24 PM Ke Gao  wrote:
>>
>>> Thanks. I forgot to say my CMakeList.txt is not located together with
>>> the source files. So I used the following, it seems not working:
>>> add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
>>>DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../../
>>> file.c
>>>COMMAND ${CMAKE_COMMAND} -E copy_if_different
>>> ${CMAKE_CURRENT_SOURCE_DIR}/../../file.c
>>> ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
>>> )
>>> Is there an easier way to do this?
>>>
>> not really...
>> NOt sure why it wouldn't work unless current_source_dir isn't what you
>> think it is.
>> I actually copy mine into
>>
>
> It also wouldn't work if you didn't use
> ${CMAKE_CURRENT_SORUCE_DIR}/../../aaa_file.c in another target.
> (and by the same path... which is partially why I copy into BINARY_DIR,
> then it's in a known place for all projects int he tree
>
>>
>>
>
>>COMMAND ${CMAKE_COMMAND} -E copy_if_different
>> ${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}
>>
>>  (basename is the path part of the ${SOURCE})
>>
>>>
>>>
>>> On Fri, Sep 21, 2018 at 4:10 PM J Decker  wrote:
>>>


 On Fri, Sep 21, 2018 at 3:00 PM Ke Gao  wrote:

> Hi,
>
> In a project, I need to first duplicate a source file and rename it.
> For example, I want to change "file.c" to "aaa_file.c", and after
> compiling, I will delete it. This is similar to using "cp file.c
> aaa_file.c". How to easily do this in CMake? I found "file" command 
> doesn't
> work well for this.
>
>
 add_custom_command( OUTPUT aaa_file.c
DEPENDS file.c
COMMAND ${CMAKE_COMMAND} -E
 copy_if_different file.c aaa_file.c
 )

 then you just have to reference the source file 'aaa_file.c' and it
 will get updated if file.c is different. I also do
  COMMAND ${CMAKE_COMMAND} -E touch
 aaa_file.c

 just to make sure it is new.



> Thank you very much.
>
> --
>
> ..
> Ke Gao
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For
> more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/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

>>>
>>>
>>> --
>>>
>>> ..
>>> Ke Gao
>>>
>>

-- 
..
Ke Gao
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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 duplicate a source file and rename it

2018-09-21 Thread J Decker
On Fri, Sep 21, 2018 at 3:29 PM J Decker  wrote:

>
>
> On Fri, Sep 21, 2018 at 3:24 PM Ke Gao  wrote:
>
>> Thanks. I forgot to say my CMakeList.txt is not located together with the
>> source files. So I used the following, it seems not working:
>> add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
>>DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../../
>> file.c
>>COMMAND ${CMAKE_COMMAND} -E copy_if_different
>> ${CMAKE_CURRENT_SOURCE_DIR}/../../file.c
>> ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
>> )
>> Is there an easier way to do this?
>>
> not really...
> NOt sure why it wouldn't work unless current_source_dir isn't what you
> think it is.
> I actually copy mine into
>

It also wouldn't work if you didn't use
${CMAKE_CURRENT_SORUCE_DIR}/../../aaa_file.c in another target.
(and by the same path... which is partially why I copy into BINARY_DIR,
then it's in a known place for all projects int he tree

>
>

>COMMAND ${CMAKE_COMMAND} -E copy_if_different
> ${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}
>
>  (basename is the path part of the ${SOURCE})
>
>>
>>
>> On Fri, Sep 21, 2018 at 4:10 PM J Decker  wrote:
>>
>>>
>>>
>>> On Fri, Sep 21, 2018 at 3:00 PM Ke Gao  wrote:
>>>
 Hi,

 In a project, I need to first duplicate a source file and rename it.
 For example, I want to change "file.c" to "aaa_file.c", and after
 compiling, I will delete it. This is similar to using "cp file.c
 aaa_file.c". How to easily do this in CMake? I found "file" command doesn't
 work well for this.


>>> add_custom_command( OUTPUT aaa_file.c
>>>DEPENDS file.c
>>>COMMAND ${CMAKE_COMMAND} -E copy_if_different
>>> file.c aaa_file.c
>>> )
>>>
>>> then you just have to reference the source file 'aaa_file.c' and it will
>>> get updated if file.c is different. I also do
>>>  COMMAND ${CMAKE_COMMAND} -E touch aaa_file.c
>>>
>>> just to make sure it is new.
>>>
>>>
>>>
 Thank you very much.

 --

 ..
 Ke Gao
 --

 Powered by www.kitware.com

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

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

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

Powered by www.kitware.com

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

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

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

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

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


[CMake] CMake accessibility, or the lack of it with latest updtes

2018-09-21 Thread Jaffar Sidek
                    HI.  I am a blind software developer very dependent 
on CMake for my development work.  I have noticed that since version 
3.1X, the gui version of CMake is no longer accessible.  Let me 
clarify.  I use a screen reader for voice output in order for me to be 
able to use the computer independently.  In the earlier versions of 
CMake, My screen reader could access a large part of the interface of 
CMake to enable me to use the program Quickly and efficiently.  But 
since version 3.1X and the latest version 3.2X, I have had to revert to 
using the command line.  I noticed that the earlier versions were coded 
with QT, is that not the case anymore?  QT5 has added accessibility 
these days, and I would appreciate it if the accessibility features of 
earlier versions of CMake could be re-implemented.  Thanks and cheers!


--

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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 duplicate a source file and rename it

2018-09-21 Thread J Decker
On Fri, Sep 21, 2018 at 3:24 PM Ke Gao  wrote:

> Thanks. I forgot to say my CMakeList.txt is not located together with the
> source files. So I used the following, it seems not working:
> add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
>DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../../
> file.c
>COMMAND ${CMAKE_COMMAND} -E copy_if_different
> ${CMAKE_CURRENT_SOURCE_DIR}/../../file.c
> ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
> )
> Is there an easier way to do this?
>
not really...
NOt sure why it wouldn't work unless current_source_dir isn't what you
think it is.
I actually copy mine into

   COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}

 (basename is the path part of the ${SOURCE})

>
>
> On Fri, Sep 21, 2018 at 4:10 PM J Decker  wrote:
>
>>
>>
>> On Fri, Sep 21, 2018 at 3:00 PM Ke Gao  wrote:
>>
>>> Hi,
>>>
>>> In a project, I need to first duplicate a source file and rename it. For
>>> example, I want to change "file.c" to "aaa_file.c", and after compiling, I
>>> will delete it. This is similar to using "cp file.c aaa_file.c". How to
>>> easily do this in CMake? I found "file" command doesn't work well for this.
>>>
>>>
>> add_custom_command( OUTPUT aaa_file.c
>>DEPENDS file.c
>>COMMAND ${CMAKE_COMMAND} -E copy_if_different
>> file.c aaa_file.c
>> )
>>
>> then you just have to reference the source file 'aaa_file.c' and it will
>> get updated if file.c is different. I also do
>>  COMMAND ${CMAKE_COMMAND} -E touch aaa_file.c
>>
>> just to make sure it is new.
>>
>>
>>
>>> Thank you very much.
>>>
>>> --
>>>
>>> ..
>>> Ke Gao
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/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
>>
>
>
> --
>
> ..
> Ke Gao
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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 duplicate a source file and rename it

2018-09-21 Thread Ke Gao
Thanks. I forgot to say my CMakeList.txt is not located together with the
source files. So I used the following, it seems not working:
add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../../file.c
   COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/../../file.c ${CMAKE_CURRENT_SOURCE_DIR}/../../
aaa_file.c
)
Is there an easier way to do this?


On Fri, Sep 21, 2018 at 4:10 PM J Decker  wrote:

>
>
> On Fri, Sep 21, 2018 at 3:00 PM Ke Gao  wrote:
>
>> Hi,
>>
>> In a project, I need to first duplicate a source file and rename it. For
>> example, I want to change "file.c" to "aaa_file.c", and after compiling, I
>> will delete it. This is similar to using "cp file.c aaa_file.c". How to
>> easily do this in CMake? I found "file" command doesn't work well for this.
>>
>>
> add_custom_command( OUTPUT aaa_file.c
>DEPENDS file.c
>COMMAND ${CMAKE_COMMAND} -E copy_if_different
> file.c aaa_file.c
> )
>
> then you just have to reference the source file 'aaa_file.c' and it will
> get updated if file.c is different. I also do
>  COMMAND ${CMAKE_COMMAND} -E touch aaa_file.c
>
> just to make sure it is new.
>
>
>
>> Thank you very much.
>>
>> --
>>
>> ..
>> Ke Gao
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/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
>


-- 
..
Ke Gao
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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 duplicate a source file and rename it

2018-09-21 Thread J Decker
On Fri, Sep 21, 2018 at 3:00 PM Ke Gao  wrote:

> Hi,
>
> In a project, I need to first duplicate a source file and rename it. For
> example, I want to change "file.c" to "aaa_file.c", and after compiling, I
> will delete it. This is similar to using "cp file.c aaa_file.c". How to
> easily do this in CMake? I found "file" command doesn't work well for this.
>
>
add_custom_command( OUTPUT aaa_file.c
   DEPENDS file.c
   COMMAND ${CMAKE_COMMAND} -E copy_if_different
file.c aaa_file.c
)

then you just have to reference the source file 'aaa_file.c' and it will
get updated if file.c is different. I also do
 COMMAND ${CMAKE_COMMAND} -E touch aaa_file.c

just to make sure it is new.



> Thank you very much.
>
> --
>
> ..
> Ke Gao
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] How to duplicate a source file and rename it

2018-09-21 Thread Ke Gao
Hi,

In a project, I need to first duplicate a source file and rename it. For
example, I want to change "file.c" to "aaa_file.c", and after compiling, I
will delete it. This is similar to using "cp file.c aaa_file.c". How to
easily do this in CMake? I found "file" command doesn't work well for this.

Thank you very much.

-- 
..
Ke Gao
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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 a pkg-config file

2018-09-21 Thread Alan W. Irwin

On 2018-09-21 15:55+0200 Florian Lindner wrote:


Hello,

on a really weird configured system (but I can't change it), there is a 
pkg-config file which I want to find with cmake:

 set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:$ENV{PETSC_DIR}/lib/pkgconfig")
 set(CMAKE_PREFIX_PATH "$ENV{PETSC_DIR}/lib/pkgconfig")
 find_package(PkgConfig REQUIRED)
 pkg_check_modules(PETSC REQUIRED craypetsc_real)

but

-- Checking for module 'craypetsc_real'
--   No package 'craypetsc_real' found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:363 (message):
 A required package was not found




cat $PETSC_DIR/lib/pkgconfig/craypetsc_real.pc


VERSION=3.8.4.0
PE=GNU
pe=gnu
GENCOMP=7.1
CPU_TARGET=haswell

install_prefix=/opt/cray/pe
root=${install_prefix}/petsc/3.8.4.0/real
prefix=${root}/${PE}/${GENCOMP}/${CPU_TARGET}
libdir=${prefix}/lib
includedir=${prefix}/include

cray_as_needed=
cray_no_as_needed=

Name: craypetsc_real
Description: Scientific libraries
Version: ${VERSION}
Libs: -L${libdir} ${cray_as_needed}-lcraypetsc_gnu_71_real${cray_no_as_needed}  
-fopenmp
Libs.private:
Requires:
Requires.private: mpich >= 7.0 sci_mp >= 13.0 cray-tpsl >= 16.03.1 hdf5_parallel
Conflicts: hdf5
Cflags:  -I${includedir}

pkg-config also finds it:


PKG_CONFIG_PATH=$PETSC_DIR/lib/pkgconfig pkg-config --print-variables 
craypetsc_real

cray_as_needed
prefix
libdir
[...]


CMakeError.log does not exist, CMakeOutput.log I have attached.


Hi Florian:

What happens if you set PKG_CONFIG_PATH outside cmake rather than inside?

e.g.,

env PKG_CONFIG_PATH=$PETSC_DIR/lib/pkgconfig cmake 

with both

set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:$ENV{PETSC_DIR}/lib/pkgconfig")
set(CMAKE_PREFIX_PATH "$ENV{PETSC_DIR}/lib/pkgconfig")

commented out inside your CMakeList.txt file?

That method has always worked for me.  And if it works for you, then I would
think attempting to set the enviroment variable PKG_CONFIG_PATH inside
your CMakeLists.txt file with just

set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:$ENV{PETSC_DIR}/lib/pkgconfig")

(setting CMAKE_PREFIX_PATH should not be required) should just work, but it is
always possible (although I haven't checked documentation to see) there is
some incorrect syntax in that line so I would also use message to print
out the PKG_CONFIG_PATH environment variable to see what you have actually
set it to within CMake.

Alan
__
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
--

Powered by www.kitware.com

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

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

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

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

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


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

2018-09-21 Thread J Decker
On Fri, Sep 21, 2018 at 1:32 PM Michael Jackson 
wrote:

> Nope. That just tells what _version_ of the compiler suite to use, but not
> the architecture.
>
Oh right, I understand now.


-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe -- works

do this first.

set PreferredToolArchitecture=x64




>
> -- The C compiler identification is MSVC 19.0.24234.1
> -- The CXX compiler identification is MSVC 19.0.24234.1
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 14.0/VC/bin/x86_amd64/cl.exe
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
>
> C:\Users\mjackson\DREAM3D-Dev\DREAM3D-Builds\Test>set
> PreferredToolArchitecture=x64
> C:\Users\mjackson\DREAM3D-Dev\DREAM3D-Builds\Test>cmake -G "Visual Studio
> 15 2017 Win64" -T "v140" -DDREAM3D_SDK=C:/DREAM3D_SDK ../../DREAM3D
> --  *
> -- ***
> -- The C compiler identification is MSVC 19.0.24234.1
> -- The CXX compiler identification is MSVC 19.0.24234.1
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 14.0/VC/bin/amd64/cl.exe
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 14.0/VC/bin/amd64/cl.exe -- works
>
>
> _
> Mike Jackson  mike.jack...@bluequartz.net
>
>
>
> On Fri, Sep 21, 2018 at 4:02 PM J Decker  wrote:
>
>> "C:/tools/unix/cmake/bin/cmake.exe" -G "Visual Studio 15 2016 Win64" -T
>> "v140" ..
>> C:\tools\unix\cmake\bin\cmake.exe --build . --config "Debug" --target
>> "INSTALL"
>>
>> On Fri, Sep 21, 2018 at 8:26 AM Michael Jackson <
>> mike.jack...@bluequartz.net> wrote:
>>
>>> So I tried using "-DCMAKE_GENERATOR_TOOLSET=x64" while configuring a
>>> clean build directory but it still picked up the x86 compiler. I ended up
>>> going into the "Settings" of Windows 10 and added the environment variable
>>> PreferredToolArchitecture=x64 to my account. Logged out, Logged back in and
>>> then did another configuration run and now during the cmake configuration
>>> run the proper 64 bit compiler is picked up and used. Still probably
>>> missing something obvious in the CMake file that I can add
>>>
>>> --
>>> Mike Jackson
>>>
>>> On 9/21/18, 10:28 AM, "CMake on behalf of Mateusz Loskot" <
>>> cmake-boun...@cmake.org on behalf of mate...@loskot.net> wrote:
>>>
>>> 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
>>>
>>>
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/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

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

2018-09-21 Thread Michael Jackson
Nope. That just tells what _version_ of the compiler suite to use, but not
the architecture.

-- The C compiler identification is MSVC 19.0.24234.1
-- The CXX compiler identification is MSVC 19.0.24234.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/x86_amd64/cl.exe -- works

C:\Users\mjackson\DREAM3D-Dev\DREAM3D-Builds\Test>set
PreferredToolArchitecture=x64
C:\Users\mjackson\DREAM3D-Dev\DREAM3D-Builds\Test>cmake -G "Visual Studio
15 2017 Win64" -T "v140" -DDREAM3D_SDK=C:/DREAM3D_SDK ../../DREAM3D
--  *
-- ***
-- The C compiler identification is MSVC 19.0.24234.1
-- The CXX compiler identification is MSVC 19.0.24234.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe -- works


_
Mike Jackson  mike.jack...@bluequartz.net



On Fri, Sep 21, 2018 at 4:02 PM J Decker  wrote:

> "C:/tools/unix/cmake/bin/cmake.exe" -G "Visual Studio 15 2016 Win64" -T
> "v140" ..
> C:\tools\unix\cmake\bin\cmake.exe --build . --config "Debug" --target
> "INSTALL"
>
> On Fri, Sep 21, 2018 at 8:26 AM Michael Jackson <
> mike.jack...@bluequartz.net> wrote:
>
>> So I tried using "-DCMAKE_GENERATOR_TOOLSET=x64" while configuring a
>> clean build directory but it still picked up the x86 compiler. I ended up
>> going into the "Settings" of Windows 10 and added the environment variable
>> PreferredToolArchitecture=x64 to my account. Logged out, Logged back in and
>> then did another configuration run and now during the cmake configuration
>> run the proper 64 bit compiler is picked up and used. Still probably
>> missing something obvious in the CMake file that I can add
>>
>> --
>> Mike Jackson
>>
>> On 9/21/18, 10:28 AM, "CMake on behalf of Mateusz Loskot" <
>> cmake-boun...@cmake.org on behalf of mate...@loskot.net> wrote:
>>
>> 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
>>
>>
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/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] How to have Visual Studio 15 2017 actually use a 64 bit toolchain.

2018-09-21 Thread J Decker
"C:/tools/unix/cmake/bin/cmake.exe" -G "Visual Studio 15 2016 Win64" -T
"v140" ..
C:\tools\unix\cmake\bin\cmake.exe --build . --config "Debug" --target
"INSTALL"

On Fri, Sep 21, 2018 at 8:26 AM Michael Jackson 
wrote:

> So I tried using "-DCMAKE_GENERATOR_TOOLSET=x64" while configuring a clean
> build directory but it still picked up the x86 compiler. I ended up going
> into the "Settings" of Windows 10 and added the environment variable
> PreferredToolArchitecture=x64 to my account. Logged out, Logged back in and
> then did another configuration run and now during the cmake configuration
> run the proper 64 bit compiler is picked up and used. Still probably
> missing something obvious in the CMake file that I can add
>
> --
> Mike Jackson
>
> On 9/21/18, 10:28 AM, "CMake on behalf of Mateusz Loskot" <
> cmake-boun...@cmake.org on behalf of mate...@loskot.net> wrote:
>
> 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
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/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] Best way to combine generated static libraries into a single static library

2018-09-21 Thread Ke Gao
So I guess in order to include the object-files from a third party static
library, the only way would be to first extract it's object-files and then
combine them?

On Fri, Sep 21, 2018 at 12:34 PM Deniz Bahadir  wrote:

> Am 21.09.2018 um 18:38 schrieb Ke Gao:
> > Hi David,
> >
> > It didn't give me error info. It can produce the final static library,
> > but the contents of third party static libraries are not included.
>
> Some clarification regarding STATIC and OBJECT library targets and how
> they interact with each other using `target_link_libraries`:
>
>
> A STATIC library target A can be linked (via `target_link_libraries`) to
> another STATIC library target B.
>
>`target_link_libraries(A STATIC PUBLIC B)`
>
> However, the resulting library file libB does not contain the
> information (aka object-files) of libA.
> Instead, CMake makes sure to link both static library files libB and
> libA when e.g. creating an executable exeC1 using target C1 which just
> links (via `target_link_libraries`) to target B.
>
>`target_link_libraries(C1 EXECUTABLE PUBLIC B)`
>
> (Instead of an executable exeC1 you could have created a shared library
> libC1 instead. The behavior is the same.)
>
>
> If you instead want to create a combined, single STATIC library libC2,
> which contains the object-files archived in both static library files
> libA and libB created from targets A and B, then you somehow need to
> extract the archived object-files from libA and libB. I am not sure if
> CMake provides a (simple) way to do this.
>
>
>
> For OBJECT libraries the behavior is like this:
>
>
> An OBJECT library target X can be linked (via `target_link_libraries`)
> to another OBJECT library target Y.
>
>`target_link_libraries(Y OBJECT PUBLIC X)`
>
> This, however, only transports the usage-requirements
> (preprocessor-defines, include-paths etc.) from X to Y. The object-files
> of X are in no way referenced by Y.
>
> So, if you then create a STATIC target Z1 that links (via
> `target_link_libraries`) to Y,...
>
>`target_link_libraries(Z1 STATIC PUBLIC Y)`
>
> ... Z1 will reference/contain the usage-requirements of X and Y and the
> object-files of Y, but not the object-files of X. (The static library
> file libZ1 resulting from Z1 will contain the object-libraries of Y but
> not of X.)
>
>
> What you should do instead is not to link the OBJECT targets X and Y
> together but instead only link them (explicitly) to the STATIC target Z2:
>
>`target_link_libraries(Z2 STATIC PUBLIC Y X)`
>
> Z2 then references the usage-requirements as-well-as object-files of
> both OBJECT targets X and Y and the resulting static library file libZ2
> will then contain the object-files of both library targets, X and Y.
>
>
> >
> > Also, sorry for the mistake I have made in my previous email. Deniz is
> > right, the keyword "PUBLIC" should be used in target_link_librarie().
> >
> > Thanks
>
> You're welcome.
>
> Deniz
>
>
> >
> > On Fri, Sep 21, 2018 at 10:06 AM David Jobet  > > wrote:
> >
> > Hello,
> >
> > glad that could help you.
> > For your newer problem, you don't describe them, so it's tough to
> know
> > what kind of problems you're facing.
> > Maybe a small example of your CMakeLists.txt + a capture of the error
> > cmake gives you could help ?
> >
> > David
> > On Fri, Sep 21, 2018 at 4:52 PM Ke Gao  > > wrote:
> >  >
> >  > Thank you all for the help.
> >  >
> >  > I finally use a way quite similar to David's first approach. I
> > first generate all sub-projects into object libraries using
> > add_library(lib1 OBJECT SOURCES). Then in the final library, I use
> > add_library(single_static_lib STATIC SOURCES) and
> > target_link_libraries( single_static_lib lib1 lib2 ...). Note that I
> > didn't use " $" in the final "add_library" and
> > also didn't use "PUBLIC" keyword in the final
> > "target_link_libraries". It works on CMake v3.12.2 and gives me a
> > single static lib which combines all the objs I want.
> >  >
> >  > But currently I still have problems of further combining third
> > party static libraries into the final generated static
> > single_static_lib. Can anybody provide a solution for this?
> >  >
> >  > Thank you very much.
> >  >
> >  > Ke
> >  >
> >  > On Fri, Sep 21, 2018 at 6:15 AM Deniz Bahadir
> > mailto:dbaha...@benocs.com>> wrote:
> >  >>
> >  >> Am 21.09.2018 um 09:33 schrieb David Jobet:
> >  >> > Hello,
> >  >> >
> >  >> > I had a similar issue lately and wanted to "pack" several
> > static libs
> >  >> > into a dynamic one. (Not even talking about an INTERFACE lib
> > since I
> >  >> > really wanted that .so)
> >  >> > I made it work with 3 different solutions, none of them being
> > "clean"
> >  >> > from my point of view.
> >  >> >
> >  >> > 1- OBJECT 

Re: [CMake] Best way to combine generated static libraries into a single static library

2018-09-21 Thread Deniz Bahadir

Am 21.09.2018 um 18:38 schrieb Ke Gao:

Hi David,

It didn't give me error info. It can produce the final static library, 
but the contents of third party static libraries are not included.


Some clarification regarding STATIC and OBJECT library targets and how 
they interact with each other using `target_link_libraries`:



A STATIC library target A can be linked (via `target_link_libraries`) to 
another STATIC library target B.


  `target_link_libraries(A STATIC PUBLIC B)`

However, the resulting library file libB does not contain the 
information (aka object-files) of libA.
Instead, CMake makes sure to link both static library files libB and 
libA when e.g. creating an executable exeC1 using target C1 which just 
links (via `target_link_libraries`) to target B.


  `target_link_libraries(C1 EXECUTABLE PUBLIC B)`

(Instead of an executable exeC1 you could have created a shared library 
libC1 instead. The behavior is the same.)



If you instead want to create a combined, single STATIC library libC2, 
which contains the object-files archived in both static library files 
libA and libB created from targets A and B, then you somehow need to 
extract the archived object-files from libA and libB. I am not sure if 
CMake provides a (simple) way to do this.




For OBJECT libraries the behavior is like this:


An OBJECT library target X can be linked (via `target_link_libraries`) 
to another OBJECT library target Y.


  `target_link_libraries(Y OBJECT PUBLIC X)`

This, however, only transports the usage-requirements 
(preprocessor-defines, include-paths etc.) from X to Y. The object-files 
of X are in no way referenced by Y.


So, if you then create a STATIC target Z1 that links (via 
`target_link_libraries`) to Y,...


  `target_link_libraries(Z1 STATIC PUBLIC Y)`

... Z1 will reference/contain the usage-requirements of X and Y and the 
object-files of Y, but not the object-files of X. (The static library 
file libZ1 resulting from Z1 will contain the object-libraries of Y but 
not of X.)



What you should do instead is not to link the OBJECT targets X and Y 
together but instead only link them (explicitly) to the STATIC target Z2:


  `target_link_libraries(Z2 STATIC PUBLIC Y X)`

Z2 then references the usage-requirements as-well-as object-files of 
both OBJECT targets X and Y and the resulting static library file libZ2 
will then contain the object-files of both library targets, X and Y.





Also, sorry for the mistake I have made in my previous email. Deniz is 
right, the keyword "PUBLIC" should be used in target_link_librarie().


Thanks


You're welcome.

Deniz




On Fri, Sep 21, 2018 at 10:06 AM David Jobet > wrote:


Hello,

glad that could help you.
For your newer problem, you don't describe them, so it's tough to know
what kind of problems you're facing.
Maybe a small example of your CMakeLists.txt + a capture of the error
cmake gives you could help ?

David
On Fri, Sep 21, 2018 at 4:52 PM Ke Gao mailto:ke.gao...@gmail.com>> wrote:
 >
 > Thank you all for the help.
 >
 > I finally use a way quite similar to David's first approach. I
first generate all sub-projects into object libraries using
add_library(lib1 OBJECT SOURCES). Then in the final library, I use
add_library(single_static_lib STATIC SOURCES) and
target_link_libraries( single_static_lib lib1 lib2 ...). Note that I
didn't use " $" in the final "add_library" and
also didn't use "PUBLIC" keyword in the final
"target_link_libraries". It works on CMake v3.12.2 and gives me a
single static lib which combines all the objs I want.
 >
 > But currently I still have problems of further combining third
party static libraries into the final generated static
single_static_lib. Can anybody provide a solution for this?
 >
 > Thank you very much.
 >
 > Ke
 >
 > On Fri, Sep 21, 2018 at 6:15 AM Deniz Bahadir
mailto:dbaha...@benocs.com>> wrote:
 >>
 >> Am 21.09.2018 um 09:33 schrieb David Jobet:
 >> > Hello,
 >> >
 >> > I had a similar issue lately and wanted to "pack" several
static libs
 >> > into a dynamic one. (Not even talking about an INTERFACE lib
since I
 >> > really wanted that .so)
 >> > I made it work with 3 different solutions, none of them being
"clean"
 >> > from my point of view.
 >> >
 >> > 1- OBJECT libs on sub projects : add_library(lib1 OBJECT
SOURCES) and
 >> > for the single static lib : add_library(single_static_lib STATIC
 >> > $ ...)
 >> > Problem I faced : since OBJECT libs do not support
 >> > target_link_libraries(), I had to remove the existing one and move
 >> > them instead to the target_include_directories() using generators.
 >>
 >> This is no longer true. Since CMake 3.12 `target_link_libraries`
fully
 >> supports OBJECT libraries. You just need to pay attention to the

Re: [CMake] Best way to combine generated static libraries into a single static library

2018-09-21 Thread Ke Gao
Hi David,

It didn't give me error info. It can produce the final static library, but
the contents of third party static libraries are not included.

Also, sorry for the mistake I have made in my previous email. Deniz is
right, the keyword "PUBLIC" should be used in target_link_librarie().

Thanks

On Fri, Sep 21, 2018 at 10:06 AM David Jobet 
wrote:

> Hello,
>
> glad that could help you.
> For your newer problem, you don't describe them, so it's tough to know
> what kind of problems you're facing.
> Maybe a small example of your CMakeLists.txt + a capture of the error
> cmake gives you could help ?
>
> David
> On Fri, Sep 21, 2018 at 4:52 PM Ke Gao  wrote:
> >
> > Thank you all for the help.
> >
> > I finally use a way quite similar to David's first approach. I first
> generate all sub-projects into object libraries using add_library(lib1
> OBJECT SOURCES). Then in the final library, I use
> add_library(single_static_lib STATIC SOURCES) and target_link_libraries(
> single_static_lib lib1 lib2 ...). Note that I didn't use "
> $" in the final "add_library" and also didn't use
> "PUBLIC" keyword in the final "target_link_libraries". It works on CMake
> v3.12.2 and gives me a single static lib which combines all the objs I want.
> >
> > But currently I still have problems of further combining third party
> static libraries into the final generated static single_static_lib. Can
> anybody provide a solution for this?
> >
> > Thank you very much.
> >
> > Ke
> >
> > On Fri, Sep 21, 2018 at 6:15 AM Deniz Bahadir 
> wrote:
> >>
> >> Am 21.09.2018 um 09:33 schrieb David Jobet:
> >> > Hello,
> >> >
> >> > I had a similar issue lately and wanted to "pack" several static libs
> >> > into a dynamic one. (Not even talking about an INTERFACE lib since I
> >> > really wanted that .so)
> >> > I made it work with 3 different solutions, none of them being "clean"
> >> > from my point of view.
> >> >
> >> > 1- OBJECT libs on sub projects : add_library(lib1 OBJECT SOURCES) and
> >> > for the single static lib : add_library(single_static_lib STATIC
> >> > $ ...)
> >> > Problem I faced : since OBJECT libs do not support
> >> > target_link_libraries(), I had to remove the existing one and move
> >> > them instead to the target_include_directories() using generators.
> >>
> >> This is no longer true. Since CMake 3.12 `target_link_libraries` fully
> >> supports OBJECT libraries. You just need to pay attention to the special
> >> case of linking an OBJECT library with keyword "PUBLIC". (Object-files
> >> are always private and inherited object-files are therefore never
> >> further inherited. See:
> >>
> https://cmake.org/cmake/help/v3.12/command/target_link_libraries.html#linking-object-libraries
> )
> >>
> >> > e.g : target_include_directories(lib1 PUBLIC
> >> > $)
> >> > Because I had a dependency to a protobuf generated lib, I also had to
> >> > add manual add_dependencies to respect proper build order.
> >> > Not clean at all
> >> >
> >> > 2- add_library(mysharedlib STATIC CMakeLists.txt)
> >> > target_linked_libraries(mysharedlib PUBLIC lib1 ...)
> >> > Maybe the cleanest way I found.
> >> > The trick with CMakeLists.txt is that add_library needs at least one
> >> > source file. You can put any kind of files you want. CMakeLists.txt is
> >> > not compilable, so no extra compilation step, no need for dummy empty
> >> > source file and add_library is happy.
> >> > It did not work in my case because of problems related to how our .so
> >> > are used/generated. (problems at runtime with duplicated symbols in
> >> > protobufs)
> >> >
> >> > 3- a variation around 1
> >> > instead of defining OBJECT libs, define a variable holding all the
> >> > sources for lib1, another for lib2, ...
> >> > then just do add_library(mysharedlib STATIC ${SOURCES_FOR_lib1}
> >> > ${SOURCES_FOR_lib2})
> >> > It works a little bit like 1) but does not have any of its problems
> >> > (target_link, add_dependencies, generators, ...)
> >> > It has new problems of its own though : if your libs live in different
> >> > subfolders, the variables might not be visible from your
> >> > add_library(mysharedlib...) call.
> >> > To work around that, you can use PARENT_SCOPE (not sure if that works
> >> > accross several levels), or includes (defines those variables into
> >> > separate files living in each subfolders and include them in the
> >> > parent CMakeLists).
> >> >
> >> > Hope this helps (and I'd be happy to know of other ways)
> >> >
> >> > David
> >> > On Thu, Sep 20, 2018 at 5:45 PM Ke Gao  wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> I have a project which includes many sub-projects. Each sub-project
> generates a static library. In the main project, I want to combine the
> generated objs, generated static libraries from other sub-projects, and
> some other third party static libraries together into a single static
> library. Is there an elegant way to do this, or maybe an existing function?
> >> >>
> >> >> Thank you very much.
> >> >>
> >> >> --
> >> >>

Re: [CMake] Best way to combine generated static libraries into a single static library

2018-09-21 Thread David Jobet
Hello,

glad that could help you.
For your newer problem, you don't describe them, so it's tough to know
what kind of problems you're facing.
Maybe a small example of your CMakeLists.txt + a capture of the error
cmake gives you could help ?

David
On Fri, Sep 21, 2018 at 4:52 PM Ke Gao  wrote:
>
> Thank you all for the help.
>
> I finally use a way quite similar to David's first approach. I first generate 
> all sub-projects into object libraries using add_library(lib1 OBJECT 
> SOURCES). Then in the final library, I use add_library(single_static_lib 
> STATIC SOURCES) and target_link_libraries( single_static_lib lib1 lib2 ...). 
> Note that I didn't use " $" in the final "add_library" 
> and also didn't use "PUBLIC" keyword in the final "target_link_libraries". It 
> works on CMake v3.12.2 and gives me a single static lib which combines all 
> the objs I want.
>
> But currently I still have problems of further combining third party static 
> libraries into the final generated static single_static_lib. Can anybody 
> provide a solution for this?
>
> Thank you very much.
>
> Ke
>
> On Fri, Sep 21, 2018 at 6:15 AM Deniz Bahadir  wrote:
>>
>> Am 21.09.2018 um 09:33 schrieb David Jobet:
>> > Hello,
>> >
>> > I had a similar issue lately and wanted to "pack" several static libs
>> > into a dynamic one. (Not even talking about an INTERFACE lib since I
>> > really wanted that .so)
>> > I made it work with 3 different solutions, none of them being "clean"
>> > from my point of view.
>> >
>> > 1- OBJECT libs on sub projects : add_library(lib1 OBJECT SOURCES) and
>> > for the single static lib : add_library(single_static_lib STATIC
>> > $ ...)
>> > Problem I faced : since OBJECT libs do not support
>> > target_link_libraries(), I had to remove the existing one and move
>> > them instead to the target_include_directories() using generators.
>>
>> This is no longer true. Since CMake 3.12 `target_link_libraries` fully
>> supports OBJECT libraries. You just need to pay attention to the special
>> case of linking an OBJECT library with keyword "PUBLIC". (Object-files
>> are always private and inherited object-files are therefore never
>> further inherited. See:
>> https://cmake.org/cmake/help/v3.12/command/target_link_libraries.html#linking-object-libraries)
>>
>> > e.g : target_include_directories(lib1 PUBLIC
>> > $)
>> > Because I had a dependency to a protobuf generated lib, I also had to
>> > add manual add_dependencies to respect proper build order.
>> > Not clean at all
>> >
>> > 2- add_library(mysharedlib STATIC CMakeLists.txt)
>> > target_linked_libraries(mysharedlib PUBLIC lib1 ...)
>> > Maybe the cleanest way I found.
>> > The trick with CMakeLists.txt is that add_library needs at least one
>> > source file. You can put any kind of files you want. CMakeLists.txt is
>> > not compilable, so no extra compilation step, no need for dummy empty
>> > source file and add_library is happy.
>> > It did not work in my case because of problems related to how our .so
>> > are used/generated. (problems at runtime with duplicated symbols in
>> > protobufs)
>> >
>> > 3- a variation around 1
>> > instead of defining OBJECT libs, define a variable holding all the
>> > sources for lib1, another for lib2, ...
>> > then just do add_library(mysharedlib STATIC ${SOURCES_FOR_lib1}
>> > ${SOURCES_FOR_lib2})
>> > It works a little bit like 1) but does not have any of its problems
>> > (target_link, add_dependencies, generators, ...)
>> > It has new problems of its own though : if your libs live in different
>> > subfolders, the variables might not be visible from your
>> > add_library(mysharedlib...) call.
>> > To work around that, you can use PARENT_SCOPE (not sure if that works
>> > accross several levels), or includes (defines those variables into
>> > separate files living in each subfolders and include them in the
>> > parent CMakeLists).
>> >
>> > Hope this helps (and I'd be happy to know of other ways)
>> >
>> > David
>> > On Thu, Sep 20, 2018 at 5:45 PM Ke Gao  wrote:
>> >>
>> >> Hi,
>> >>
>> >> I have a project which includes many sub-projects. Each sub-project 
>> >> generates a static library. In the main project, I want to combine the 
>> >> generated objs, generated static libraries from other sub-projects, and 
>> >> some other third party static libraries together into a single static 
>> >> library. Is there an elegant way to do this, or maybe an existing 
>> >> function?
>> >>
>> >> Thank you very much.
>> >>
>> >> --
>> >> ..
>> >> Ke Gao
>>
>>
>> Hope that information was of value,
>> Deniz
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more 
>> information on each offering, please visit:
>>
>> CMake Support: 

Re: [CMake] Best way to combine generated static libraries into a single static library

2018-09-21 Thread Ke Gao
Thank you all for the help.

I finally use a way quite similar to David's first approach. I first
generate all sub-projects into object libraries using add_library(lib1
OBJECT SOURCES). Then in the final library, I use
add_library(single_static_lib STATIC SOURCES) and target_link_libraries(
single_static_lib lib1 lib2 ...). Note that I didn't use "
$" in the final "add_library" and also didn't use
"PUBLIC" keyword in the final "target_link_libraries". It works on CMake
v3.12.2 and gives me a single static lib which combines all the objs I
want.

But currently I still have problems of further combining third party static
libraries into the final generated static single_static_lib. Can anybody
provide a solution for this?

Thank you very much.

Ke

On Fri, Sep 21, 2018 at 6:15 AM Deniz Bahadir  wrote:

> Am 21.09.2018 um 09:33 schrieb David Jobet:
> > Hello,
> >
> > I had a similar issue lately and wanted to "pack" several static libs
> > into a dynamic one. (Not even talking about an INTERFACE lib since I
> > really wanted that .so)
> > I made it work with 3 different solutions, none of them being "clean"
> > from my point of view.
> >
> > 1- OBJECT libs on sub projects : add_library(lib1 OBJECT SOURCES) and
> > for the single static lib : add_library(single_static_lib STATIC
> > $ ...)
> > Problem I faced : since OBJECT libs do not support
> > target_link_libraries(), I had to remove the existing one and move
> > them instead to the target_include_directories() using generators.
>
> This is no longer true. Since CMake 3.12 `target_link_libraries` fully
> supports OBJECT libraries. You just need to pay attention to the special
> case of linking an OBJECT library with keyword "PUBLIC". (Object-files
> are always private and inherited object-files are therefore never
> further inherited. See:
>
> https://cmake.org/cmake/help/v3.12/command/target_link_libraries.html#linking-object-libraries
> )
>
> > e.g : target_include_directories(lib1 PUBLIC
> > $)
> > Because I had a dependency to a protobuf generated lib, I also had to
> > add manual add_dependencies to respect proper build order.
> > Not clean at all
> >
> > 2- add_library(mysharedlib STATIC CMakeLists.txt)
> > target_linked_libraries(mysharedlib PUBLIC lib1 ...)
> > Maybe the cleanest way I found.
> > The trick with CMakeLists.txt is that add_library needs at least one
> > source file. You can put any kind of files you want. CMakeLists.txt is
> > not compilable, so no extra compilation step, no need for dummy empty
> > source file and add_library is happy.
> > It did not work in my case because of problems related to how our .so
> > are used/generated. (problems at runtime with duplicated symbols in
> > protobufs)
> >
> > 3- a variation around 1
> > instead of defining OBJECT libs, define a variable holding all the
> > sources for lib1, another for lib2, ...
> > then just do add_library(mysharedlib STATIC ${SOURCES_FOR_lib1}
> > ${SOURCES_FOR_lib2})
> > It works a little bit like 1) but does not have any of its problems
> > (target_link, add_dependencies, generators, ...)
> > It has new problems of its own though : if your libs live in different
> > subfolders, the variables might not be visible from your
> > add_library(mysharedlib...) call.
> > To work around that, you can use PARENT_SCOPE (not sure if that works
> > accross several levels), or includes (defines those variables into
> > separate files living in each subfolders and include them in the
> > parent CMakeLists).
> >
> > Hope this helps (and I'd be happy to know of other ways)
> >
> > David
> > On Thu, Sep 20, 2018 at 5:45 PM Ke Gao  wrote:
> >>
> >> Hi,
> >>
> >> I have a project which includes many sub-projects. Each sub-project
> generates a static library. In the main project, I want to combine the
> generated objs, generated static libraries from other sub-projects, and
> some other third party static libraries together into a single static
> library. Is there an elegant way to do this, or maybe an existing function?
> >>
> >> Thank you very much.
> >>
> >> --
> >>
> ..
> >> Ke Gao
>
>
> Hope that information was of value,
> Deniz
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/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 Michael Jackson
So I tried using "-DCMAKE_GENERATOR_TOOLSET=x64" while configuring a clean 
build directory but it still picked up the x86 compiler. I ended up going into 
the "Settings" of Windows 10 and added the environment variable 
PreferredToolArchitecture=x64 to my account. Logged out, Logged back in and 
then did another configuration run and now during the cmake configuration run 
the proper 64 bit compiler is picked up and used. Still probably missing 
something obvious in the CMake file that I can add 

--
Mike Jackson 

On 9/21/18, 10:28 AM, "CMake on behalf of Mateusz Loskot" 
 wrote:

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



-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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 Michael Jackson
That will NOT use the x64 tool chain. It will use the 32 bit tool chain to 
produce a 64 bit binary, but NOT use the 64 bit compiler. 

Looks like there are 3 ways to do it:

https://stackoverflow.com/questions/46683300/use-64-bit-compiler-in-visual-studio

Either hack the project file or set an environment variable or use the -T 
host=x64" option with compiling (as Volker just mentioned).
--
Michael Jackson | Owner, President
  BlueQuartz Software
[e] mike.jack...@bluequartz.net
[w] www.bluequartz.net 

On 9/21/18, 10:41 AM, "R0b0t1"  wrote:

You select x64 when selecting the generator. Use "Visual Studio VV
 Win64" where VV is version and  is year.


-- 

Powered by www.kitware.com

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

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

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

Hi Michael,

I use the CMake generator toolset option "-T host=x64" when generating 
the solutions to force the 64 bit compiler being used.


Cheers, Volker

Am 21.09.2018 um 16:13 schrieb Michael Jackson:


The easy answer is to use “ninja” from a VS tools X64 Native command 
prompt. For those that want to actually use Visual Studio 15 2017 is 
there anything in CMake or an environment variable that can be set?



The issue is that when I configure I select “Visual Studio 15 2017 
Win64” BUT the actual tool chain that VS is using under the hood is a 
32 bit compiler. I have verified this through stack overflow and 
looking at the task manager.


https://stackoverflow.com/questions/46056263/use-the-64-bit-visual-c-toolset-in-visual-studio-2017

https://stackoverflow.com/questions/19820718/how-to-make-visual-studio-use-the-native-amd64-toolchain/25626630#25626630

Is there a CMake variable that I can set to tell Visual Studio to use 
the X64 toolchain?



Thanks

--

Michael Jackson | Owner, President

BlueQuartz Software

[e] mike.jack...@bluequartz.net 

[w] www.bluequartz.net 




--

--

Powered by www.kitware.com

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

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

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

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

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


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

2018-09-21 Thread R0b0t1
On Fri, Sep 21, 2018 at 4:13 PM, Michael Jackson
 wrote:
> The easy answer is to use “ninja” from a VS tools X64 Native command prompt.
> For those that want to actually use Visual Studio 15 2017 is there anything
> in CMake or an environment variable that can be set?
>
>
> The issue is that when I configure I select “Visual Studio 15 2017 Win64”
> BUT the actual tool chain that VS is using under the hood is a 32 bit
> compiler. I have verified this through stack overflow and looking at the
> task manager.
>
>
>
> https://stackoverflow.com/questions/46056263/use-the-64-bit-visual-c-toolset-in-visual-studio-2017
>
> https://stackoverflow.com/questions/19820718/how-to-make-visual-studio-use-the-native-amd64-toolchain/25626630#25626630
>
>
>
> Is there a CMake variable that I can set to tell Visual Studio to use the
> X64 toolchain?
>

You select x64 when selecting the generator. Use "Visual Studio VV
 Win64" where VV is version and  is year.

>
> Thanks
>
> --
>
> Michael Jackson | Owner, President
>
>   BlueQuartz Software
>
> [e] mike.jack...@bluequartz.net
>
> [w] www.bluequartz.net
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

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


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

2018-09-21 Thread Michael Jackson
The easy answer is to use “ninja” from a VS tools X64 Native command prompt. 
For those that want to actually use Visual Studio 15 2017 is there anything in 
CMake or an environment variable that can be set?


The issue is that when I configure I select “Visual Studio 15 2017 Win64” BUT 
the actual tool chain that VS is using under the hood is a 32 bit compiler. I 
have verified this through stack overflow and looking at the task manager.

 

https://stackoverflow.com/questions/46056263/use-the-64-bit-visual-c-toolset-in-visual-studio-2017

https://stackoverflow.com/questions/19820718/how-to-make-visual-studio-use-the-native-amd64-toolchain/25626630#25626630

 

Is there a CMake variable that I can set to tell Visual Studio to use the X64 
toolchain?


Thanks

--

Michael Jackson | Owner, President

  BlueQuartz Software

[e] mike.jack...@bluequartz.net

[w] www.bluequartz.net

-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] Finding a pkg-config file

2018-09-21 Thread Florian Lindner
Hello,

on a really weird configured system (but I can't change it), there is a 
pkg-config file which I want to find with cmake:

  set(ENV{PKG_CONFIG_PATH} 
"$ENV{PKG_CONFIG_PATH}:$ENV{PETSC_DIR}/lib/pkgconfig")
  set(CMAKE_PREFIX_PATH "$ENV{PETSC_DIR}/lib/pkgconfig")  
  find_package(PkgConfig REQUIRED)
  pkg_check_modules(PETSC REQUIRED craypetsc_real)

but

-- Checking for module 'craypetsc_real'
--   No package 'craypetsc_real' found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:363 (message):
  A required package was not found

  

> cat $PETSC_DIR/lib/pkgconfig/craypetsc_real.pc

VERSION=3.8.4.0
PE=GNU
pe=gnu
GENCOMP=7.1
CPU_TARGET=haswell

install_prefix=/opt/cray/pe
root=${install_prefix}/petsc/3.8.4.0/real
prefix=${root}/${PE}/${GENCOMP}/${CPU_TARGET}
libdir=${prefix}/lib
includedir=${prefix}/include

cray_as_needed=
cray_no_as_needed=

Name: craypetsc_real
Description: Scientific libraries
Version: ${VERSION}
Libs: -L${libdir} ${cray_as_needed}-lcraypetsc_gnu_71_real${cray_no_as_needed}  
-fopenmp
Libs.private: 
Requires: 
Requires.private: mpich >= 7.0 sci_mp >= 13.0 cray-tpsl >= 16.03.1 hdf5_parallel
Conflicts: hdf5
Cflags:  -I${includedir}

pkg-config also finds it:

> PKG_CONFIG_PATH=$PETSC_DIR/lib/pkgconfig pkg-config --print-variables 
> craypetsc_real 
cray_as_needed
prefix
libdir
[...]


CMakeError.log does not exist, CMakeOutput.log I have attached.

Thanks!
Florian
The target system is: Hazelhen -  - 
The host system is: Linux - 4.4.114-94.11-default - x86_64
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /opt/cray/pe/craype/2.5.15/bin/CC 
Build flags: -craympich-dpm
Id flags: 

The output was:
0


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"

The CXX compiler identification is GNU, found in "/zhome/academic/HLRS/ipv/ipvflind/software/precice/build/cmake-debug/CMakeFiles/3.5.2/CompilerIdCXX/a.out"

Determining if the CXX compiler works passed with the following output:
Change Dir: /zhome/academic/HLRS/ipv/ipvflind/software/precice/build/cmake-debug/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_7654f/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_7654f.dir/build.make CMakeFiles/cmTC_7654f.dir/build
gmake[1]: Entering directory '/zhome/academic/HLRS/ipv/ipvflind/software/precice/build/cmake-debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_7654f.dir/testCXXCompiler.cxx.obj
/opt/cray/pe/craype/2.5.15/bin/CC -craympich-dpm-o CMakeFiles/cmTC_7654f.dir/testCXXCompiler.cxx.obj -c /zhome/academic/HLRS/ipv/ipvflind/software/precice/build/cmake-debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_7654f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7654f.dir/link.txt --verbose=1
/opt/cray/pe/craype/2.5.15/bin/CC   -craympich-dpm CMakeFiles/cmTC_7654f.dir/testCXXCompiler.cxx.obj  -o cmTC_7654f 
gmake[1]: Leaving directory '/zhome/academic/HLRS/ipv/ipvflind/software/precice/build/cmake-debug/CMakeFiles/CMakeTmp'


Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /zhome/academic/HLRS/ipv/ipvflind/software/precice/build/cmake-debug/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_7b642/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_7b642.dir/build.make CMakeFiles/cmTC_7b642.dir/build
gmake[1]: Entering directory '/zhome/academic/HLRS/ipv/ipvflind/software/precice/build/cmake-debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_7b642.dir/CMakeCXXCompilerABI.cpp.obj
/opt/cray/pe/craype/2.5.15/bin/CC -craympich-dpm-o CMakeFiles/cmTC_7b642.dir/CMakeCXXCompilerABI.cpp.obj -c /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp
Linking CXX executable cmTC_7b642
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7b642.dir/link.txt --verbose=1
/opt/cray/pe/craype/2.5.15/bin/CC   -craympich-dpm-v CMakeFiles/cmTC_7b642.dir/CMakeCXXCompilerABI.cpp.obj  -o cmTC_7b642  
Using built-in specs.
COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/g++
COLLECT_LTO_WRAPPER=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
Thread model: posix
gcc version 7.3.0 20180125 (Cray Inc.) (GCC) 
COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/

Re: [CMake] Best way to combine generated static libraries into a single static library

2018-09-21 Thread Deniz Bahadir

Am 21.09.2018 um 09:33 schrieb David Jobet:

Hello,

I had a similar issue lately and wanted to "pack" several static libs
into a dynamic one. (Not even talking about an INTERFACE lib since I
really wanted that .so)
I made it work with 3 different solutions, none of them being "clean"
from my point of view.

1- OBJECT libs on sub projects : add_library(lib1 OBJECT SOURCES) and
for the single static lib : add_library(single_static_lib STATIC
$ ...)
Problem I faced : since OBJECT libs do not support
target_link_libraries(), I had to remove the existing one and move
them instead to the target_include_directories() using generators.


This is no longer true. Since CMake 3.12 `target_link_libraries` fully 
supports OBJECT libraries. You just need to pay attention to the special 
case of linking an OBJECT library with keyword "PUBLIC". (Object-files 
are always private and inherited object-files are therefore never 
further inherited. See: 
https://cmake.org/cmake/help/v3.12/command/target_link_libraries.html#linking-object-libraries)



e.g : target_include_directories(lib1 PUBLIC
$)
Because I had a dependency to a protobuf generated lib, I also had to
add manual add_dependencies to respect proper build order.
Not clean at all

2- add_library(mysharedlib STATIC CMakeLists.txt)
target_linked_libraries(mysharedlib PUBLIC lib1 ...)
Maybe the cleanest way I found.
The trick with CMakeLists.txt is that add_library needs at least one
source file. You can put any kind of files you want. CMakeLists.txt is
not compilable, so no extra compilation step, no need for dummy empty
source file and add_library is happy.
It did not work in my case because of problems related to how our .so
are used/generated. (problems at runtime with duplicated symbols in
protobufs)

3- a variation around 1
instead of defining OBJECT libs, define a variable holding all the
sources for lib1, another for lib2, ...
then just do add_library(mysharedlib STATIC ${SOURCES_FOR_lib1}
${SOURCES_FOR_lib2})
It works a little bit like 1) but does not have any of its problems
(target_link, add_dependencies, generators, ...)
It has new problems of its own though : if your libs live in different
subfolders, the variables might not be visible from your
add_library(mysharedlib...) call.
To work around that, you can use PARENT_SCOPE (not sure if that works
accross several levels), or includes (defines those variables into
separate files living in each subfolders and include them in the
parent CMakeLists).

Hope this helps (and I'd be happy to know of other ways)

David
On Thu, Sep 20, 2018 at 5:45 PM Ke Gao  wrote:


Hi,

I have a project which includes many sub-projects. Each sub-project generates a 
static library. In the main project, I want to combine the generated objs, 
generated static libraries from other sub-projects, and some other third party 
static libraries together into a single static library. Is there an elegant way 
to do this, or maybe an existing function?

Thank you very much.

--
..
Ke Gao



Hope that information was of value,
Deniz

--

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/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] Best way to combine generated static libraries into a single static library

2018-09-21 Thread David Jobet
Hello,

I had a similar issue lately and wanted to "pack" several static libs
into a dynamic one. (Not even talking about an INTERFACE lib since I
really wanted that .so)
I made it work with 3 different solutions, none of them being "clean"
from my point of view.

1- OBJECT libs on sub projects : add_library(lib1 OBJECT SOURCES) and
for the single static lib : add_library(single_static_lib STATIC
$ ...)
Problem I faced : since OBJECT libs do not support
target_link_libraries(), I had to remove the existing one and move
them instead to the target_include_directories() using generators.
e.g : target_include_directories(lib1 PUBLIC
$)
Because I had a dependency to a protobuf generated lib, I also had to
add manual add_dependencies to respect proper build order.
Not clean at all

2- add_library(mysharedlib STATIC CMakeLists.txt)
target_linked_libraries(mysharedlib PUBLIC lib1 ...)
Maybe the cleanest way I found.
The trick with CMakeLists.txt is that add_library needs at least one
source file. You can put any kind of files you want. CMakeLists.txt is
not compilable, so no extra compilation step, no need for dummy empty
source file and add_library is happy.
It did not work in my case because of problems related to how our .so
are used/generated. (problems at runtime with duplicated symbols in
protobufs)

3- a variation around 1
instead of defining OBJECT libs, define a variable holding all the
sources for lib1, another for lib2, ...
then just do add_library(mysharedlib STATIC ${SOURCES_FOR_lib1}
${SOURCES_FOR_lib2})
It works a little bit like 1) but does not have any of its problems
(target_link, add_dependencies, generators, ...)
It has new problems of its own though : if your libs live in different
subfolders, the variables might not be visible from your
add_library(mysharedlib...) call.
To work around that, you can use PARENT_SCOPE (not sure if that works
accross several levels), or includes (defines those variables into
separate files living in each subfolders and include them in the
parent CMakeLists).

Hope this helps (and I'd be happy to know of other ways)

David
On Thu, Sep 20, 2018 at 5:45 PM Ke Gao  wrote:
>
> Hi,
>
> I have a project which includes many sub-projects. Each sub-project generates 
> a static library. In the main project, I want to combine the generated objs, 
> generated static libraries from other sub-projects, and some other third 
> party static libraries together into a single static library. Is there an 
> elegant way to do this, or maybe an existing function?
>
> Thank you very much.
>
> --
> ..
> Ke Gao
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/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