[Cmake-commits] CMake branch, master, updated. v3.5.0-rc3-159-g1bf42fa

2016-03-04 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  1bf42fa9b93d86fd62803fd934d3a946eddf3188 (commit)
  from  831801671c247a219a5c2bf785d7c62b6cdf3e61 (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=1bf42fa9b93d86fd62803fd934d3a946eddf3188
commit 1bf42fa9b93d86fd62803fd934d3a946eddf3188
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Sat Mar 5 00:01:04 2016 -0500
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Sat Mar 5 00:01:04 2016 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index d19f965..0a386ae 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 5)
-set(CMake_VERSION_PATCH 20160304)
+set(CMake_VERSION_PATCH 20160305)
 #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
http://public.kitware.com/mailman/listinfo/cmake-commits


[cmake-developers] patch for module GetPrerequisites

2016-03-04 Thread Benjamin Ballet
Hello

We are using fixup_bundle on Windows and I discovered that this function
doesn't work if the path of the app is not in it's canonical form.

Of course I can canonicalize the path of the app but I would like to fix
this issue for everyone.

The fail occurs during verify_app in the function gp_resolved_file_type
from module GetPrerequisites. This function test if two paths are equal
without translating them to there canonical form before.

Here is the patch for this modification

-- 
*Benjamin BALLET*
Ingénieur R

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


0001-GetPrerequisites-function-gp_resolved_file_type-shou.patch
Description: Binary data
-- 

Powered by www.kitware.com

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

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

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

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

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

Re: [cmake-developers] C++11 only for a specified subdirectory

2016-03-04 Thread Konstantin Podsvirov
Hi, Roman!

You can use properties for each target:

C_STANDART
C_STANDARD_REQUIRED

CXX_STANDARD
CXX_STANDARD_REQUIRED

Read online:

https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#properties-on-targets

And this question is for cm...@cmake.org list :-)

04.03.2016, 16:20, "Roman Wüger" :
> Hi,
>
> is it possible to activate C++11 only for a subdirectory?
>
> Regards
> Roman
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers

Regards,
Konstantin Podsvirov
-- 

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] [cmake-developers] C++11 only for a specified subdirectory

2016-03-04 Thread Konstantin Podsvirov
Hi, Roman!

You can use properties for each target:

C_STANDART
C_STANDARD_REQUIRED

CXX_STANDARD
CXX_STANDARD_REQUIRED

Read online:

https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#properties-on-targets

And this question is for cmake@cmake.org list :-)

04.03.2016, 16:20, "Roman Wüger" :
> Hi,
>
> is it possible to activate C++11 only for a subdirectory?
>
> Regards
> Roman
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers

Regards,
Konstantin Podsvirov
-- 

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-04 Thread Benjamin Ballet
FYI verifying_app failed with main.exe failed (3.4.3) because toptool
depends on topdool.dll located only in toptoolfolder. The workaround is to
include toptoolfolder in libs folder for fixup_bundle(main.exe...)

David your answer was helpful to me. I know it's an expected behavior.

Would a patch handling such multiple folder application been accepted ? I
may try to work on it, since I either have to work on the workarounds or a
nice improvment.


2016-03-04 14:15 GMT+01:00 Benjamin Ballet :

