Re: [CMake] FindMKL.cmake

2011-02-09 Thread Robert Bielik

Michael Wild skrev 2011-02-09 16:48:

what about this:

file(GLOB_RECURSE glob_results "/some/pattern*")
set(dirs)
foreach(f IN LISTS glob_results)
   get_filename_component(d "${f}" PATH)
   list(APPEND dirs "${d}")
endforeach()
list(REMOVE_DUPLICATES dirs)


Yeah, works fine but it seems to be a lot slower than using the nested 
file(GLOB...) macro approach, but I don't know why.

/Rob


___
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] Help on ExternalProject_Add

2011-02-09 Thread Jean-Christophe Fillion-Robin
Hi Luigi,

You will find some comments below ...

Jc

On Wed, Feb 9, 2011 at 9:07 AM, Luigi Calori  wrote:

> Hi everybody,
> I' m trying to use ExternalProject to wrap serveral building recipies for
> different packages I have to use:
> I am taking the habit of using it as a replacement of shell scripts or
> manual session for building from source.
> In my usage I found some problems, possibly due to my ignorance, so please
> forgive me:
>
> 1) I would like to build the same package from the same source multiple
> times (for example because I need to change some config (shared/non shared)
>or build (debug /release) ... I would like to keep a common source dir
> across the different builds...
>So I tried to specify a source dir outside binary dir, but the  the
> download and patch steps seem repeated even if the source is already present
>(the download step can be   saved)
>Is this behavior intended or am I missing something?
>I have tried to split the projects in two: one that download and patch
> the source and another that build it, but
>unfortunately the build only project complain that is source dir is
> empty at meta-project configure time.
>

Have a look at the CMakeLists.txt enclosed. It basically checkout a project
using a first external project and then configure+built in second external
project depending on the first one.



>   The problem seems that the stamp files that decide weather a step has to
> be executed, are collected on the same STAMP_DIR:
>   For a previous version of the module, I patched it by adding a
> SOURCE_STAMP_DIR that differentiate the folder where the stamps files are
> kept,
>   between  download and patch step, and the other stepsI.
>   could that be generally useful? In case I could try to dive in and file a
> feature request + patch
>

> 2) Regarding VCS, I see that CVS, SVN and GIT are now supported, I' ve to
> use also Bazaar and Mercurial,
>is it possible to use DOWNLOAD_COMMAND for addressing those, are there
> any examples?
>otherwise would it be useful to add new BZR_REPOSITORY and HG_REPOSITORY
> commands?
>

You will have to use both the DOWNLOAD and the UPDATE command.

I am not familiar with bazaar or mercurial .. but if the "initial checkout
or clone" and the following "update or pull" associated with these
repository can be achieved using a single command line. It should be pretty
straightforward.

Otherwise, you  could either:

  - create a cmake files that could be invoked as download and update
command  (${CMAKE_COMMAND} -P /path/to/your/bazaar-download-script.cmake,
${CMAKE_COMMAND} -P /path/to/your/bazaar-update-script.cmake)

  - patch ExternalProject and submit a patch



>
> 3) In case of Cmake based projects,  there seem no way to inherit
>  variables or settings from the "meta" project into the ExternalProject
> apart from explicitly listing
>definition variables as CMAKE_ARGS -Dvar1:var1type=${var1}
> -Dvar2:var2type=${var2} .
>Is that tue or there is some other way to do it? ...


Option and cmake variables defined in the "meta" project could be used to
configure any external project. As of today, there is no way of
automatically guessing with which External project these options and
variables should be assigned to.
That means the options should be explicitly associated with an external
project  (using CMAKE_ARGS).


> and in case, is the   vartype needed?
>

Under the hood, cmake is invoked, if no vartype is specified, it default to
"UNINITIALIZED". See
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#property:TYPE

If you omit to specify the type, the variable won't show in both ccmake and
cmake-gui.




>
> Sorry for the length and thanks a lot in advance
>
> Luigi
>
>
>
> ___
> 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
>



-- 
Direct: 1-518-836-2174
Ext: 304

#
# BuildHelper script
# Author: Jean-Christophe Fillion-Robin 
#


CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2)

PROJECT(BuildHelper)

INCLUDE(ExternalProject)

set(ep_base"${CMAKE_BINARY_DIR}")
set(ep_suffix  "-cmake")

