Re: [CMake] How to recursively copy directories and subdirectories...

2012-02-24 Thread Michael Hertling
On 02/25/2012 03:16 AM, Sumit Kumar wrote:
> Hello 
> 
> I would like to recursively copy folders/subfolders when I do a make install. 
> In addition, I would like to copy certain file patterns (typically *.h) files 
> that may be in these folders. I can do this for individual files (by doing a  
> glob / glob recurse). However, in doing this I lose the directory structure. 
> Any help will be appreciated.
> 
>  
> Thanks and Regards
> Sumit

INSTALL(DIRECTORY ...) with FILES_MATCHING/PATTERN/REGEX/EXCLUDE options.

Regards,

Michael
--

Powered by www.kitware.com

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

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

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


[CMake] How to recursively copy directories and subdirectories...

2012-02-24 Thread Sumit Kumar
Hello 

I would like to recursively copy folders/subfolders when I do a make install. 
In addition, I would like to copy certain file patterns (typically *.h) files 
that may be in these folders. I can do this for individual files (by doing a  
glob / glob recurse). However, in doing this I lose the directory structure. 
Any help will be appreciated.

 
Thanks and Regards
Sumit--

Powered by www.kitware.com

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

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

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

Re: [CMake] apply for maintainer of FindOpenCL.cmake

2012-02-24 Thread yao wang
Hi,
My script now only include AMD's OpenCL finding, and it works for both
Windows and Linux. Stefan's script has one step ahead, which enable
both AMD and Nvidia's OpenCL finding. And Daniel's script has one more
step, which enable AMD, Nvidia and Intel's OpenCL finding. If this
script can work on Windows, Linux and Mac OS, it will be a perfect
one!

Thanks.

2012/2/24 Sergiu Dotenco :
> On 24.02.2012 11:11, Daniel Dekkers wrote:
>> It would be nice to have an OpenCL find module. But it should include easy 
>> access to the Intel and NVIDIA libraries as well, I think, not just AMD. And 
>> what about the different OpenCL versions? And does it work on Mac OS as 
>> well? Finding the OpenCL framework?
>
> Have a look at https://bitbucket.org/sergiu/opencl-cmake.
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

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


Re: [CMake] add_executable and extension of source file