> Indeed I was lucky : It worked with 3.3.1 but not anymore with 3.4.3..
> I've got a strang bug with one .NET dll generated near a tool :
>
> CMake Error at C:/Program Files
> (x86)/CMake/share/cmake-3.4/Modules/GetPrerequisites.cmake:798 (message):
> 106>C:/Program Files (x86)/Microsoft Visual Studio
> 12.0/VC/bin/dumpbin.exe
> 106>failed: 1181
>
> I'm digging
>
>
>
> 2016-03-03 21:02 GMT+01:00 David Cole :
>
>> It was designed originally with the assumption that all the
>> executables in a bundle are in the same directory. If you violate that
>> assumption, I don't think you can count on it to do the right thing
>> 100% of the time.
>>
>> If it works for you calling it multiple times with deepest first, then
>> maybe you can get lucky...
>>
>> I would definitely dig into it and understand exactly what it's doing,
>> though, if you want to make sure it's going to continue working for
>> your scenario.
>>
>>
>> HTH,
>> David C.
>>
>>
>> On Thu, Mar 3, 2016 at 1:43 PM, Benjamin Ballet 
>> wrote:
>> > Hello
>> >
>> > I'd like to discuss a problem I encountered today with the very useful
>> > module BundleUtilities
>> >
>> > We have an application on Windows with one main exe file in the top
>> folder
>> > and a few other exe in subdirectories, like that :
>> >
>> > applicationfolder  \
>> >   | main.exe
>> >   | toolsfolder \
>> > | supertoolfolder \
>> > |
>> > supertool.exe
>> > | toptoolfolder \
>> >  |
>> > toptool.exe
>> >
>> > But if I simply call
>> > fixup_bundle("applicationfolder/main.exe" plugins libs)
>> >
>> > the verify_app will fails.
>> >
>> > Just a reminder that there is no rpath on Windows : dll must be either
>> in
>> > PATH or in the same folder or in the working directory.
>> >
>> > We expected fixup_bundle to copy the required dll for main.exe in
>> > applicationfolder, the required dll for supertool.exe in
>> supertoolfolder and
>> > the required dll for toptool.exe in toptoolfolder, but it acually didn't
>> > copied anything in supertoolfolder and toptoolfolder.
>> >
>> > I worked around this issue by calling fixup_bundle multiple time with
>> the
>> > following order : (the deepest exes first)
>> >
>> >
>> fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
>> > plugins libs)
>> > fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
>> > plugins libs)
>> > fixup_bundle("applicationfolder/main.exe" plugins libs)
>> >
>> >
>> > --
>> > Benjamin BALLET
>> > Ingénieur R
>> >
>> > ACTIVISU
>> > 19, rue Klock - 92110 Clichy
>> >> Standard Tél :  01 44 69 37 37
>> >> www.activisu.com
>> >
>> > --
>> >
>> > Powered by www.kitware.com
>> >
>> > Please keep messages on-topic and check the CMake FAQ at:
>> > http://www.cmake.org/Wiki/CMake_FAQ
>> >
>> > Kitware offers various services to support the CMake community. For more
>> > information on each offering, please visit:
>> >
>> > CMake Support: http://cmake.org/cmake/help/support.html
>> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/cmake
>>
>
>
>
> --
> *Benjamin BALLET*
> Ingénieur R
>
> *ACTIVISU*
> 19, rue Klock - 92110 Clichy
> *> Standard Tél* :  01 44 69 37 37
> *>* www.activisu.com
>



-- 
*Benjamin BALLET*
Ingénieur R

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

Powered by www.kitware.com

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

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

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

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

Follow this link to subscribe/unsubscribe:

Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-04 Thread Cristian Adam
Hi Anton,

When I say clang-cl I mean how the official llvm package does it - a 50mb
executable named cl.exe and not clang-cl.exe.

Ninja believes it compiles with visual c++, but instead it compiles with
clang. That's why you need to put the path to clang INCLUDE and PATH first.

Simply rename clang-cl.exe as cl.exe, copy it in a directory and put that
path as first in the PATH environment variable.

Cheers,
Cristian.
On Mar 4, 2016 12:16, "Anton Yartsev"  wrote:

> Hi Cristian,
>
> thanks for the replay. I have clang-cl first in PATH, the problem persists.
>
> $ SET PATH
> Path=D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin;...
>
> $cd D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin
> $dir
>  Directory of D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin
>
> 04.03.2016  14:03  .
> 04.03.2016  14:03  ..
> 04.03.2016  01:0011 662 848 arcmt-test.exe
> 04.03.2016  01:02 6 446 080 bugpoint.exe
> 04.03.2016  01:01 9 728 c-arcmt-test.exe
> 04.03.2016  01:0182 944 c-index-test.exe
> 04.03.2016  17:2040 207 872 clang++.exe
> 04.03.2016  01:0132 803 840 clang-check.exe
> 04.03.2016  17:2040 207 872 clang-cl.exe
> 04.03.2016  01:00 1 401 856 clang-format.exe
> 04.03.2016  17:05   814 592 clang-tblgen.exe
> 04.03.2016  17:2040 207 872 clang.exe
> ...
>
>
> Hi Anton,
>
> clang.exe doesn't know of any windows specific things.  Clang-cl instead
> does.
>
> Just make sure to have clang-cl before msvc-cl in path and ninja will just
> work.
>
> Cheers,
> Cristian
> On Mar 4, 2016 01:31, "Anton Yartsev"  wrote:
>
>> Hi all,
>>
>> I'm trying to use Clang, compiled with VS 2013 (configuration:Release,
>> platform:x64) as a C/C++ compiler for a simple HelloWorld CMake project.
>> Generation ends up with errors like "clang.exe: error: no such file or
>> directory: '/DWIN32'" at compiler check stage. If I understand correctly
>> the problem is that MSVC compiler options are fed to Clang for some reason
>> (maybe the "-- The C compiler identification is unknown" log entry is
>> related to the problem?).
>> Could anyone help to resolve this, please?
>>
>> I also tried to change compiler ID with "-DCMAKE_C_COMPILER_ID=Clang
>> -DCMAKE_CXX_COMPILER_ID=Clang", then compilation succeeded, but linkage
>> failed (just as described in the thread "Question on usage of cmake on
>> Windows with clang"
>> http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/54650).
>> Here the problem seems to be reversed: GNU linker options are fed to MS
>> linker.
>>
>> ** Setup and details:
>> 1) INCLUDE and PATH set to clang/clang-cl
>> 2) command line environment is configured with vsvars32.bat
>> 3) CC and CXX set to clang
>>
>> $ cat CMakeLists.txt
>> project(test_project)
>> add_executable(main file.cpp)
>>
>> $ cmake -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang ..
>>
>> Log:
>> -- The C compiler identification is unknown
>> -- The CXX compiler identification is Clang 3.7.1
>> -- Check for working C compiler using: Ninja
>> -- Check for working C compiler using: Ninja -- broken
>> CMake Error at C:/Program
>> Files/CMake/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
>>   The C compiler "D:/-Work-/llvm-3.7.1.src/-VS_build VS
>>   2013-/Release/bin/clang.exe" is not able to compile a simple test
>> program.
>>   It fails with the following output:
>>Change Dir: D:/-Work-/llvm-3.7.1.src/-CLANG-/CMakeFiles/CMakeTmp
>>
>>   Run Build Command:"C:/PROGRA~1/ninja/ninja.exe" "cmTC_2cb9d"
>>
>>   [1/2] Building C object CMakeFiles\cmTC_2cb9d.dir\testCCompiler.c.obj
>>
>>   FAILED: D:\-Work-\LLVM-3~2.SRC\-VS_BU~2\Release\bin\clang.exe /DWIN32
>>   /D_WINDOWS /W3 -o CMakeFiles\cmTC_2cb9d.dir\testCCompiler.c.obj -c
>>   testCCompiler.c
>>
>>   clang.exe: error: no such file or directory: '/DWIN32'
>>   clang.exe: error: no such file or directory: '/D_WINDOWS'
>> ...
>>
>> OS: Windows 7 (x64)
>>
>> clang version 3.7.1 (tags/RELEASE_371/final)
>> Target: x86_64-pc-windows-msvc
>> Thread model: posix
>>
>> cmake version 3.5.0-rc3
>>
>> Thank you!
>>
>> --
>> Anton
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>>
>
>
> --
> Anton
>
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the 

Re: [CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-04 Thread Benjamin Ballet
Indeed I was lucky : It worked with 3.3.1 but not anymore with 3.4.3..
I've got a strang bug with one .NET dll generated near a tool :

CMake Error at C:/Program Files
(x86)/CMake/share/cmake-3.4/Modules/GetPrerequisites.cmake:798 (message):
106>C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/dumpbin.exe
106>failed: 1181

I'm digging



2016-03-03 21:02 GMT+01:00 David Cole :

> It was designed originally with the assumption that all the
> executables in a bundle are in the same directory. If you violate that
> assumption, I don't think you can count on it to do the right thing
> 100% of the time.
>
> If it works for you calling it multiple times with deepest first, then
> maybe you can get lucky...
>
> I would definitely dig into it and understand exactly what it's doing,
> though, if you want to make sure it's going to continue working for
> your scenario.
>
>
> HTH,
> David C.
>
>
> On Thu, Mar 3, 2016 at 1:43 PM, Benjamin Ballet 
> wrote:
> > Hello
> >
> > I'd like to discuss a problem I encountered today with the very useful
> > module BundleUtilities
> >
> > We have an application on Windows with one main exe file in the top
> folder
> > and a few other exe in subdirectories, like that :
> >
> > applicationfolder  \
> >   | main.exe
> >   | toolsfolder \
> > | supertoolfolder \
> > |
> > supertool.exe
> > | toptoolfolder \
> >  |
> > toptool.exe
> >
> > But if I simply call
> > fixup_bundle("applicationfolder/main.exe" plugins libs)
> >
> > the verify_app will fails.
> >
> > Just a reminder that there is no rpath on Windows : dll must be either in
> > PATH or in the same folder or in the working directory.
> >
> > We expected fixup_bundle to copy the required dll for main.exe in
> > applicationfolder, the required dll for supertool.exe in supertoolfolder
> and
> > the required dll for toptool.exe in toptoolfolder, but it acually didn't
> > copied anything in supertoolfolder and toptoolfolder.
> >
> > I worked around this issue by calling fixup_bundle multiple time with the
> > following order : (the deepest exes first)
> >
> >
> fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
> > plugins libs)
> > fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
> > plugins libs)
> > fixup_bundle("applicationfolder/main.exe" plugins libs)
> >
> >
> > --
> > Benjamin BALLET
> > Ingénieur R
> >
> > ACTIVISU
> > 19, rue Klock - 92110 Clichy
> >> Standard Tél :  01 44 69 37 37
> >> www.activisu.com
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Kitware offers various services to support the CMake community. For more
> > information on each offering, please visit:
> >
> > CMake Support: http://cmake.org/cmake/help/support.html
> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
> > CMake Training Courses: http://cmake.org/cmake/help/training.html
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/cmake
>