# Compute -G arg for configuring external projects with the same CMake 
generator:
IF(CMAKE_EXTRA_GENERATOR)
  SET(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
ELSE()
  SET(gen "${CMAKE_GENERATOR}")
ENDIF()


set(proj DummyCpp)

ExternalProject_Add(${proj}-GetSource
  SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  PREFIX ${proj}${ep_suffix}
  GIT_REPOSITORY "git://github.com/jcfr/DummyCpp.git"
  GIT_TAG "origin/master"
  CONFIGURE_COMMAND ""
  BUILD_COMMAND ""
  INSTALL_COMMAND ""
  )

SET(DummyCpp_CMAKE_BUILD_TYPE Release CACHE STRING "Build type")

ExternalProject_Add(${proj}-Build-${DummyCpp_CMAKE_B

Re: [CMake] Accessing visual studio debugger options

2011-02-09 Thread Ryan Pavlik
This is what my CreateLaunchers.cmake script does -
https://github.com/rpavlik/cmake-modules

Lets you do this:
create_default_target_launcher(yourapp
ARGS
"${COMMAND_LINE_ARGS}"
RUNTIME_LIBRARY_DIRS
${RUNTIME_LIBRARY_DIRS}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
ENVIRONMENT
${ENVIRONMENT_VARS})

On Wed, Feb 9, 2011 at 1:35 PM, John Drescher  wrote:

> On Wed, Feb 9, 2011 at 2:30 PM, Robert Bielik 
> wrote:
> > Louis Hoefler skrev 2011-02-09 19:41:
> >>
> >> Hello everyone,
> >> i created cmake files for a visual studio solution.
> >> The solution compiles, and now I want to
> >> start debugging the testapplication.
> >>
> >> I want to change the command line option,
> >> which is used by the debugger, to invoke the application.
> >>
> >> How can this be done?
> >>
> >> I use cmake 2.8.3 and visual studio 2010.
> >
> > I don't think you can. Those settings are not in any project/solution
> file
> > but are stored as user settings, which of course
> > CMake has nothing to do with.
> >
>
> You could generate this file in cmake using cmake file commands. The
> user files are xml.
>
> Here is an example:
>
> 
> ProjectType="Visual C++"
>Version="9.00"
>ShowAllFiles="false"
>>
>
>Name="Debug|Win32"
>>
>Command="$(TargetPath)"
>WorkingDirectory=""
>CommandArguments=""
>Attach="false"
>DebuggerType="3"
>Remote="1"
>RemoteMachine="RADIMGWS61"
>RemoteCommand=""
>HttpUrl=""
>PDBPath=""
>SQLDebugging=""
>Environment=""
>EnvironmentMerge="true"
>DebuggerFlavor=""
>MPIRunCommand=""
>MPIRunArguments=""
>MPIRunWorkingDirectory=""
>ApplicationCommand=""
>ApplicationArguments=""
>ShimCommand=""
>MPIAcceptMode=""
>MPIAcceptFilter=""
>/>
>
>Name="RelWithDebInfo|Win32"
>>
>Command="$(TargetPath)"
>WorkingDirectory=""
>CommandArguments=""
>Attach="false"
>DebuggerType="3"
>Remote="1"
>RemoteMachine="RADIMGWS61"
>RemoteCommand=""
>HttpUrl=""
>PDBPath=""
>SQLDebugging=""
>Environment=""
>EnvironmentMerge="true"
>DebuggerFlavor=""
>MPIRunCommand=""
>MPIRunArguments=""
>MPIRunWorkingDirectory=""
>ApplicationCommand=""
>ApplicationArguments=""
>ShimCommand=""
>MPIAcceptMode=""
>MPIAcceptFilter=""
>/>
>
>
> 
>
>
> 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
>



-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpav...@iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
___
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] CMake Error: Error required internal CMake variable not set

2011-02-09 Thread Alexander Neundorf
On Wednesday 09 February 2011, Enrique Izaguirre wrote:
> Thanks a lot,
>
> I removed the CXX from the Project() and now both compilers are recognized
> and the problem was solved.
>
> Really appreciate your help

You're welcome :-)
Nice that it's working now for you

Alex

P.S. please keep replys on the list, so others can read it too.

> 2011/2/5 Alexander Neundorf 
>
> > On Saturday 05 February 2011, Enrique Izaguirre wrote:
> > > Hi Alex,
> > >
> > > Thank for the response. For some reason I didn't get the whole output
> > > before, but now here it is:
> > >
> > > # cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-linuxcpp.cmake ..
> > > -- The CXX compiler identification is GNU
> > > -- Check for working CXX compiler: /bin/g++-linux
> > > -- Check for working CXX compiler: /bin/g++-linux -- works
> > > -- Detecting CXX compiler ABI info
> > > -- Detecting CXX compiler ABI info - done
> > > System name is:
> > > Linux
> > > The Top directory is:
> > > /home/x0148488/omapflash
> > > Adding subdirectory comdriver...
> > > Entering comdriver's CMakeLists
> > > Now trying to find AdbWinApi.lib library
> > > Adding subdirectory common...
> > > Adding subdirectory host...
> > > -- Configuring done
> > > CMake Error: Error required internal CMake variable not set, cmake may
> > > be not be built correctly.
> > > Missing variable is:
> > > CMAKE_C_LINK_EXECUTABLE
> > > -- Generating done
> > > -- Build files have been written to:
> > > /home/x0148488/omapflash/cmake_build
> > >
> > > Seems that it is only taking the g++ compiler, and not the gcc. In the
> > > Toolchain file both are set, but seems that it is taking only the last
> >
> > one.
> >
> > Do you maybe have a
> > project(YourProject CXX)
> > command in your toplevel CMakeLists.txt ?
> > This would make cmake enable only the C++ language, but not the C
> > language, i.e. not check for the C compiler, set its variables, etc.
> >
> > This should lead to the behaviour you are seeing, if you are creating an
> > C executable  later on.
> >
> > By default, if you don't have any project() call, cmake automatically
> > activate
> > C and C++.
> >
> > Alex


___
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] Accessing visual studio debugger options

2011-02-09 Thread John Drescher
On Wed, Feb 9, 2011 at 2:30 PM, Robert Bielik  wrote:
> Louis Hoefler skrev 2011-02-09 19:41:
>>
>> Hello everyone,
>> i created cmake files for a visual studio solution.
>> The solution compiles, and now I want to
>> start debugging the testapplication.
>>
>> I want to change the command line option,
>> which is used by the debugger, to invoke the application.
>>
>> How can this be done?
>>
>> I use cmake 2.8.3 and visual studio 2010.
>
> I don't think you can. Those settings are not in any project/solution file
> but are stored as user settings, which of course
> CMake has nothing to do with.
>

You could generate this file in cmake using cmake file commands. The
user files are xml.

Here is an example:














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] Accessing visual studio debugger options

2011-02-09 Thread Rolf Eike Beer
> Oh sorry if I was not completely clear.
> I wanted to access these settings throught cmake.

You're lost (i.e. there is no way currently to do this).

Eike
___
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] Accessing visual studio debugger options

2011-02-09 Thread Robert Bielik

Louis Hoefler skrev 2011-02-09 19:41:

Hello everyone,
i created cmake files for a visual studio solution.
The solution compiles, and now I want to
start debugging the testapplication.

I want to change the command line option,
which is used by the debugger, to invoke the application.

How can this be done?

I use cmake 2.8.3 and visual studio 2010.


I don't think you can. Those settings are not in any project/solution file but 
are stored as user settings, which of course
CMake has nothing to do with.

/Rob
___
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] Accessing visual studio debugger options

2011-02-09 Thread Louis Hoefler

Oh sorry if I was not completely clear.
I wanted to access these settings throught cmake.

Greetings Louis

Am 09.02.2011 19:59, schrieb Rolf Eike Beer:

Hello everyone,
i created cmake files for a visual studio solution.
The solution compiles, and now I want to
start debugging the testapplication.

I want to change the command line option,
which is used by the debugger, to invoke the application.

How can this be done?

I use cmake 2.8.3 and visual studio 2010.

Right click on the target, choose properties ->  debug and fill in the
fields in the dialog.

Eike
___
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] Accessing visual studio debugger options

