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

2018-09-21 Thread Kitware Robot
t 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_VER

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

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

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

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

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

[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

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

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

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

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 >

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

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

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

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: > >

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(

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

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

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

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

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

[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

[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

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

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 :