-- 
*Benjamin BALLET*
Ingénieur R

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

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-04 Thread Benjamin Eikel

Hi Anton,

Zitat von Anton Yartsev :


Here are the results from 'CXX=clang-cl.exe CC=clang-cl.exe cmake -G  
"Ninja" ..' :


$ set CXX=clang-cl
$ set CC=clang-cl
$ cmake -G "Ninja" ..

-- No build type selected, default to Debug
-- The C compiler identification is Clang 3.7.1
-- The CXX compiler identification is Clang 3.7.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at C:/Program  
Files/CMake/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61  
(message):

  The C compiler "D:/-Work-/llvm-3.7.1.src/-VS_build VS
  2013-/Release/bin/clang-cl.exe" is not able to compile a simple test
  program.


the path to your compiler seems to have spaces in it. I had problems  
on Windows with spaces or other special characters in the compiler  
path, too. Please try to locate the compiler in another path and see  
if it fixes your issue. If it does, maybe the CMake developers could  
check the path escaping on Windows.


Kind regards
Benjamin

--

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-04 Thread Anton Yartsev

Hi,

On 4 March 2016 at 11:16, Anton Yartsev  wrote:

Hi Cristian,

thanks for the replay. I have clang-cl first in PATH, the problem persists.

Just to check. Did you run cmake in a new (i.e. empty) build directory
when you fixed that? IIRC once a compiler has been picked
during configure you can't change it so if you need to change it you
have to build in a new build directory or delete everything in
the current build directory.

Shouldn't the following work (assuming clang-cl.exe is in your path)

CXX=clang-cl.exe CC=clang-cl.exe cmake -G "Ninja" ..

?

Hi Dan,

I haven't fixed that, clang/clang-cl was initially first in PATH. I 
deleted CMakeFiles dir and CMakeCache.txt before each try.
Just tried to build from the scratch in the new empty directory - the 
problem persists.


Here are the results from 'CXX=clang-cl.exe CC=clang-cl.exe cmake -G 
"Ninja" ..' :


$ set CXX=clang-cl
$ set CC=clang-cl
$ cmake -G "Ninja" ..

-- No build type selected, default to Debug
-- The C compiler identification is Clang 3.7.1
-- The CXX compiler identification is Clang 3.7.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at C:/Program 
Files/CMake/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):

  The C compiler "D:/-Work-/llvm-3.7.1.src/-VS_build VS
  2013-/Release/bin/clang-cl.exe" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: D:/-Work-/llvm-3.7.1.src/-CLANG-/CMakeFiles/CMakeTmp

  Run Build Command:"C:/PROGRA~1/ninja/ninja.exe" "cmTC_75d21"

  [1/2] Building C object CMakeFiles\cmTC_75d21.dir\testCCompiler.c.obj

  [2/2] Linking C executable cmTC_75d21.exe

  FAILED: cmd.exe /C "cd .  && "C:\Program Files\CMake\bin\cmake.exe" -E
  vs_link_exe --intdir=CMakeFiles\cmTC_75d21.dir --manifests --
  CMAKE_LINKER-NOTFOUND /nologo 