2011-02-09 Thread Rolf Eike Beer
> Hello everyone,
> i created cmake files for a visual studio solution.
> The solution compiles, and now I want to
> start debugging the testapplication.
>
> I want to change the command line option,
> which is used by the debugger, to invoke the application.
>
> How can this be done?
>
> I use cmake 2.8.3 and visual studio 2010.

Right click on the target, choose properties -> debug and fill in the
fields in the dialog.

Eike
___
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] Accessing visual studio debugger options

2011-02-09 Thread Louis Hoefler

Hello everyone,
i created cmake files for a visual studio solution.
The solution compiles, and now I want to
start debugging the testapplication.

I want to change the command line option,
which is used by the debugger, to invoke the application.

How can this be done?

I use cmake 2.8.3 and visual studio 2010.

Greetings, Louis
___
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] feed parsed information from source files into compile process

2011-02-09 Thread Tyler Roscoe
On Wed, Feb 09, 2011 at 05:24:28PM +0100, Verweij, Arjen wrote:
> Currently there is a python script that does preprocessing of all
> source, stores information in override.cmake files using
> set_source_file_properties(). This works fine, but makes maintaining
> source more error prone than it was. For instance a developer might
> use the code for an FE element, use it as the basis for a collapsed
> version and inherit specific optimizations which are now ignored.
> 
> I have looked at a way to chain this step using add_custom_command(),
> but I see no possibility to tell the generator about some variable an
> external program will fill in during the build phase.

You can't use add_custom_command() to drive this because the results of
any custom commands will only be available at build time. You need stuff
to happen at CMake configure time.

Hence, I would use execute_process() to run your python script at
configure time. It would deposit its results into a file, which you
could then include() (or file(READ ...)).

hth,
tyler
___
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] FindMKL.cmake

2011-02-09 Thread Robert Bielik

David Cole skrev 2011-02-09 16:49:

Ah I know what it is. If you use "GLOB_RECURSE" you only get files because 
the directories are recursed into.

You have to use GLOB alone and do the recursion manually if you want to descend 
into found directories... Painful. But still possible.


Something like:

macro(find_dir_deep RESULT_PATHS BASE_PATH)
  file(GLOB results "${BASE_PATH}/*")
  foreach(f ${results})
if(IS_DIRECTORY "${f}")
  set(${RESULT_PATHS} ${${RESULT_PATHS}} ${f})
  find_dir_deep(${RESULT_PATHS} ${f})
endif()
  endforeach()
endmacro(find_dir_deep RESULT_PATHS BASE_PATH)

set(dirs "")
find_dir_deep(dirs "C:/Program Files/Common Files")
message("dirs='${dirs}'")

/Rob
___
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_subdirectory and eclipse project

2011-02-09 Thread Alexander Neundorf
On Wednesday 09 February 2011, Andrea Galeazzi wrote:
> Il 08/02/2011 17.58, Alexander Neundorf ha scritto:
> > On Tuesday 08 February 2011, Andrea Galeazzi wrote:
> >> Il 18/01/2011 19.17, Alexander Neundorf ha scritto:
> >>> On Tuesday 18 January 2011, Andrea Galeazzi wrote:
> >>> ...
> >>>
>  I just read that wiki page but what I didn't find is how can I see the
>  sources referenced by the add_subproject function in the layout  of
>  eclipse project.
> >>>
> >>> You mean add_subdirectory(), right ?
> >>>
>  In other words, CMake generates an eclipse project with a folder named
>  [Source directory], containing just only the sources listed in the
>  CMakeLists.txt but it doesn't allow to see the sources included by
>  add_subproject.
> >>>
> >>> There should be subdirectories there which you should be able to open,
> >>> which should show the files.
> >>>
> >>> Which exact version of cmake are you using ?
> >>>
> >>> Alex
> >>>
> >>> __ Informazioni da ESET NOD32 Antivirus, versione del database
> >>> delle firme digitali 5798 (20110118) __
> >>>
> >>> Il messaggio و stato controllato da ESET NOD32 Antivirus.
> >>>
> >>> www.nod32.it
> >>
> >> Yes I meant add_subdirectory and I'm using 2.8.3 version.
> >> The point is that the path passed as argument to the add_subdirectory
> >> function isn't necessary a real filesystem subdirectory of the current
> >> CMakeLists.txt so, in this case, it cannot be browsed by the resource
> >> view of eclipse.
> >> To be more specific don't you think it'd better to generate a .project
> >> containing more links than only [Source directory]?
> >> i.e.:
> >> 
> >> 
> >> [Source directory]
> >> 2
> >> /Project/Prj
> >> 
> >> 
> >>
> >> vs:
> >> 
> >> 
> >> Main Project
> >> 2
> >> /Project/Prj
> >> 
> >> 
> >> LibName
> >> 2
> >> /Libs/Lib1
> >> 
> >> 
> >>
> >> where libName is the name declared in the project() statement of
> >> CMakeLists.txt of /Libs/Lib1.
> >> This behavior should be more similar to the Visual Studio generator.
> >> So far I made a workaround writing a script which parse a CMakeLists.txt
> >> and invokes CMake to generate one eclipse project for each
> >> add_subdirectory entry. Then I import all projects in a workspace.
> >> I dislike a such solution but that's the only way to browse all sources
> >> that I found.
> >> I  hope my suggestion will be taken into account for the next
> >> releases... and sorry for the late answer!
> >> Andrea
> >
> > I'll have a look.
> >
> > Alex
> >
> > __ Informazioni da ESET NOD32 Antivirus, versione del database
> > delle firme digitali 5841 (20110202) __
> >
> > Il messaggio و stato controllato da ESET NOD32 Antivirus.
> >
> > www.nod32.it
>
> I took the liberty to change a piece of code just in order to test the
> idea above. That's the code modified (in
> cmExtraEclipseCDT4Generator::CreateProjectFile() )

Cool :-)
Without having looked at the code in detail, what I'd like to have is to keep 
the linked resource [SOURCE DIR] pointing to CMAKE_SOURCE_DIR, and 
additionally a linked resource [PROJECTS], which contains linked resources 
pointing to the different project directories.
This way I hope it should be clear that the one link just takes you to the 
source directory, while the other links (only visible when the [PROJECTS] 
resource is opened) take you to the project directories.

Alex