2012-02-24 Thread Michael Hertling
On 02/24/2012 06:16 PM, Kris Thielemans wrote:
> Hi
> 
> I have a project where I have C++ and C source files. I'm adding executables
> for this (via macros) like this
> 
> foreach(executable ${SOURCES})
>add_executable(${executable} ${executable} )
>target_link_libraries(${executable} ${STIR_LIBRARIES})
> endforeach()
> 
> where ${SOURCES} is a list of sources WITHOUT extension, e.g.
> 
>   set( SOURCES abs_image  src2)  
> 
> This relies on the fact that cmake should find .cxx and .c etc source files
> for add_executable. At least, I think it should (I found this some tutorial,
> e.g.
> http://www-flc.desy.de/ldcoptimization/documents/talks/CMake_Tutorial.pdf),
> but the doc for add_executable does not seem to mention this behaviour. 
> 
> My current CMake files work fine on Windows and Linux, but I now have a
> MacOSX user who says that it fails. He's running cmake 2.8.7 and when I
> inspect that linking command, it looks like (slightly edited for brevity)
> 
>   /usr/bin/c++   -O3 -DNDEBUG -ffast-math -Wl,-search_paths_first
> -Wl,-headerpad_max_install_names   
>  -o abs_image  a ../buildblock/libbuildblock.a
> 
> That is, clearly the abs_image.o file is missing on this command line.
> 
> Maybe this "adding a list of known extensions" feature is no longer
> supported? Or is the list of known extensions platform specific? (that would
> be bad)

The gcc manpage states:


For any given input file, the file name suffix determines what kind of
compilation is done:

file.c
C source code which must be preprocessed.
...
other
An object file to be fed straight into linking.  Any file name with
no recognized suffix is treated this way.
...
-c  Compile or assemble the source files, but do not link. [...]

Unrecognized input files, not requiring compilation or assembly,
are ignored.


Thus, AFAICS, CMake handles the extension-less sources correctly, but
gcc freaks out: No extension --> ignore when compiling --> no object
file. IMO, it's a quite bad idea to provide source files without a
proper suffix. However, see gcc's -x switch.

> I guess I will have to set my SOURCE files with the extension, and then
> strip the extension for the executable-name. maybe with something like
> 
> foreach(src ${SOURCES})
>   STRING(REPLACE \(.*\)\..* \1 executable ${src})
>  add_executable(${executable} ${src} )
>  ...
> endforeach()

SET(SOURCES abs_image.cxx src2.c)
...
FOREACH(i IN LISTS SOURCES)
GET_FILENAME_COMPONENT(j ${i} NAME_WE)
ADD_EXECUTABLE(${j} ${i})
ENDFOREACH()

> or alternatively find the source file
> 
> foreach(executable ${SOURCES})
>FILE(GLOB src "*.cxx" "*.c")
>   add_executable(${executable} ${src} )
>target_link_libraries(${executable} ${STIR_LIBRARIES})
> endforeach()

Do not use FILE(GLOB ...) in a CMakeLists.txt since this makes the
latter unaware of additions/removals/renamings among your sources.
You will most certainly miss a necessary reconfiguration one day.

Regards,

Michael
--

Powered by www.kitware.com

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

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

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


Re: [CMake] Code and API review request for Qt5 CMake files

2012-02-24 Thread Michael Hertling
On 02/24/2012 03:34 PM, Stephen Kelly wrote:
> 
> Just forwarding to the cmake users list.
> 
> 
> 
> Stephen Kelly wrote:
> 
>>
>> Hi there,
>>
>> Qt5 generates its own CMake files, which you will be able to use to find
>> Qt5 and build with it.
>>
>> That is, you will port from, eg
>>
>> find_package(Qt4 REQUIRED Core Gui Xml)
>>
>> to
>>
>> find_package(Qt5Widgets REQUIRED)
>> find_package(Qt5Xml REQUIRED)
>>
>> find_package(Qt5Core) is also possible but is not needed because it is a
>> dependency of at least one of the other requirements already in this case.
>>
>> find_package(Qt5) will not work currently (though it can be made to work
>> now or after Qt 5.0).
>>
>> You will then port
>>
>> target_link_libraries(foo ${QT_QTCORE_LIBRARIES})
>>
>> to
>>
>> target_link_libraries(foo ${Qt5Core_LIBRARIES})
>>
>> etc.
>>
>> Or you might use qt5_use_package:
>> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3083
>>
>> qt5_use_package(foo Core)
>> # That's it! Nothing more to do.
>>
>> The variables all map fairly well. There is also a Qt5Transitional package
>> which might help with that (If it gets released, which I'm not certain it
>> will be): https://projects.kde.org/projects/kdesupport/extra-cmake-
>>
> modules/repository/revisions/master/entry/modules/FindQt5Transitional.cmake
>>
>> The Qt5Config.cmake files are generated and installed by Qt
>> itself.
>>
>> I'd like a review of them by people familiar enough with how CMake works
>> and an API review from people familiar with how it is used.
>>
>> The generation of them is platform specific, and configure options
>> specific, eg whether you use -framework on mac, whether you use MinGW or
>> MSVC, whether building with an infix or a namespace. The easiest way for
>> you to generate the config files is:
>>
>> # Note: Don't bother cloning qt5.git unless you already have it.
>> # That takes forever.
>> git clone git://gitorious.org/qt/qtbase.git
>> cd qtbase
>> ./configure
>> ls lib/cmake
>>
>> Make sure you have at least commit
>> c470999329ee576038c50573314699f972f48909.
>>
>> You can go on to build and test them if you wish. The ctest unit tests are
>> in qtbase/tests/manual/cmake. These tests are not part of any
>> multi-platform CI system.
>>
>> Compared to the last time I emailed about this, the generated Config files
>> have become more simple. I discovered that qmake can have conditionals in
>> its configure_file equivalent.
>>
>> Things that work:
>> * Finding Qt with an infix.
>>
>> * Building against Qt with a namespace.
>>
>> * Finding statically built Qt (though when linking you have to list the
>> dependencies yourself currently)
>>
>> * Finding a particular version should work as ConfigVersion files are
>> installed, but I have not tested it.
>>
>> Things to review:
>>
>> * Are the Config files created correctly for your platform and
>> configuration?
>>
>> * Do the unit tests pass on your platform?
>>
>> * Currently there is no Qt5Config.cmake.
>> Such a thing could probably exist and use the FIND_COMPONENTS to find what
>> was requested. [...]

Absolutely, I would greatly appreciate a well-designed and component-
aware Qt5Config.cmake. In general, there might be reasons why a multi-
component package's components that are to be used together should not
be requested in separate FIND_PACKAGE() invocations, see [1] and look
for package X with components A and B. However, I don't know if Qt5
will be the first example of that kind.

>> [...] However, because there is no way to signal from a Config
>> file that a component was not found [...]

No: See [2] and look for the XXX_YY_FOUND variables. They fit perfectly
to indicate if component YY of package XXX has been found or not, and
they can be set conveniently by FPHSA(XXX_YY ...), see [3].

>> [...] (that is, find_package(Qt5 REQUIRED
>> Gui Xml) might not find QtXml, but Qt5_FOUND would still be true if the
>> Qt5Config file is found, whether the component is or not), [...]

No: FIND_PACKAGE(Qt5 REQUIRED ...) is expected to bail out if any of
the required components aren't found, so the value of the Qt5_FOUND
variable doesn't matter in this case. BTW, note that FIND_PACKAGE()
must not bail out if a component which the user hasn't requested is
not found, regardless of the REQUIRED flag, unless the component is
an immediate or mediate prerequisite of a required one.

Regarding Qt5_FOUND, FIND_PACKAGE(Qt5 COMPONENTS ...), i.e. without
REQUIRED, is more interesting, see [4]. In short: Qt5_FOUND indicates
if Qt5 is basically present but says nothing about any component; the
user must refer to the component-specific FOUND variables, and those
must even be protected by the package-specific one:

FIND_PACKAGE(Qt5 COMPONENTS XYZ)
IF(Qt5_FOUND AND Qt5_XYZ_FOUND)
...
ENDIF()

Referring to Qt5_XYZ_FOUND alone is not reliable because this variable
wouldn't have received a definite value if Qt5Config.cmake hasn't been
found by FIND_PACKAGE(). I.e., the user would refer to this variabl

Re: [CMake] Can't generate Release build in Visual Studio 9

2012-02-24 Thread John Drescher
> 2. Do batch building. I do this option. Look at the cmake --build command
>

Here is an example of this for one of my current projects (not exactly
what I do but close enough):

rem configure
pushd .
cd X:\64Bit\VC.100\Qt\StudyManager
cmake X:/CMakeBased/Qt/StudyManager
popd

rem build the nsis package.
cmake --build X:/64Bit/VC.100/Qt/StudyManager --config Release --target PACKAGE

X:/64Bit/VC.100/Qt/StudyManager is the build folder containing the
.sln CMakeCache.txt ...


John
--

Powered by www.kitware.com

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

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

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


Re: [CMake] simplest possible NSIS package

2012-02-24 Thread Clifford Yapp
I'd be up for testing CMake/WiX integration - Windows installers are an
ongoing need for BRL-CAD, and WiX looks like an interesting tool.

Cheers,
Cliff

On Fri, Feb 24, 2012 at 11:18 AM, Eric Noulard wrote:

>
> WiX has been proposed (including a patch)
> http://public.kitware.com/Bug/view.php?id=11575
> I think the bug has been "backloged" because of lack of manpower to work
> on it
> and the lack of test in the proposed patch.
>
> May be you can try to resume this work?
> I may help for understanding CPack internals, but I may not be of great
> help for testing since I'm not using Windows very often.
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> --
>
--

Powered by www.kitware.com

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

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

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

Re: [CMake] Can't generate Release build in Visual Studio 9

2012-02-24 Thread Michael Jackson
I will thrown my 2 cents in for this. I also use a Command prompt to run CMake 
on Windows and I generate Visual Studio projects. If I want to do a build and 
not edit the code I do the following:

cmake.exe ../
msbuild /p:Configuration=Release MyProject.sln
msbuild /p:Configuration=Release PACKAGE.vcproj

Maybe not the most elegant solution but does work. I do like the idea of a 
.user file though.
___
Mike JacksonPrincipal Software Engineer
BlueQuartz SoftwareDayton, Ohio
mike.jack...@bluequartz.net  www.bluequartz.net

On Feb 24, 2012, at 1:06 PM, John Drescher wrote:

>> The SLN solution contains all possible build-types. The user just have to
>> select which one they want (i.e. in Visual Studio, not cmake)
>> 
> 
> Continuing on this subject. The default configuration in Visual Studio
> is Debug so that is why debug is selected.
> 
> There are many ways around this:
> 
> 1. You could reduce the configurations that CMake creates down just to
> the one you want.
> 
> 2. Do batch building. I do this option. Look at the cmake --build command
> 
> 3. Use nmake makefiles (I believe)
> 
> 4. Generate a new .user file to specify the default build for your
> project in visual studio when you configure the project in cmake.
> 
> ...
> 
> John
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

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

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

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


Re: [CMake] Can't generate Release build in Visual Studio 9

2012-02-24 Thread John Drescher
> The SLN solution contains all possible build-types. The user just have to
> select which one they want (i.e. in Visual Studio, not cmake)
>

Continuing on this subject. The default configuration in Visual Studio
is Debug so that is why debug is selected.

There are many ways around this:

1. You could reduce the configurations that CMake creates down just to
the one you want.

2. Do batch building. I do this option. Look at the cmake --build command

3. Use nmake makefiles (I believe)

4. Generate a new .user file to specify the default build for your
project in visual studio when you configure the project in cmake.

...

John
--

Powered by www.kitware.com

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

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

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


Re: [CMake] Can't generate Release build in Visual Studio 9

2012-02-24 Thread Kris Thielemans
Hi Mauricio

The SLN solution contains all possible build-types. The user just have to
select which one they want (i.e. in Visual Studio, not cmake)

Kris

> -Original Message-
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On
> Behalf Of Mauricio Klein
> Sent: 24 February 2012 17:40
> To: cmake@cmake.org
> Subject: [CMake] Can't generate Release build in Visual Studio 9
> 
> Hello fellows!
> 
> I'm using CMake to compile and CPack to pack my codes.
> 
> The Linux version is working very well. But now i'm porting the
> CMakeLists.txt to Windows and i'm having some problems:
> 
> My main problem is: how can i set the build type in Visual Studio to
"Release"
> instead "Debug"?
> 
> I've already tried set CMAKE_BUILD_TYPE:
> set(CMAKE_BUILD_TYPE "Release")
> 
> ... and CMAKE_CONFIGURATION_TYPES:
> set(CMAKE_CONFIGURATION_TYPES "Release")
> 
> But every time i open the SLN file generated by Cmake and run "Build" from
> inside the Visual Studio, the binary is always generated in Debug mode.
> 
> Is there a way to set VS configuration to generate Release build using
CMake
> variables?
> 
> PS: I'm running cmake from dos (command line) and, after, i open the sln
file
> with Visual Studio. Hope this is the right way to do that.
> 
> Thanks in advance for your attention?
> 
> 
> --
> Best regards,
> 
> Maurício Souza Klein.


--

Powered by www.kitware.com

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

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

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


[CMake] Can't generate Release build in Visual Studio 9

2012-02-24 Thread Mauricio Klein
Hello fellows!

I'm using CMake to compile and CPack to pack my codes.

The Linux version is working very well. But now i'm porting the
CMakeLists.txt to Windows and i'm having some problems:

My main problem is: how can i set the build type in Visual Studio to
"Release" instead "Debug"?

I've already tried set CMAKE_BUILD_TYPE:
set(CMAKE_BUILD_TYPE "Release")

... and CMAKE_CONFIGURATION_TYPES:
set(CMAKE_CONFIGURATION_TYPES "Release")

But every time i open the SLN file generated by Cmake and run "Build" from
inside the Visual Studio, the binary is always generated in Debug mode.

Is there a way to set VS configuration to generate Release build using
CMake variables?

PS: I'm running cmake from dos (command line) and, after, i open the sln
file with Visual Studio. Hope this is the right way to do that.

Thanks in advance for your attention?

-- 
Best regards,

Maurício Souza Klein.
--

Powered by www.kitware.com

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

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

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

Re: [CMake] Is there a cookbook?

2012-02-24 Thread John Drescher
> but my point
> here is that we really need a CMake CookBook or snippet repository. I always
> hit the FAQ first, but that /explains/ when what a coder tends to need in
> that frame of mind is a living example.

Maybe some user committed examples in the wiki just like what has been
done for the vtk and itk examples..

John
--

Powered by www.kitware.com

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

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

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


Re: [CMake] Is there a cookbook?

2012-02-24 Thread Oliver Smith

On 2/23/2012 9:37 PM, John Drescher wrote:

You probably want to do some type of file GLOBBING for that


Here is an example of file globbing (along with its pitfalls):

http://www.cmake.org/pipermail/cmake/2010-September/039558.html


I am sorry. It does not look like the code to glob is there. I am to
tired to look for more examples now.

Yep, this morning I was able to piece together what I needed - but my 
point here is that we really need a CMake CookBook or snippet 
repository. I always hit the FAQ first, but that /explains/ when what a 
coder tends to need in that frame of mind is a living example.


I appreciate your time looking for a solution for my issue, though :)