CMakeFiles\cmTC_75d21.dir\testCCompiler.c.obj
  /out:cmTC_75d21.exe /implib:cmTC_75d21.lib /pdb:cmTC_75d21.pdb 
/version:0.0
  /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib 
user32.lib

  gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
  comdlg32.lib advapi32.lib && cd ."

  RC Pass 1 failed to run.

  ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:29 (project)

-- Configuring incomplete, errors occurred!
See also "D:/-Work-/llvm-3.7.1.src/-CLANG-/CMakeFiles/CMakeOutput.log".
See also "D:/-Work-/llvm-3.7.1.src/-CLANG-/CMakeFiles/CMakeError.log".

--
Anton

--

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] [cmake-developers] Appending to LINK_FLAGS property of a target doesn't seem to work correctly

2016-03-04 Thread Nils Gladitz

On 03/04/2016 12:42 PM, Dan Liew wrote:

Thanks for this. Shouldn't the fact that ``LINK_FLAGS`` is a string
property and not a list property be in the ``cmake-properties``
documentation? The version of the documentation for my version of
CMake (3.4.3) doesn't say what the property type is.


Perhaps though the plain string properties predate the list properties 
which is probably why the documentation does it the other way around e.g.
https://cmake.org/cmake/help/v3.4/prop_dir/COMPILE_OPTIONS.html is 
documented explicitly as a list property.


COMPILE_OPTIONS deprecated the old COMPILE_FLAGS property (which was 
plain string based).
For LINK_FLAGS the same thing was supposed to happen at some point but 
the topic working on this seems to have stalled.


Nils
--

Powered by www.kitware.com

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

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

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

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

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


Re: [cmake-developers] Appending to LINK_FLAGS property of a target doesn't seem to work correctly

2016-03-04 Thread Dan Liew
On 3 March 2016 at 22:02, Nils Gladitz  wrote:
> On 03.03.2016 22:57, Dan Liew wrote:
>>
>> Hi,
>>
>> I noticed recently is you do something like this
>>
>> add_executable(foo a.cpp b.cpp)
>> set_property(TARGET shell APPEND PROPERTY LINK_FLAGS "-fopenmp")
>> set_property(TARGET shell APPEND PROPERTY LINK_FLAGS "-static")
>>
>> then the flags that end up being passed to the compiler during linking
>> are like this.
>>
>> gcc -g -O0 -fopenmp;-static
>>
>> It looks like when using the property with APPEND it becomes a list
>> but when emitted the list isn't expanded properly. I noticed this
>> using CMake 3.4.3 using the "Unix Makefile" generator.
>>
>> Is this intentional or is this a bug?
>
>
> LINK_FLAGS is not a list property; flags have to be whitespace separated.
> You can use APPEND_STRING instead of APPEND for this.

Thanks for this. Shouldn't the fact that ``LINK_FLAGS`` is a string
property and not a list property be in the ``cmake-properties``
documentation? The version of the documentation for my version of
CMake (3.4.3) doesn't say what the property type is.

Thanks,
Dan.
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] [cmake-developers] Appending to LINK_FLAGS property of a target doesn't seem to work correctly

2016-03-04 Thread Dan Liew
On 3 March 2016 at 22:02, Nils Gladitz  wrote:
> On 03.03.2016 22:57, Dan Liew wrote:
>>
>> Hi,
>>
>> I noticed recently is you do something like this
>>
>> add_executable(foo a.cpp b.cpp)
>> set_property(TARGET shell APPEND PROPERTY LINK_FLAGS "-fopenmp")
>> set_property(TARGET shell APPEND PROPERTY LINK_FLAGS "-static")
>>
>> then the flags that end up being passed to the compiler during linking
>> are like this.
>>
>> gcc -g -O0 -fopenmp;-static
>>
>> It looks like when using the property with APPEND it becomes a list
>> but when emitted the list isn't expanded properly. I noticed this
>> using CMake 3.4.3 using the "Unix Makefile" generator.
>>
>> Is this intentional or is this a bug?
>
>
> LINK_FLAGS is not a list property; flags have to be whitespace separated.
> You can use APPEND_STRING instead of APPEND for this.

Thanks for this. Shouldn't the fact that ``LINK_FLAGS`` is a string
property and not a list property be in the ``cmake-properties``
documentation? The version of the documentation for my version of
CMake (3.4.3) doesn't say what the property type is.