>   if (this->IsOutOfSourceBuild)
> {
> fout << "\t\n";
> // create a linked resource to CMAKE_SOURCE_DIR
> // (this is not done anymore for each project because of
> // http://public.kitware.com/Bug/view.php?id=9978 and because I
> found it
> // actually quite confusing in bigger projects with many directories
> and
> // projects, Alex
> const std::vector& generators =
> this->GlobalGenerator->GetLocalGenerators();
> std::vector::const_iterator iter =
> generators.begin();
> for(; iter != generators.end(); ++iter)
> {
>   mf = (*iter)->GetMakefile();
>   std::string sourceLinkedResourceName = "[";
>   sourceLinkedResourceName += mf->GetProjectName();
>   sourceLinkedResourceName += "]";
>   std::string linkSourceDirectory = this->GetEclipsePath(
>
> mf->GetStartDirectory());
>   // .project dir can't be subdir of a linked resource dir
>   if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
>linkSourceDirectory.c_str()))
> {
> this->AppendLinkedResource(fout, sourceLinkedResourceName,
>
> this->GetEclipsePath(linkSourceDirectory));
> this->SrcLinkedResources.push_back(sourceLinkedResourceName);
> }
>
>   // for EXECUTABLE_OUTPUT_PATH when not in binary dir
>   this->AppendOutLinkedResource(fout,
> mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
> mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
>   // for LIBRARY_OUTPUT_PATH when not in binary dir
>   this->Appen

[CMake] feed parsed information from source files into compile process

2011-02-09 Thread Verweij, Arjen
Hi,

I'm looking for a way to parse information from source files and feed the 
outcome as input to the build process.

In more detail, I have Fortran files that contain information about what 
optimization flags should be fed to the compiler.

Currently there is a python script that does preprocessing of all source, 
stores information in override.cmake files using set_source_file_properties(). 
This works fine, but makes maintaining source more error prone than it was. For 
instance a developer might use the code for an FE element, use it as the basis 
for a collapsed version and inherit specific optimizations which are now 
ignored.

I have looked at a way to chain this step using add_custom_command(), but I see 
no possibility to tell the generator about some variable an external program 
will fill in during the build phase.

Do Fortran developers have to learn to live with this, or is there a way to 
sneak information from source file into the makefile generation?

Thanks,
Arjen
___
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] FindMKL.cmake

2011-02-09 Thread David Cole
Ah I know what it is. If you use "GLOB_RECURSE" you only get files
because the directories are recursed into.

You have to use GLOB alone and do the recursion manually if you want to
descend into found directories... Painful. But still possible.


On Wed, Feb 9, 2011 at 10:48 AM, David Cole  wrote:

> What does this return if you save it as "glob.cmake" and then run "cmake -P
> glob.cmake" ??
>
> file(GLOB results "/*")
>
> set(dirs "")
> foreach(f ${results})
>
>   if(IS_DIRECTORY "${f}")
> set(dirs ${dirs} ${f})
> message("directory: '${f}'")
>   else()
> message("file: '${f}'")
>   endif()
> endforeach()
>
> message("dirs='${dirs}'")
>
>
> I get this:
>
> C:\Users\davidcole\Dashboards\My Tests>cmake -P glob.cmake
> directory: '/$RECYCLE.BIN'
> file: '/.rnd'
> directory: '/Documents and Settings'
> directory: '/found.000'
> file: '/hiberfil.sys'
> directory: '/Intel'
> directory: '/K'
> file: '/mfg.sdr'
> directory: '/MinGW'
> directory: '/MSOCache'
> file: '/pagefile.sys'
> directory: '/Program Files'
> directory: '/Program Files (x86)'
> directory: '/ProgramData'
> directory: '/Public'
> directory: '/Python26'
> directory: '/Qt'
> directory: '/Share'
> directory: '/System Recovery'
> directory: '/System Volume Information'
> directory: '/Users'
> directory: '/Windows'
> directory: '/xampp'
> dirs='/$RECYCLE.BIN;/Documents and
> Settings;/found.000;/Intel;/K;/MinGW;/MSOCache;/Program Files;/Program Files
> (x86);/ProgramData;/Public;/Python26;/Qt;/Share;/System Recovery;/System
> Volume Information;/Users;/Windows;/xampp'
>
>
>
>
>
> On Wed, Feb 9, 2011 at 10:41 AM, Robert Bielik 
> wrote:
>
>> David Cole skrev 2011-02-09 16:32:
>>
>>  You can iterate the returned list something like this to accumulate just
>>> directory names:
>>>
>>> set(dirs "")
>>> foreach(f ${glob_results})
>>>   if(IS_DIRECTORY "${f}")
>>> set(dirs ${dirs} ${f})
>>>   endif()
>>> endforeach()
>>>
>>
>> Hmm... doesn't work. find(...) doesn't return directories, only files...
>> :(
>>
>> /Rob
>>
>
>
___
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] FindMKL.cmake

2011-02-09 Thread Michael Wild
On 02/09/2011 04:41 PM, Robert Bielik wrote:
> David Cole skrev 2011-02-09 16:32:
>> You can iterate the returned list something like this to accumulate
>> just directory names:
>>
>> set(dirs "")
>> foreach(f ${glob_results})
>>if(IS_DIRECTORY "${f}")
>>  set(dirs ${dirs} ${f})
>>endif()
>> endforeach()
> 
> Hmm... doesn't work. find(...) doesn't return directories, only files... :(
> 
> /Rob

what about this:

file(GLOB_RECURSE glob_results "/some/pattern*")
set(dirs)
foreach(f IN LISTS glob_results)
  get_filename_component(d "${f}" PATH)
  list(APPEND dirs "${d}")
endforeach()
list(REMOVE_DUPLICATES dirs)

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] FindMKL.cmake

2011-02-09 Thread David Cole
What does this return if you save it as "glob.cmake" and then run "cmake -P
glob.cmake" ??

file(GLOB results "/*")

set(dirs "")
foreach(f ${results})
  if(IS_DIRECTORY "${f}")
set(dirs ${dirs} ${f})
message("directory: '${f}'")
  else()
message("file: '${f}'")
  endif()
endforeach()

message("dirs='${dirs}'")


I get this:

C:\Users\davidcole\Dashboards\My Tests>cmake -P glob.cmake
directory: '/$RECYCLE.BIN'
file: '/.rnd'
directory: '/Documents and Settings'
directory: '/found.000'
file: '/hiberfil.sys'
directory: '/Intel'
directory: '/K'
file: '/mfg.sdr'
directory: '/MinGW'
directory: '/MSOCache'
file: '/pagefile.sys'
directory: '/Program Files'
directory: '/Program Files (x86)'
directory: '/ProgramData'
directory: '/Public'
directory: '/Python26'
directory: '/Qt'
directory: '/Share'
directory: '/System Recovery'
directory: '/System Volume Information'
directory: '/Users'
directory: '/Windows'
directory: '/xampp'
dirs='/$RECYCLE.BIN;/Documents and
Settings;/found.000;/Intel;/K;/MinGW;/MSOCache;/Program Files;/Program Files
(x86);/ProgramData;/Public;/Python26;/Qt;/Share;/System Recovery;/System
Volume Information;/Users;/Windows;/xampp'




On Wed, Feb 9, 2011 at 10:41 AM, Robert Bielik wrote:

> David Cole skrev 2011-02-09 16:32:
>
>  You can iterate the returned list something like this to accumulate just
>> directory names:
>>
>> set(dirs "")
>> foreach(f ${glob_results})
>>   if(IS_DIRECTORY "${f}")
>> set(dirs ${dirs} ${f})
>>   endif()
>> endforeach()
>>
>
> Hmm... doesn't work. find(...) doesn't return directories, only files... :(
>
> /Rob
>
___
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] FindMKL.cmake

2011-02-09 Thread Robert Bielik

David Cole skrev 2011-02-09 16:32:

You can iterate the returned list something like this to accumulate just 
directory names:

set(dirs "")
foreach(f ${glob_results})
   if(IS_DIRECTORY "${f}")
 set(dirs ${dirs} ${f})
   endif()
endforeach()


Hmm... doesn't work. find(...) doesn't return directories, only files... :(

/Rob
___
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] FindMKL.cmake

2011-02-09 Thread Robert Bielik

David Cole skrev 2011-02-09 16:32:


You can iterate the returned list something like this to accumulate just 
directory names:

set(dirs "")
foreach(f ${glob_results})
   if(IS_DIRECTORY "${f}")
 set(dirs ${dirs} ${f})
   endif()
endforeach()


Yes, not bad. Good idea, thnx.

/Rob
___
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] FindMKL.cmake

2011-02-09 Thread David Cole
On Wed, Feb 9, 2011 at 9:15 AM, Robert Bielik wrote:

> David Cole skrev 2011-02-09 14:31:
>
> Is there some way I can make file(GLOB_RECURSE... ) start at a
>> directory of my choice (instead of the current CMakeLists.txt folder) ?
>>
>>
>> file(GLOB_RECURSE  "${dir}/*")
>>
>
> Yes, and that will return file names. Would be nice to have a directive
> CMAKE_DIRECTORIES_ONLY to only return globbed paths...



You can iterate the returned list something like this to accumulate just
directory names:

set(dirs "")
foreach(f ${glob_results})
  if(IS_DIRECTORY "${f}")
set(dirs ${dirs} ${f})
  endif()
endforeach()



>
>
>> None of the find_* commands do recursion...
>>
>
> ...which then could be fed to find_*
>
>
> /Rob
> ___
> 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] How to specify $1 for compiler?

2011-02-09 Thread Michael Hertling
On 02/08/2011 08:12 PM, Jed Brown wrote:
> On Mon, Feb 7, 2011 at 23:35, Jed Brown  wrote:
> 
>> On Fri, Feb 4, 2011 at 01:31, Michael Hertling wrote:
>>
>>> With a Makefile generator, you might use a RULE_LAUNCH_COMPILE property:
>>>
>>> SET_TARGET_PROPERTIES( PROPERTIES RULE_LAUNCH_COMPILE "win32fe")
>>>
>>
>> Thanks for these suggestions. I went with this one, but I'll try the other
>> if someone complains (win32fe implies cygwin, I don't know if native Visual
>> Studio builds make sense in that context).
>>
> 
> Hmm, although the Makefile "would work", the compiler tests do not succeed
> because they don't use these properties. Where do I have to munge
> CMAKE__COMPILE_OBJECT to have that version used when testing whether a
> compiler works?

First of all, IIRC, if you need the win32fe wrapper for the compiler
tests, too, you must enable it for the whole project, i.e. you won't
be able to use the plain compiler without win32fe anymore.

On *nix with a simple C project, I can see the following work:

% CC="env gcc" cmake   # Initial configuration!
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/bin/env
-- Check for working C compiler: /usr/bin/env -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
[...]
% make VERBOSE=1
[...]
[...] Building C object CMakeFiles/main.dir/main.c.o
/usr/bin/env gcc -o CMakeFiles/main.dir/main.c.o -c [...]/main.c
[...]

Although CMAKE_C_COMPILER turns out to be "/usr/bin/env", the "gcc" is
always in on it. Thus, setting FC="win32fe f90" before the very first
invocation of CMake on your project will possibly enable the win32fe
wrapper along with the Fortran compiler for the compiler tests as well
as for the actual compilations. If you want to enforce that, you might
have a SET(ENV{FC} "win32fe f90") in your CMakeLists.txt ahead of the
PROJECT() or ENABLE_LANGUAGE() command. In this way, you do not need
the RULE_LAUNCH_COMPILE property. If things keep failing, you should
consider to use a platform file for win32fe as Bill Hoffman already
mentioned.

'hope that helps.

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] Question about dependencies

2011-02-09 Thread Carminati Federico
Hello Micheal & *,
  sorry for the messed up posting, please forget it. Thanks to a bad connection 
I ended up posting a draft, I should have been more careful I realise I need 
some more work to submit a meaningful question to the list. Best, 



Federico Carminati
CERN-PH 
1211 Geneva 23
Switzerland
Tel: +41 22 76 74959
Fax: +41 22 76 68505
Mobile: +41 76 487 4843



On 9 Feb 2011, at 08:59, Michael Wild wrote:

> Apart from the typos already pointed out by Martin, what is the
> "define_custom_target()" command? Did you mean "add_custom_command()" or
> "add_custom_target()"? If so, the syntax is completely wrong. If you
> meant "add_dependencies()", then that is also wrong, because
> add_dependencies only operates on CMake-targets, not on individual
> files. In order to help, we need some more information, such as:
> 
> - How is factFile.xml (or whatever its name is) generated?
> - What is PACK-check? How is it defined?
> - What is the define_custom_target command? It certainly isn't a
> standard CMake command, so either it's another typo (is there a single
> word that isn't misspelled?!) or it's a custom macro/function in your
> project.
> 
> It would be best if you could post the relevant parts of your code.
> 
> 
> Michael
> 
> PS: Please, be more careful to avoid such ridiculous typos when posting.
> People here are not paid to help you (you could always get a support
> contract from Kitware, though) and are much less likely to answer if
> they have to first through heaps of sloppiness in order to figure out
> what you actually want from them. Just saying "sorry" without providing
> a fixed posting doesn't help to fix this situation either. IMHO it's
> also a matter of respect.
> 
> On 02/09/2011 02:38 AM, Carminati Federico wrote:
>> Martin,
>>  sorry for the stupid misspelling. The problem is real, only the message is 
>> misspelled. Best, 
>> 
>> Federico Carminati
>> 
>> 
>> On 9 Feb 2011, at 01:50, Martin O'Brien wrote:
>> 
>>> You have a number of typos there - are you sure that's not the problem?
>>> 
>>> CMAKE_BINAARY_DIR
>>> Factfile v. Facfile
>>> FACTILE v. FACTFILE
>>> 
>>> Mm
>>> 
>>> On Feb 8, 2011 6:48 PM, "Carminati Federico"  
>>> wrote:
 Hello,
 May be this is a very simple question but... I have a fully qualified path 
 name 
 
 ${CMAKE_BINAARY_DIR}/factFile.xml
 
 and I do 
 
 set(FACTILE ${CMAKE_BINARY_DIR}/facFile.xml)
 
 I am defining in subdirectories custom targets depending on this file
 
 define_custom_target(PACK-check ${FACTFILE})
 
 and the dependency is generated as 
 
 PACK-check: factFile.xml
 
 instead of
 
 PACK-check: /factFile.xml
 
 Obviously when I am in the subdir I have the message that there is no way 
 to build factFile.xml which is considered local to the subdirectory... I 
 hope I have been clear. Please help. Thanks, 
 
 
 Federico Carminati
> 
> ___
> 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


[CMake] CMake internal cache deletion seems to nullify command-line cache var settings

2011-02-09 Thread Wheeler, Frederick W (GE Global Research)

I think I found a CMake bug where cache variables set on the
command-line (CMAKE_INSTALL_PREFIX:PATH) are not set as expected when
the cache is deleted by cmake because a variable like
CMAKE_C_COMPILER:FILEPATH is set.  I've reduced this down as much as I
could.  I'm demonstrating the bug using the ITK source tree, but I doubt
that matters.

My workaround is to always remove the cache file before running cmake.




# make a build dir
rm -rf $DEV/cmake_debug
mkdir $DEV/cmake_debug
cd $DEV/cmake_debug

# system info
% uname -a
Linux tanaga 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64
x86_64 x86_64 GNU/Linux
% /local/wheeler/dev/cmake-2.8.3/bin/cmake --version
cmake version 2.8.3



# Step 1

Remove the cache file and run CMake, setting CMAKE_INSTALL_PREFIX on
the command-line.  CMAKE_INSTALL_PREFIX gets set correctly.

rm -f CMakeCache.txt
/local/wheeler/dev/cmake-2.8.3/bin/cmake \
  -G"Unix Makefiles" \
  -DCMAKE_INSTALL_PREFIX:PATH=/local/wheeler/dev/itk_usr_gcc_rel \
  -DCMAKE_C_COMPILER:FILEPATH=gcc \
  /local/wheeler/dev/itk_src
grep CMAKE_INSTALL_PREFIX:PATH CMakeCache.txt

CMAKE_INSTALL_PREFIX:PATH=/local/wheeler/dev/itk_usr_gcc_rel



# Step 2

Do not remove the cache file, but re-run cmake, but without setting
CMAKE_INSTALL_PREFIX:PATH or CMAKE_C_COMPILER:FILEPATH.  No problem,
the setting of CMAKE_INSTALL_PREFIX is preserved.

# rm -f CMakeCache.txt
/local/wheeler/dev/cmake-2.8.3/bin/cmake \
  -G"Unix Makefiles" \
  /local/wheeler/dev/itk_src
grep CMAKE_INSTALL_PREFIX:PATH CMakeCache.txt

CMAKE_INSTALL_PREFIX:PATH=/local/wheeler/dev/itk_usr_gcc_rel



# Step 3

Do not remove the cache file, but re-run cmake setting
CMAKE_INSTALL_PREFIX:PATH and CMAKE_C_COMPILER:FILEPATH.
CMAKE_INSTALL_PREFIX is no longer set the way I want it.

# rm -f CMakeCache.txt
/local/wheeler/dev/cmake-2.8.3/bin/cmake \
  -G"Unix Makefiles" \
  -DCMAKE_INSTALL_PREFIX:PATH=/local/wheeler/dev/itk_usr_gcc_rel \
  -DCMAKE_C_COMPILER:FILEPATH=gcc \
  /local/wheeler/dev/itk_src
grep CMAKE_INSTALL_PREFIX:PATH CMakeCache.txt

CMAKE_INSTALL_PREFIX:PATH=/usr/local




In Step 3 I get this warning from CMake.  Should be no problem since
CMAKE_INSTALL_PREFIX is explicitly set on the command line.

You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_C_COMPILER= gcc

It seems that when CMake clears the cache because I set
CMAKE_C_COMPILER:FILEPATH it reverts CMAKE_INSTALL_PREFIX:PATH to its
default value and does not honor the -DCMAKE_INSTALL_PREFIX:PATH=... on
the cmake command-line.  Also note that I am not changing the value of
CMAKE_C_COMPILER:FILEPATH.

If this is not a bug, then I suggest the warning cmake issues (above)
also explain that even variables settings made with the -D option may
not be honored.




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

2011-02-09 Thread Tim Blechmann
hi all,

i am currently trying to adapt a cmake build system to build an osx app.

the specific code is:
INSTALL(CODE "
   include(BundleUtilities)
   fixup_bundle(\"${CMAKE_CURRENT_BINARY_DIR}/${myappbundlename}.app\"   \"\"   
\"${CMAKE_CURRENT_BINARY_DIR}\")
   "
COMPONENT Runtime)

however it doesn't seem to work correctly, the verification of the app fails:
error: verify_app failed

since i don't have access to an osx machine and i have little knowledge about 
the osx toolchain in general, what is the exact semantics of fixup_bundle? 
especially, what is the purpose of the  and  arguments and where 
should they point to?

thanks, tim

-- 
t...@klingt.org
http://tim.klingt.org

The price an artist pays for doing what he wants is that he has to do
it.
  William S. Burroughs


___
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] Help on ExternalProject_Add