- Oliver

--

Powered by www.kitware.com

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

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

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


[CMake] add_executable and extension of source file

2012-02-24 Thread Kris Thielemans
Hi

I have a project where I have C++ and C source files. I'm adding executables
for this (via macros) like this

foreach(executable ${SOURCES})
   add_executable(${executable} ${executable} )
   target_link_libraries(${executable} ${STIR_LIBRARIES})
endforeach()

where ${SOURCES} is a list of sources WITHOUT extension, e.g.

set( SOURCES abs_image  src2)  

This relies on the fact that cmake should find .cxx and .c etc source files
for add_executable. At least, I think it should (I found this some tutorial,
e.g.
http://www-flc.desy.de/ldcoptimization/documents/talks/CMake_Tutorial.pdf),
but the doc for add_executable does not seem to mention this behaviour. 

My current CMake files work fine on Windows and Linux, but I now have a
MacOSX user who says that it fails. He's running cmake 2.8.7 and when I
inspect that linking command, it looks like (slightly edited for brevity)

/usr/bin/c++   -O3 -DNDEBUG -ffast-math -Wl,-search_paths_first
-Wl,-headerpad_max_install_names   
 -o abs_image  a ../buildblock/libbuildblock.a

That is, clearly the abs_image.o file is missing on this command line.

Maybe this "adding a list of known extensions" feature is no longer
supported? Or is the list of known extensions platform specific? (that would
be bad)

I guess I will have to set my SOURCE files with the extension, and then
strip the extension for the executable-name. maybe with something like

foreach(src ${SOURCES})
  STRING(REPLACE \(.*\)\..* \1 executable ${src})
 add_executable(${executable} ${src} )
 ...
endforeach()

or alternatively find the source file

foreach(executable ${SOURCES})
   FILE(GLOB src "*.cxx" "*.c")
  add_executable(${executable} ${src} )
   target_link_libraries(${executable} ${STIR_LIBRARIES})
endforeach()

Any suggestions?

Thanks

Kris

--

Powered by www.kitware.com

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

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

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


Re: [CMake] simplest possible NSIS package

2012-02-24 Thread Eric Noulard
2012/2/23 Andrea Crotti :
> On 02/23/2012 04:48 PM, John Drescher wrote:
>>>
>>> Just to make you laugh I found the source of the problem.
>>> Apparently if you try to run an installer from a directory which is on a
>>> shared directory (with the virtualbox
>>> sharing) it just won't run :D
>>>
>>> Copying it somewhere else works perfectly, quite amazing issue.
>>>
>> Thanks for reporting back. That was very puzzling to me since my NSIS
>> builds have worked for a long time.
>>
>> John
>
>
> My pleasure, I would have never thought of something so stupid actually :/
> But is it true that NSIS is quite a dead project?
> The last version is from 2009 as far as I can see..
> Are there plans to support other package managers for windows?

WiX has been proposed (including a patch)
http://public.kitware.com/Bug/view.php?id=11575
I think the bug has been "backloged" because of lack of manpower to work on it
and the lack of test in the proposed patch.

May be you can try to resume this work?
I may help for understanding CPack internals, but I may not be of great
help for testing since I'm not using Windows very often.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
--

Powered by www.kitware.com

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

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

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


Re: [CMake] lexical scoping ... back to the future !

2012-02-24 Thread aaron . meadows
Very fascinating!  I've similarly had to deal with spiraling dependencies in 
our local code.

I had two thoughts toward the problems you mentioned below.  To handle unique 
naming of temporaries, you could do something like introduce a counter 
(probably as a global property) and append it to your variable names.  In 
psuedocode:
   RecursingMacro()
  # Get Global Property=> oNEST
  # Increment Global Property  => iNEST= NEST+1
  # Set Global Property<= iNEST

  # Use for uniqueness

  foreach (depname ${depnames})
  set ( ${depname}_DIR_{$iNEST} ...)
  ...

However, you might not need to do that.  You could use functions and then just 
store your results in global properties, with a list of their names in a known 
property (continuously append the new variable names).  Then at the end of the 
recursive dependency walk, you can import those properties into variables at 
the parent scope.  

Anyway, just a thought..


Aaron Meadows


-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
François Mauger
Sent: Thursday, February 23, 2012 6:11 PM
To: Jean-Christophe Fillion-Robin; cmake@cmake.org
Subject: Re: [CMake] lexical scoping ... back to the future !


 >>> On 23/02/2012 02:00, Jean-Christophe Fillion-Robin wrote:
> Hi François,
>
> Would the use of function be helpful ?
>
> See 
> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:function
> and http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:set
>
> "If PARENT_SCOPE is present, the variable will be set in the scope 
> above the current scope. Each new directory or function creates a new scope.
> This command will set the value of a variable into the parent 
> directory or calling function (whichever is applicable to the case at hand)."
>
> I created a small example showing that variable set within a function 
> don't interfere with the parent scope if not explicitly required.
>
> git clone git://gist.github.com/136.git 
> 
> cmake -P 136/cmake-illustrate-function-scope.cmake
>

Hi JC

I've also played around with functions vs macros to check for scoping features 
and I have basically written the same test script for my own learning. I agree 
that SET coupled with the PARENT_SCOPE directive can solve some scope issues 
within function, preserving the very useful ability to have "pure" local 
variables and still making possible for a given variable to be visible ONE 
scope level up. The problem is when you need to invoke several find_package 
commands from a thread of nested function/macros, eventually with some 
recursive pattern.
AFAIU, a find_package() command implies to be invoked from a macro, and not a 
function, to preserve the global scoping of the xxx_LIBRARIES and 
xxx_INCLUDE_DIRS variables set from a FindXxx.cmake or xxx-config.cmake file, 
and thus make them visible at the top-level CMakeLists.txt file for example.
May be I'm wrong and I miss something but it seems other people, trying to 
setup a set of homemade macros/functions to traverse automatically a dependency 
tree, have also faced this kind of scoping issue.

Because I have to build some complex applications and libraries from a large 
set of "low-level" dedicated home-made libraries that have dependency links 
between them (not cyclic of course, but possibly diamond shaped),  I've 
implemented a basic CMake dependency driver that uses a simple lists of 
dependency rules for any new home-made library (let's call it 'xxx') that 
depends on some other libraries I have at hand.

from the xxx's top-level CMakeLists.txt,  I just have to set:
{{{
SET( xxx_deprules "GSL:>=1.12;Python:>=2.6:<=2.7.3;foo:>=2.1;bar:=3.2" ) }}} 
which means I want to check and use:
- GSL libs with ver >=1.12
- Python (interp+libs) with ver in [2.6-2.7.3]
- my home-made foo lib with ver >=2.1
- my home-made bar with ver==3.2
and then automatically build some xxx_INCLUDE_DIRS and xxx_LIBRARIES from these 
rules.

There is a special set of macros that are given the "xxx_deprules" list and are 
supposed to invoke the 'find_package (...)' command to check if the 
dependencies in the list are fulfilled. Then the macros collect/aggregate the 
various [GSL|Python|foo|bar]_INCLUDE_DIRS and [GSL|Python|foo|bar]_LIBRARIES 
variables. Note that packages like GSL and Python or Boost use typically the 
so-called 'Module' find_package mode (FindGSL, FindPythonInterp, FindBoost...) 
while my foo and bar package uses the 'Config' mode through well-formatted 
foo-config.cmake and bar-config.cmake files.
Note also that because the FindXxx.cmake files provided with the CMake 
distribution does not follow a strict pattern and standard (variable names...), 
I have to wrap the find Module  within some dedicated macros to standardize the 
output (examples: Boost_VERSION gives "104700" and not "1.47.0", argh ! ).

So far, so good. Now assume that the "foo" lib depends also

Re: [CMake] Code and API review request for Qt5 CMake files

2012-02-24 Thread Stephen Kelly

Just forwarding to the cmake users list.



Stephen Kelly wrote:

> 
> Hi there,
> 
> Qt5 generates its own CMake files, which you will be able to use to find
> Qt5 and build with it.
> 
> That is, you will port from, eg
> 
> find_package(Qt4 REQUIRED Core Gui Xml)
> 
> to
> 
> find_package(Qt5Widgets REQUIRED)
> find_package(Qt5Xml REQUIRED)
> 
> find_package(Qt5Core) is also possible but is not needed because it is a
> dependency of at least one of the other requirements already in this case.
> 
> find_package(Qt5) will not work currently (though it can be made to work
> now or after Qt 5.0).
> 
> You will then port
> 
> target_link_libraries(foo ${QT_QTCORE_LIBRARIES})
> 
> to
> 
> target_link_libraries(foo ${Qt5Core_LIBRARIES})
> 
> etc.
> 
> Or you might use qt5_use_package:
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3083
> 
> qt5_use_package(foo Core)
> # That's it! Nothing more to do.
> 
> The variables all map fairly well. There is also a Qt5Transitional package
> which might help with that (If it gets released, which I'm not certain it
> will be): https://projects.kde.org/projects/kdesupport/extra-cmake-
> 
modules/repository/revisions/master/entry/modules/FindQt5Transitional.cmake
> 
> The Qt5Config.cmake files are generated and installed by Qt
> itself.
> 
> I'd like a review of them by people familiar enough with how CMake works
> and an API review from people familiar with how it is used.
> 
> The generation of them is platform specific, and configure options
> specific, eg whether you use -framework on mac, whether you use MinGW or
> MSVC, whether building with an infix or a namespace. The easiest way for
> you to generate the config files is:
> 
> # Note: Don't bother cloning qt5.git unless you already have it.
> # That takes forever.
> git clone git://gitorious.org/qt/qtbase.git
> cd qtbase
> ./configure
> ls lib/cmake
> 
> Make sure you have at least commit
> c470999329ee576038c50573314699f972f48909.
> 
> You can go on to build and test them if you wish. The ctest unit tests are
> in qtbase/tests/manual/cmake. These tests are not part of any
> multi-platform CI system.
> 
> Compared to the last time I emailed about this, the generated Config files
> have become more simple. I discovered that qmake can have conditionals in
> its configure_file equivalent.
> 
> Things that work:
> * Finding Qt with an infix.
> 
> * Building against Qt with a namespace.
> 
> * Finding statically built Qt (though when linking you have to list the
> dependencies yourself currently)
> 
> * Finding a particular version should work as ConfigVersion files are
> installed, but I have not tested it.
> 
> Things to review:
> 
> * Are the Config files created correctly for your platform and
> configuration?
> 
> * Do the unit tests pass on your platform?
> 
> * Currently there is no Qt5Config.cmake.
> Such a thing could probably exist and use the FIND_COMPONENTS to find what
> was requested. However, because there is no way to signal from a Config
> file that a component was not found (that is, find_package(Qt5 REQUIRED
> Gui Xml) might not find QtXml, but Qt5_FOUND would still be true if the
> Qt5Config file is found, whether the component is or not), I'm not sure
> it's a good idea, or at least it's more complicated. At least, I think
> something like qt5_use_package is a better idea anyway.
> 
> We could have a small FindQt5.cmake in CMake which could do that however
> maybe.
> 
> * Do you see any issues related to cross compiling?
> 
> * Try my port of the CMake Gui dialog to Qt5, or review the patches (most
> of the patches make sense in CMake master anyway IMO):
> https://gitorious.org/~steveire/cmake/steveires-cmake/commits/qt5-port
> 
> * API Review -
> Do the variable names make sense? For example, to find a regular Qt5Gui,
> you use find_package(Qt5Gui) and then you can use ${Qt5Gui_LIBRARIES}.
> 
> To find a Qt which was built with a namespace you use find_package(Qt5Gui)
> and then you can use ${Qt5Gui_LIBRARIES}. That is - it's exactly the same.
> 
> To find a Qt that was built with an infix in the library names, you use
> find_package(Qt5Gui) and then you can use ${Qt5Gui_LIBRARIES}. That is -
> it's exactly the same.
> 
> Is there any reason for it not to be the exact same in all these cases?
> 
> I'd imagine if using an infix-ed Qt, that's an implementation detail. If
> using a namespaced Qt, it might be an uninteresting implementation detail.
> I'm not really certain of the use-cases for a namespaced Qt and how that
> might affect this CMake API.
> 
> * Is anything missing? One thing that is missing is the qt4_automoc macro
> (all other macros are available with qt5 equivalents). Alex say's it's
> broken. The CMAKE_AUTOMOC feature is a not-completely-source-compatible
> replacement.
> 
> 
> Thanks,
> 
> --
> Stephen Kelly  | Software Engineer
> KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
> www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
> KDAB -

Re: [CMake] mingw vs MSYS makefiles

2012-02-24 Thread Bill Hoffman

On 2/24/2012 5:25 AM, Andrea Crotti wrote:



Ideally yes, unfortunately it's not really possible to avoid the python
call, without rewriting a lot of code in CMake/C (which is not a good
idea).

I will check what is the requirement, if the MinGW make is fine then
I'll just use that otherwise I'll debug the problem with the MSYS..

Well, the problem is something is calling python with the wrong path, it 
is using the msys path, but the calling program can not start python 
from /c/python.   From what you sent it is hard to tell what the calling 
program is that is trying to launch python.  You should look at the 
generated Makefiles and see what is going on.  Also, how is python 
called from your CMake code?


-Bill
--

Powered by www.kitware.com

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

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

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


Re: [CMake] apply for maintainer of FindOpenCL.cmake

2012-02-24 Thread Sergiu Dotenco
On 24.02.2012 11:11, Daniel Dekkers wrote:
> It would be nice to have an OpenCL find module. But it should include easy 
> access to the Intel and NVIDIA libraries as well, I think, not just AMD. And 
> what about the different OpenCL versions? And does it work on Mac OS as well? 
> Finding the OpenCL framework?

Have a look at https://bitbucket.org/sergiu/opencl-cmake.
--

Powered by www.kitware.com

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

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

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


Re: [CMake] apply for maintainer of FindOpenCL.cmake

2012-02-24 Thread Stefan Fendt

Hi,


It would be nice to have an OpenCL find module. But it should include easy 
access to the Intel and NVIDIA libraries as well, I think, not just AMD.
I'm not an CMake-expert... but maybe my variant of a FindOpenCL.cmake 
might be of some use for someone...


best regards
Stefan Fendt

# ===

#

# FindOpenCL.cmake

#

# 2011 S.Fendt

#

# It tries to find a valid installed OpenCL-Library (ATI or NVidia). If it

# can find a valid installation, it sets the following variables:

#

# OPENCL_FOUND

# OPENCL_INCLUDE_DIR

# OPENCL_INCLUDE_DIRS

# OPENCL_LIBRARY

# OPENCL_LIBRARIES

#

# ===

IF( WIN32 )

# ===

# First try to find something for a windows-environment. This is the most

# tricky part. Nvidia defines NVSDKCOMPUTE_ROOT for this and ATI defines

# ATISTREAMSDKROOT... So, at first, we test for these two environment-

# variable-steared cases.

# ===




FIND_PATH( AMD_OPENCL_BASEDIR

"include/CL/cl.h"

PATH $ENV{ATISTREAMSDKROOT} )




FIND_PATH( NVIDIA_OPENCL_BASEDIR

"OpenCL/common/inc/CL/cl.h"

PATH  $ENV{NVSDKCOMPUTE_ROOT} )




# Setup for AMD/ATI Stream-SDK




IF( AMD_OPENCL_BASEDIR )




FIND_PATH( OPENCL_INCLUDE_DIR

   NAMES CL/cl.hpp OpenCL/cl.hpp CL/cl.h OpenCL/cl.h

   PATHS $ENV{ATISTREAMSDKROOT}include )

   


MESSAGE( STATUS

 "AMD/ATI-Stream-OpenCL-Includepath : " ${AMD_OPENCL_INCLUDES} )




IF( OPENCL_64 )

FIND_LIBRARY( OPENCL_LIBRARY

   NAMES OpenCL

   PATHS $ENV{ATISTREAMSDKROOT}lib/x64_64 )

ELSE()

FIND_LIBRARY( OPENCL_LIBRARY

   NAMES OpenCL

   PATHS $ENV{ATISTREAMSDKROOT}lib/x64 )

ENDIF()




ELSE()




MESSAGE( "AMD/ATI-Stream-OpenCL-Implementation: NOT_FOUND" )




ENDIF()




IF( NVIDIA_OPENCL_BASEDIR )




FIND_PATH( OPENCL_INCLUDE_DIR

   NAMES CL/cl.hpp OpenCL/cl.hpp CL/cl.h OpenCL/cl.h

   PATHS $ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/inc/ )

   


MESSAGE( STATUS

 "NVidia-CUDA-OpenCL-Includepath : " ${OPENCL_INCLUDE_DIR})




IF( CMAKE_CL_64 )

FIND_LIBRARY( OPENCL_LIBRARY

   NAMES OpenCL

   PATHS $ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/lib/x64 )

ELSE()

FIND_LIBRARY( OPENCL_LIBRARY

   NAMES OpenCL

   PATHS $ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/lib/Win32 )

ENDIF()




MESSAGE( STATUS

 "NVidia-CUDA-OpenCL-Librarypath : " ${OPENCL_LIBRARY})




ELSE()




MESSAGE( "NVIDIA-Cuda-OpenCL-Implementation: NOT_FOUND" )




ENDIF()

ENDIF()

IF( LINUX )

# ===

# for Linux this is easy...

# ===




FIND_PATH( OPENCL_INCLUDE_DIR

NAMES CL/cl.h OpenCL/cl.h

HINTS ENV OPENCL_DIR

PATHS /include

/usr/include

/usr/local/include

~/include )

message( STATUS

 "Found OpenCL-include-path is :" ${OPENCL_INCLUDE_DIR} )

 


FIND_LIBRARY(OPENCL_LIBRARY

NAMES OpenCL

HINTS ENV OPENCL_DIR

PATHS   /lib

/usr/lib

/usr/local/lib

~/lib )

message( STATUS

 "Found OpenCL-library-path is :" ${OPENCL_LIBRARY} )

ENDIF()

IF( MACOSX )

# ===

# ... no idea at all, currently ...

# ===

ENDIF()

INCLUDE(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS( OPENCL DEFAULT_MESSAGE

   OPENCL_INCLUDE_DIR

   OPENCL_LIBRARY )

   


MARK_AS_ADVANCED(OPENCL_INCLUDE_DIR OPENCL_LIBRARY)

IF( OPENCL_FOUND )

  LIST(APPEND OPENCL_INCLUDE_DIRS ${OPENCL_INCLUDE_DIR})

  LIST(APPEND OPENCL_LIBRARIES ${OPENCL_LIBRARY})

ENDIF()


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://

Re: [CMake] mingw vs MSYS makefiles

2012-02-24 Thread Andrea Crotti

On 02/23/2012 10:55 PM, Bill Hoffman wrote:

On 2/23/2012 6:20 AM, Andrea Crotti wrote:




I don't think anyone really addressed your question.  Your question 
seems to have taken on a whole new life


The problem seems to be that your cmake file is creating makefiles 
that use a python program in them.  For some reason python is not 
working from an msys shell for you.  You should debug that, and try to 
figure out how to get a python that does work, or figure out why this 
python is failing under msys.


Moral of the story, don't depend on python in your build, use cmake 
scripts if possible, or c programs that you build  :)




Ideally yes, unfortunately it's not really possible to avoid the python 
call, without rewriting a lot of code in CMake/C (which is not a good idea).


I will check what is the requirement, if the MinGW make is fine then 
I'll just use that otherwise I'll debug the problem with the MSYS..

--

Powered by www.kitware.com

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

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

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


Re: [CMake] apply for maintainer of FindOpenCL.cmake

2012-02-24 Thread Daniel Dekkers
It would be nice to have an OpenCL find module. But it should include easy 
access to the Intel and NVIDIA libraries as well, I think, not just AMD. And 
what about the different OpenCL versions? And does it work on Mac OS as well? 
Finding the OpenCL framework?

Daniel

Op 24 feb. 2012 om 06:00 heeft Michael Wild  het volgende 
geschreven:

> On 02/24/2012 10:52 AM, yao wang wrote:
>> Hi,
>> We've written a module finding AMD's APP SDK's "include" abd "library"
>> paths. And set  "OPENCL_INCLUDE_DIR" and "OPENCL_LIBRARY", which are
>> useful for compiling OpenCL programs. Is it possible for me to
>> contribute to the share modules and make it included in next release?
>> 
>> Thanks!
> 
> 
> You'll want to read this:
> http://www.vtk.org/Wiki/CMake:Module_Maintainers
> 
> Michael
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

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


Re: [CMake] apply for maintainer of FindOpenCL.cmake

2012-02-24 Thread Michael Wild
On 02/24/2012 10:52 AM, yao wang wrote:
> Hi,
> We've written a module finding AMD's APP SDK's "include" abd "library"
> paths. And set  "OPENCL_INCLUDE_DIR" and "OPENCL_LIBRARY", which are
> useful for compiling OpenCL programs. Is it possible for me to
> contribute to the share modules and make it included in next release?
> 
> Thanks!


You'll want to read this:
http://www.vtk.org/Wiki/CMake:Module_Maintainers

Michael
--

Powered by www.kitware.com

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

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

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


[CMake] apply for maintainer of FindOpenCL.cmake

2012-02-24 Thread yao wang
Hi,
We've written a module finding AMD's APP SDK's "include" abd "library"
paths. And set  "OPENCL_INCLUDE_DIR" and "OPENCL_LIBRARY", which are
useful for compiling OpenCL programs. Is it possible for me to
contribute to the share modules and make it included in next release?

Thanks!
--

Powered by www.kitware.com

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

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

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