Thanks,
Dan.
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-04 Thread Dan Liew
Hi,

On 4 March 2016 at 11:16, Anton Yartsev  wrote:
> Hi Cristian,
>
> thanks for the replay. I have clang-cl first in PATH, the problem persists.

Just to check. Did you run cmake in a new (i.e. empty) build directory
when you fixed that? IIRC once a compiler has been picked
during configure you can't change it so if you need to change it you
have to build in a new build directory or delete everything in
the current build directory.

Shouldn't the following work (assuming clang-cl.exe is in your path)

CXX=clang-cl.exe CC=clang-cl.exe cmake -G "Ninja" ..

?
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Problem using VS-compiled Clang as a C/C++ compiler.

2016-03-04 Thread Anton Yartsev

Hi Cristian,

thanks for the replay. I have clang-cl first in PATH, the problem persists.

$ SET PATH
Path=D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin;...

$cd D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin
$dir
 Directory of D:\-Work-\llvm-3.7.1.src\-VS_build VS 2013-\Release\bin

04.03.2016  14:03  .
04.03.2016  14:03  ..
04.03.2016  01:0011 662 848 arcmt-test.exe
04.03.2016  01:02 6 446 080 bugpoint.exe
04.03.2016  01:01 9 728 c-arcmt-test.exe
04.03.2016  01:0182 944 c-index-test.exe
04.03.2016  17:2040 207 872 clang++.exe
04.03.2016  01:0132 803 840 clang-check.exe
04.03.2016  17:2040 207 872 clang-cl.exe
04.03.2016  01:00 1 401 856 clang-format.exe
04.03.2016  17:05   814 592 clang-tblgen.exe
04.03.2016  17:2040 207 872 clang.exe
...



Hi Anton,

clang.exe doesn't know of any windows specific things.  Clang-cl 
instead does.


Just make sure to have clang-cl before msvc-cl in path and ninja will 
just work.


Cheers,
Cristian

On Mar 4, 2016 01:31, "Anton Yartsev" > wrote:


Hi all,

I'm trying to use Clang, compiled with VS 2013
(configuration:Release, platform:x64) as a C/C++ compiler for a
simple HelloWorld CMake project. Generation ends up with errors
like "clang.exe: error: no such file or directory: '/DWIN32'" at
compiler check stage. If I understand correctly the problem is
that MSVC compiler options are fed to Clang for some reason (maybe
the "-- The C compiler identification is unknown" log entry is
related to the problem?).
Could anyone help to resolve this, please?

I also tried to change compiler ID with
"-DCMAKE_C_COMPILER_ID=Clang -DCMAKE_CXX_COMPILER_ID=Clang", then
compilation succeeded, but linkage failed (just as described in
the thread "Question on usage of cmake on Windows with clang"
http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/54650).
Here the problem seems to be reversed: GNU linker options are fed
to MS linker.

** Setup and details:
1) INCLUDE and PATH set to clang/clang-cl
2) command line environment is configured with vsvars32.bat
3) CC and CXX set to clang

$ cat CMakeLists.txt
project(test_project)
add_executable(main file.cpp)

$ cmake -G "Ninja" -DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang ..

Log:
-- The C compiler identification is unknown
-- The CXX compiler identification is Clang 3.7.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at C:/Program
Files/CMake/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61
(message):
  The C compiler "D:/-Work-/llvm-3.7.1.src/-VS_build VS
  2013-/Release/bin/clang.exe" is not able to compile a simple
test program.
  It fails with the following output:
   Change Dir: D:/-Work-/llvm-3.7.1.src/-CLANG-/CMakeFiles/CMakeTmp

  Run Build Command:"C:/PROGRA~1/ninja/ninja.exe" "cmTC_2cb9d"

  [1/2] Building C object
CMakeFiles\cmTC_2cb9d.dir\testCCompiler.c.obj

  FAILED: D:\-Work-\LLVM-3~2.SRC\-VS_BU~2\Release\bin\clang.exe
/DWIN32
  /D_WINDOWS /W3 -o CMakeFiles\cmTC_2cb9d.dir\testCCompiler.c.obj -c
  testCCompiler.c

  clang.exe: error: no such file or directory: '/DWIN32'
  clang.exe: error: no such file or directory: '/D_WINDOWS'
...