2011-02-09 Thread Luigi Calori

Hi everybody,
I' m trying to use ExternalProject to wrap serveral building recipies 
for different packages I have to use:
I am taking the habit of using it as a replacement of shell scripts or 
manual session for building from source.
In my usage I found some problems, possibly due to my ignorance, so 
please forgive me:


1) I would like to build the same package from the same source multiple 
times (for example because I need to change some config (shared/non shared)
or build (debug /release) ... I would like to keep a common source 
dir across the different builds...
So I tried to specify a source dir outside binary dir, but the  the 
download and patch steps seem repeated even if the source is already 
present

(the download step can be   saved)
Is this behavior intended or am I missing something?
I have tried to split the projects in two: one that download and 
patch the source and another that build it, but
unfortunately the build only project complain that is source dir is 
empty at meta-project configure time.
   The problem seems that the stamp files that decide weather a step 
has to be executed, are collected on the same STAMP_DIR:
   For a previous version of the module, I patched it by adding a 
SOURCE_STAMP_DIR that differentiate the folder where the stamps files 
are kept,

   between  download and patch step, and the other stepsI.
   could that be generally useful? In case I could try to dive in and 
file a feature request + patch


2) Regarding VCS, I see that CVS, SVN and GIT are now supported, I' ve 
to use also Bazaar and Mercurial,
is it possible to use DOWNLOAD_COMMAND for addressing those, are 
there any examples?
otherwise would it be useful to add new BZR_REPOSITORY and 
HG_REPOSITORY commands?


3) In case of Cmake based projects,  there seem no way to inherit  
variables or settings from the "meta" project into the ExternalProject 
apart from explicitly listing
definition variables as CMAKE_ARGS -Dvar1:var1type=${var1} 
-Dvar2:var2type=${var2} .
Is that tue or there is some other way to do it? ...  and in case, 
is the   vartype needed?



Sorry for the length and thanks a lot in advance

Luigi



___
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] FindMKL.cmake

2011-02-09 Thread Robert Bielik

David Cole skrev 2011-02-09 14:31:

Is there some way I can make file(GLOB_RECURSE... ) start at a directory of 
my choice (instead of the current CMakeLists.txt folder) ?


file(GLOB_RECURSE  "${dir}/*")


Yes, and that will return file names. Would be nice to have a directive 
CMAKE_DIRECTORIES_ONLY to only return globbed paths...



None of the find_* commands do recursion...


...which then could be fed to find_*

/Rob
___
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_subdirectory and eclipse project

2011-02-09 Thread Andrea Galeazzi

Il 08/02/2011 17.58, Alexander Neundorf ha scritto:

On Tuesday 08 February 2011, Andrea Galeazzi wrote:
  

Il 18/01/2011 19.17, Alexander Neundorf ha scritto:


On Tuesday 18 January 2011, Andrea Galeazzi wrote:
...

  

I just read that wiki page but what I didn't find is how can I see the
sources referenced by the add_subproject function in the layout  of
eclipse project.


You mean add_subdirectory(), right ?

  

In other words, CMake generates an eclipse project with a folder named
[Source directory], containing just only the sources listed in the
CMakeLists.txt but it doesn't allow to see the sources included by
add_subproject.


There should be subdirectories there which you should be able to open,
which should show the files.

Which exact version of cmake are you using ?

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database
delle firme digitali 5798 (20110118) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it
  

Yes I meant add_subdirectory and I'm using 2.8.3 version.
The point is that the path passed as argument to the add_subdirectory
function isn't necessary a real filesystem subdirectory of the current
CMakeLists.txt so, in this case, it cannot be browsed by the resource
view of eclipse.
To be more specific don't you think it'd better to generate a .project
containing more links than only [Source directory]?
i.e.:


[Source directory]
2
/Project/Prj



vs:


Main Project
2
/Project/Prj


LibName
2
/Libs/Lib1



where libName is the name declared in the project() statement of
CMakeLists.txt of /Libs/Lib1.
This behavior should be more similar to the Visual Studio generator.
So far I made a workaround writing a script which parse a CMakeLists.txt
and invokes CMake to generate one eclipse project for each
add_subdirectory entry. Then I import all projects in a workspace.
I dislike a such solution but that's the only way to browse all sources
that I found.
I  hope my suggestion will be taken into account for the next
releases... and sorry for the late answer!
Andrea


I'll have a look.

Alex

__ Informazioni da ESET NOD32 Antivirus, versione del database delle 
firme digitali 5841 (20110202) __

Il messaggio و stato controllato da ESET NOD32 Antivirus.

www.nod32.it




  
I took the liberty to change a piece of code just in order to test the 
idea above. That's the code modified (in 
cmExtraEclipseCDT4Generator::CreateProjectFile() )

 if (this->IsOutOfSourceBuild)
   {
   fout << "\t\n";
   // create a linked resource to CMAKE_SOURCE_DIR
   // (this is not done anymore for each project because of
   // http://public.kitware.com/Bug/view.php?id=9978 and because I 
found it
   // actually quite confusing in bigger projects with many directories 
and

   // projects, Alex
   const std::vector& generators = 
this->GlobalGenerator->GetLocalGenerators();
   std::vector::const_iterator iter = 
generators.begin();

   for(; iter != generators.end(); ++iter)
   {
 mf = (*iter)->GetMakefile();
 std::string sourceLinkedResourceName = "[";
 sourceLinkedResourceName += mf->GetProjectName();
 sourceLinkedResourceName += "]";
 std::string linkSourceDirectory = this->GetEclipsePath(
   
mf->GetStartDirectory());

 // .project dir can't be subdir of a linked resource dir
 if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
  linkSourceDirectory.c_str()))
   {
   this->AppendLinkedResource(fout, sourceLinkedResourceName,
  
this->GetEclipsePath(linkSourceDirectory));

   this->SrcLinkedResources.push_back(sourceLinkedResourceName);
   }

 // for EXECUTABLE_OUTPUT_PATH when not in binary dir
 this->AppendOutLinkedResource(fout,
   mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
   mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
 // for LIBRARY_OUTPUT_PATH when not in binary dir
 this->AppendOutLinkedResource(fout,
   mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"),
   mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH"));
}

   fout << "\t\n";
   }