OS: Windows 7 (x64)

clang version 3.7.1 (tags/RELEASE_371/final)
Target: x86_64-pc-windows-msvc
Thread model: posix

cmake version 3.5.0-rc3

Thank you!

-- 
Anton


-- 


Powered by www.kitware.com 

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

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

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

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

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




--
Anton

-- 

Powered by www.kitware.com

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

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 

[cmake-developers] [CMake 0016007]: Visual Studio 2015 + v110_xp toolset + MFC: rerun cmake 3.5.0-rc3 inside Visual Studio breaks compilation

2016-03-04 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://public.kitware.com/Bug/view.php?id=16007 
== 
Reported By:Anatoly Shirokov
Assigned To:
== 
Project:CMake
Issue ID:   16007
Category:   CCMake
Reproducibility:always
Severity:   block
Priority:   normal
Status: new
== 
Date Submitted: 2016-03-04 13:47 MSK
Last Modified:  2016-03-04 13:47 MSK
== 
Summary:Visual Studio 2015 + v110_xp toolset + MFC: rerun
cmake 3.5.0-rc3 inside Visual Studio breaks compilation
Description: 
When I change CMakeLists.txt inside Visual Studio 2015 and try to rebuild my
solution, I get complication errors:
Error C2039: 'SetDefaultDllDirectories' : is not a member of '`global
namespace'' c:\program files (x86)\microsoft visual studio
14.0\vc\atlmfc\include\atlcore.h 638 1 
Error C2065: 'SetDefaultDllDirectories' : undeclared identifier c:\program files
(x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 638 1 
Error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32' : undeclared identifier c:\program
files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 640 1

Steps to Reproduce: 
1. generate mfc project 

>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"\vcvarsall.bat x86

>set PATH=%VCINSTALLDIR%\bin;C:\Program Files (x86)\CMake 3.5\bin;%PATH%;

>cmake --version
cmake version 3.5.0-rc3

>cmake -G "Visual Studio 14 2015" -T v110_xp ..\src

2. open the solution in Visual Studio 2015

3. build the solution without any errors

4. change CMakeLists.txt

5. rebuild the solutions and get errors:
Error C2039: 'SetDefaultDllDirectories' : is not a member of '`global
namespace'' c:\program files (x86)\microsoft visual studio
14.0\vc\atlmfc\include\atlcore.h 638 1 
Error C2065: 'SetDefaultDllDirectories' : undeclared identifier c:\program files
(x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 638 1 
Error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32' : undeclared identifier c:\program
files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 640 1


Additional Information: 
I have found the feedback related to this problem:
https://connect.microsoft.com/VisualStudio/feedback/details/773422/compiler-error-when-using-v110-xp-platform-toolset-visual-studio-2012

There is a workaround posted by Wouter_Demuynck on 17.12.2012 at 4:07:
I noticed that selecting the v110_xp toolset in the process properties did not
automatically enable the _USING_V110_SDK71_ preprocessor flag.

After manually adding the following define at the top of my stdafx.h, the
project compiled fine:

#define _USING_V110_SDK71_

I have added #define _USING_V110_SDK71_ to my CMakeFiles.txt, and it solved the
problem, but may be there is more elegance solution? 
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-03-04 13:47 Anatoly ShirokovNew Issue
==

-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] Third CSCESM2016 - Computer Science, Computer Engineering, and Social Media - Greece

2016-03-04 Thread Jackie Blanco
The Third International Conference on Computer Science, Computer 
Engineering, and Social Media (CSCESM2016)


Metropolitan College, Thessaloniki, Greece
May 13-15, 2016
http://www.sdiwc.net/conferences/cscesm2016/
csces...@sdiwc.net

The published proceedings will be submitted for indexing in ResearchBib, 
ProQuest, ResearchGate, Academia and Google Scholar Databases. In 
addition, they will be reviewed for possible inclusion within the 
INSPEC, EI, DBLP, and Microsoft Academic Research Databases. BEST 
registered papers will be published in one of the following special 
issues provided that the author do major improvements and extension 
within the time frame that will be set by the conference and his/her 
paper is approved by the chief editor:


- International Journal of New Computer Architectures and their 
Applications (IJNCAA); EISSN 2220-9085, ISSN 2412-3587
- International Journal of Cyber-Security and Digital Forensics 
(IJCSDF); EISSN 2225-658X, ISSN 2412-6551
- International Journal of Digital Information and Wireless 
Communications (IJDIWC); EISSN 2305-0012
- International Journal of New Computer Architectures and their 
Applications (IJNCAA); EISSN 2410-0439


The conference welcomes papers on the following (but not limited to) 
research topics:

*Computer Science
Access Controls
Biometrics Technologies
Computer Forensics
Computer Security
Data Mining
Cryptography and Data Protection
E-Learning
Network Security
Wireless Communications

*Computer Engineering
Computer Architecture
Computer-aided Design
Computer Networks
Multimedia Applications
Network Security and Cryptography
Computer Animation
Expert Systems

*Social Media
Image / multimedia processing
Human-computer interaction
Social networking sites
Social innovation and effecting change
Collaborative filtering
Social networks and online education

Researchers are encouraged to submit their work electronically. All 
papers will be fully refereed by a minimum of two specialized referees. 
Before final acceptance, all referees comments must be considered.


Important Dates
===
Submission Deadline April 13, 2016
Acceptance Notification 2-4 weeks from the date of submission
Final Notification  April 23, 2016
Camera Ready Deadline   May 3, 2016
Registration Deadline   May 3, 2016
Conference DatesMay 13-15, 2016

--

Powered by www.kitware.com

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

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

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

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

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


[cmake-developers] [CMake 0016006]: Incorrect physical/logical core counts from kwsys on Windows

2016-03-04 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://cmake.org/Bug/view.php?id=16006 
== 
Reported By:Nils Gladitz
Assigned To:
== 
Project:CMake
Issue ID:   16006
Category:   CMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2016-03-04 03:24 EST
Last Modified:  2016-03-04 03:24 EST
== 
Summary:Incorrect physical/logical core counts from kwsys on
Windows
Description: 
I am not entirely sure if this is the right place for kwsys issues?

On a Windows 7 64-bit system with two of these:
http://ark.intel.com/products/47922/Intel-Xeon-Processor-X5650-12M-Cache-2_66-GHz-6_40-GTs-Intel-QPI

Hyper-threading is enabled.

In cmsys::SystemInformation
  info.GetNumberOfLogicalCPU() returns 32 (expected is 24)
  info.GetNumberOfPhysicalCPU() returns 0 (expected is 2)

In CMake I exposed these values through 
NUMBER_OF_LOGICAL_CORES and NUMBER_OF_PHYSICAL_CORES in
cmake_host_system_information().

The Windows GetSystemInfo() filled SYSTEM_INFO structure reports 24 in
dwNumberOfProcessors.



Steps to Reproduce: 
cmake_host_system_information(RESULT PHYSICAL_CORES
QUERY NUMBER_OF_PHYSICAL_CORES
)

cmake_host_system_information(RESULT LOGICAL_CORES
QUERY NUMBER_OF_LOGICAL_CORES
)

message("[${PHYSICAL_CORES}:${LOGICAL_CORES}]")

== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-03-04 03:24 Nils Gladitz   New Issue
==

-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] find_package REQUIRED ignores OPTIONAL_COMPONENTS