and it works in my case. Consider this just as a "draft" of a possible 
patch. Let me know what do you think about it and if I can be of help in 
anyways.

Andrea.
___
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] FindMKL.cmake

2011-02-09 Thread David Cole
On Wed, Feb 9, 2011 at 8:20 AM, Robert Bielik wrote:

> Michael Wild skrev 2011-02-09 14:07:
>
>  that's what the CMAKE_MODULE_PATH variable is for. And there is a
>> FindLAPACK.cmake should already find Intel MKL, however IMHO the whole
>> module is rather broken...
>>
>
> Thnx Michael, I found that seconds after pressing the send button :) Thanks
> for pointing to LAPACK, yeah it does seem rather
> broken. Won't fit my purpose unfortunately.
>
> Is there some way I can make file(GLOB_RECURSE... ) start at a directory of
> my choice (instead of the current CMakeLists.txt folder) ?


file(GLOB_RECURSE  "${dir}/*")



> Or
> make find_path search recursively ?
>

None of the find_* commands do recursion...



>
> /Rob
>
> ___
> 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] FindMKL.cmake

2011-02-09 Thread Robert Bielik

Michael Wild skrev 2011-02-09 14:07:

that's what the CMAKE_MODULE_PATH variable is for. And there is a
FindLAPACK.cmake should already find Intel MKL, however IMHO the whole
module is rather broken...


Thnx Michael, I found that seconds after pressing the send button :) Thanks for 
pointing to LAPACK, yeah it does seem rather
broken. Won't fit my purpose unfortunately.

Is there some way I can make file(GLOB_RECURSE... ) start at a directory of my 
choice (instead of the current CMakeLists.txt folder) ? Or
make find_path search recursively ?

/Rob
___
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] FindMKL.cmake

2011-02-09 Thread Michael Wild
On 02/09/2011 01:50 PM, Robert Bielik wrote:
> Hi all,
> 
> I'm trying to make a FindMKL.cmake file (for Intel MKL) to handle
> Windows and Mac OS X primarily. However, I thought that CMake would find my
> FindMKL.cmake file if being in the same directory as the calling
> CMakeLists.txt file ? Can I make CMake find the file without having to
> resort
> to any configuration of CMake itself ?
> 
> TIA
> /Rob

that's what the CMAKE_MODULE_PATH variable is for. And there is a
FindLAPACK.cmake should already find Intel MKL, however IMHO the whole
module is rather broken...


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] FindMKL.cmake

2011-02-09 Thread Robert Bielik

Hi all,

I'm trying to make a FindMKL.cmake file (for Intel MKL) to handle Windows and 
Mac OS X primarily. However, I thought that CMake would find my
FindMKL.cmake file if being in the same directory as the calling CMakeLists.txt 
file ? Can I make CMake find the file without having to resort
to any configuration of CMake itself ?

TIA
/Rob
___
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] CTest: Getting the PriorRevision with ctest_update?

2011-02-09 Thread David Cole
Not directly. But if you analyze "Update.xml" after a ctest_update call, you
can parse it out...


On Wed, Feb 9, 2011 at 7:13 AM, Johan Björk  wrote:

> Hi everyone,
>
> Does ctest expose a way to get the old (and new I guess) revision of a
> source tree?
>
> /Johan
>
>
> ___
> 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

[CMake] CTest: Getting the PriorRevision with ctest_update?

2011-02-09 Thread Johan Björk
Hi everyone,

Does ctest expose a way to get the old (and new I guess) revision of a
source tree?

/Johan
___
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] Question about dependencies

2011-02-09 Thread Michael Wild
Apart from the typos already pointed out by Martin, what is the
"define_custom_target()" command? Did you mean "add_custom_command()" or
"add_custom_target()"? If so, the syntax is completely wrong. If you
meant "add_dependencies()", then that is also wrong, because
add_dependencies only operates on CMake-targets, not on individual
files. In order to help, we need some more information, such as:

- How is factFile.xml (or whatever its name is) generated?
- What is PACK-check? How is it defined?
- What is the define_custom_target command? It certainly isn't a
standard CMake command, so either it's another typo (is there a single
word that isn't misspelled?!) or it's a custom macro/function in your
project.

It would be best if you could post the relevant parts of your code.


Michael

PS: Please, be more careful to avoid such ridiculous typos when posting.
People here are not paid to help you (you could always get a support
contract from Kitware, though) and are much less likely to answer if
they have to first through heaps of sloppiness in order to figure out
what you actually want from them. Just saying "sorry" without providing
a fixed posting doesn't help to fix this situation either. IMHO it's
also a matter of respect.

On 02/09/2011 02:38 AM, Carminati Federico wrote:
> Martin,
>   sorry for the stupid misspelling. The problem is real, only the message is 
> misspelled. Best, 
> 
> Federico Carminati
> 
> 
> On 9 Feb 2011, at 01:50, Martin O'Brien wrote:
> 
>> You have a number of typos there - are you sure that's not the problem?
>>
>> CMAKE_BINAARY_DIR
>> Factfile v. Facfile
>> FACTILE v. FACTFILE
>>
>> Mm
>>
>> On Feb 8, 2011 6:48 PM, "Carminati Federico"  
>> wrote:
>>> Hello,
>>> May be this is a very simple question but... I have a fully qualified path 
>>> name 
>>>
>>> ${CMAKE_BINAARY_DIR}/factFile.xml
>>>
>>> and I do 
>>>
>>> set(FACTILE ${CMAKE_BINARY_DIR}/facFile.xml)
>>>
>>> I am defining in subdirectories custom targets depending on this file
>>>
>>> define_custom_target(PACK-check ${FACTFILE})
>>>
>>> and the dependency is generated as 
>>>
>>> PACK-check: factFile.xml
>>>
>>> instead of
>>>
>>> PACK-check: /factFile.xml
>>>
>>> Obviously when I am in the subdir I have the message that there is no way 
>>> to build factFile.xml which is considered local to the subdirectory... I 
>>> hope I have been clear. Please help. Thanks, 
>>>
>>>
>>> Federico Carminati

___
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