2016-03-04 Thread Alexander Stein
Hi,

I want to use some required Qt component while others are optional. Apparently 
if you specify REQUIRED in find_package OPTIONAL_COMPONENTS is ignored.
Here is a minimal CMakeLists.txt:
project(test)
cmake_minimum_required(VERSION 3.5)

find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui OPTIONAL_COMPONENTS Invalid)

/home/alex/repo/cmake/build/bin/cmake --version
cmake version 3.5.20160303-gf37f

cmake fails with:
CMake Error at 
/home/alex/repo/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Qt4 (missing: QT_INVALID_INCLUDE_DIR QT_INVALID_LIBRARY)
  (found version "4.8.7")
Call Stack (most recent call first):
  /home/alex/repo/cmake/Modules/FindPackageHandleStandardArgs.cmake:388 
(_FPHSA_FAILURE_MESSAGE)
  /home/alex/repo/cmake/Modules/FindQt4.cmake:1333 
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:4 (find_package)

I expected that if required components are missing cmake bails out while 
continuing when OPTIONAL_COMPONENTS are missing. My current workaround is:
find_package(Qt4 OPTIONAL_COMPONENTS Invalid)
find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui)

But I would rather use a single line. Am I missing something here?

Best regards,
Alexander

-- 

Powered by www.kitware.com

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

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

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

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

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