[cmake-developers] [CMake 0013213]: VerifyManifest reports error where there is none

2012-05-11 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=13213 
== 
Reported By:drahier
Assigned To:
== 
Project:CMake
Issue ID:   13213
Category:   Modules
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2012-05-11 08:31 WAT
Last Modified:  2012-05-11 08:31 WAT
== 
Summary:VerifyManifest reports error where there is none
Description: 
When I run CMakeVerifyManifest.cmake on (for example) a boost dll like
date_time, it tells me that the embedded manifest does not match the one in the
external file.
The output it prints is identical for both manifests, however. This is true for
all libraries I have come across so far, even so manifest and dll stem from the
same machine/compiler.

Steps to Reproduce: 
Put dll and manifest file (one you feel pretty sure of) in one directory and run
cmake -P CMakeVerifyManifest.cmake

Additional Information: 
Windows runs inside a VirtualBox, just in case it matters. Compiler is msvc 8.0.
Manifest of dll:

?xml version='1.0' encoding='UTF-8' standalone='yes'?
assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'
  dependency
dependentAssembly
  assemblyIdentity type='win32' name='Microsoft.VC80.CRT'
version='8.0.50727.762' processorArchitecture='x86'
publicKeyToken='1fc8b3b9a1e18e3b' /
/dependentAssembly
  /dependency
/assembly
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2012-05-11 08:31 drahierNew Issue
==

--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] [CMake 0013214]: Storyboards do not get recognized correctly

2012-05-11 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=13214 
== 
Reported By:Jan Schaffmeister
Assigned To:
== 
Project:CMake
Issue ID:   13214
Category:   CMake
Reproducibility:sometimes
Severity:   block
Priority:   urgent
Status: new
== 
Date Submitted: 2012-05-11 10:32 EDT
Last Modified:  2012-05-11 10:32 EDT
== 
Summary:Storyboards do not get recognized correctly
Description: 
On iOS using Xcode *.storyboard files do not get compiled correctly. Even with a
PRE_BUILD add_custom_command build step, one gets errors that complained about
modified signed resources.

Here is a valid fix for cmake:
in cmGlobalXCodeGenerator.cxx there should be: 


std::string
GetSourcecodeValueFromFileExtension(const std::string _ext,
const std::string lang)
{
  std::string ext = cmSystemTools::LowerCase(_ext);
  std::string sourcecode = sourcecode;

  if(ext == o)
{
sourcecode = compiled.mach-o.objfile;
}
  else if(ext == xib)
{
sourcecode = file.xib;
}
  else if(ext == storyboard)
{
sourcecode = file.storyboard;
}
  else if(ext == mm)
{
sourcecode += .cpp.objcpp;
}
  else if(ext == m)
{
sourcecode += .c.objc;
}
  else if(ext == xib)
{
sourcecode += .file.xib;
}
  else if(ext == plist)
{
sourcecode += .text.plist;
}
  else if(ext == h)
{
sourcecode += .c.h;
}
  else if(ext == hxx || ext == hpp || ext == txx
|| ext == pch || ext == hh)
{
sourcecode += .cpp.h;
}
  else if(ext == png || ext == gif || ext == jpg)
{
sourcecode = image;
}
  else if(ext == txt)
{
sourcecode += .text;
}
  else if(lang == CXX)
{
sourcecode += .cpp.cpp;
}
  else if(lang == C)
{
sourcecode += .c.c;
}
  else if(lang == Fortran)
{
sourcecode += .fortran.f90;
}
  //else
  //  {
  //  // Already specialized above or we leave sourcecode == sourcecode
  //  // which is probably the most correct choice. Extensionless headers,
  //  // for example... Or file types unknown to Xcode that do not map to a
  //  // valid lastKnownFileType value.
  //  }

  return sourcecode;
}
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2012-05-11 10:32 Jan SchaffmeisterNew Issue
==

--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [CMake] Intel compilers

2012-05-11 Thread Rolf Eike Beer
 Hi,

 I have just started using CMake for my projects and have some problems
 getting it do exactly the things I want. So these are couple of questions
 I
 have:

 1) How can I change the compiler from GNU g++ to my preferred compiler, in
 this case intel's icc? I have tried CC=icc; ccmake ../ but that again
 defaults to g++ and picks up wrong compiler flags

See the other mail. But this only works for the first time when you
compile in a given build directory, i.e. it is not possible to switch the
compiler on an already configured project.

 2) When I use the -ipo flag for icc, intel compiler complains that there
 are unresolved references whereas if I omit that, or just use g++, I don't
 have linking problems. Does the order of compilation (except main) matter
 when using target_link_libraries?

I guess you have some static libraries that need symbols from each other
and you have not added all necessary target_link_libraries() calls.
Without this the linking order is obviously not right.

The order you pass things to target_link_libraries() doesn't matter as
CMake will reorder them to resolve all dependencies it knows of. Therefore
you need to target_link_libraries() also the static libraries together.
Even if that doesn't really link anything it will tell CMake about the
dependencies when later really linking.

 3) How can I change from creating static libraries to just simply create
 object files and link to them?

In CMake 2.8.8 there are OBJECT libraries, this may be what you want.

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] Package installation conundrum

2012-05-11 Thread Dave Abrahams

Thanks, everybody, for your help.  Eventually the CMake expert I've been
working with became available again and he solved the problem easily.

Cheers,

on Wed May 09 2012, Michael Wild 
themiwi-Re5JQEeQqe8AvxtiuMwx3w-AT-public.gmane.org wrote:

 On 05/08/2012 11:13 PM, Dave Abrahams wrote:
 
 on Tue May 08 2012, Alexander Neundorf 
 a.neundorf-work-hi6Y0CQ0nG0-AT-public.gmane.org wrote:
 
 On Tuesday 08 May 2012, Dave Abrahams wrote:


 Here's another one!

 Scenario:

 * I am running CMake under 0install to build and install libraries

 * Each library builds a package SomePackage for the library binaries
 and another package SomePackage-dev for the library headers (and
 import libraries on Windows)

 * The FindSomePackage.cmake file is part of the -dev package

 * After building, 0install moves each package's build products into a
 mostly-unpredictable subdirectory of its otherwise-read-only cache
 (~/.cache/0install.net/). The subdirectory's name is determined by a
 hash of the files.

 * To get this working, I followed the scheme discussed here:

 http://news.gmane.org/find-root.php?message_id=%3cm2lil6s8jq.fsf%40pluto.l
 uannocracy.com%3e

 Summary:

 1. Create a 0install SomePackage-preinstall package. Building this
 package involves CMake building and installing both SomePackage and
 SomePackage-dev into separate subdirectories (main/ and dev/) of
 some prefix. 0install thereafter moves the whole directory tree
 into its cache in a directory called sha1=someuglyhash

 2. SomePackage's 0installation procedure is to copy
 sha1=someuglyhash/main/ into its distribution directory (which then ends
 up in
 ~/.cache/0install.net/sha1=otheruglyhash)

 3. SomePackage-dev's 0installation procedure is to copy
 sha1=someuglyhash/dev/ into its distribution directory

 Problem: FindSomePackageConfig.cmake now has the wrong path to the
 library binaries.

 Any help most appreciated.

 Can you please summarize what you actually want to achieve ?
 
 Well, I tried to, above.
 
 In short, I want to create separate main and -dev packages without
 building twice, under the constraints imposed by 0install.
 
 Do you say that libFoo installs a FindFoo.cmake as part of libFoo-devel ?

 If that's the case, then this is wrong.
 
 I'm sorry, that *is* wrong.  It installs a FooConfig.cmake as part of 
 libFoo.devel
 
 FindFoo.cmake must be part of the using software, not of the software to be
 searched.

 Why do you have to find the installed library in this cache directory
 ?
 
 Because, in a 0install world, that's where things go when you install
 them.
 

 Ok, how you do it along these lines:

 CMakeLists.txt:
 #-- BOF

 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 project(Foo)

 set(FOO_VERSION 1.2.3)

 # initialize (absolute) installation directory variables
 set(INSTALL_BIN_DIR bin CACHE PATH Install path for binaries)
 set(INSTALL_LIB_DIR lib CACHE PATH Install path for libraries)
 set(INSTALL_INCLUDE_DIR include CACHE PATH Install path for headers)
 # this is for UNIX systems, see docs of find_package() for the search
 # paths on APPLE and WIN32
 set(INSTALL_CMAKE_DIR lib/foo-${FOO_VERSION}/cmake CACHE PATH
   Install path for CMake files)
 foreach(t BIN LIB INCLUDE CMAKE)
   if(NOT IS_ABSOLUTE ${INSTALL_${t}_DIR})
 set(INSTALL_${t}_DIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_${t}_DIR})
   endif()
   mark_as_advanced(INSTALL_${t}_DIR)
 endforeach()

 # configure FooConfig.cmake and friends. FooConfig.cmake must be able
 # to locate FooExports.cmake and FOO_INCLUDE_DIR relative to its own
 # directory without using absolute paths.
 configure_file(cmake/FooConfig.cmake.in
   ${PROJECT_BINARY_DIR}/FooConfig.cmake @ONLY)
 configure_file(cmake/FooConfigVersion.cmake.in
   ${PROJECT_BINARY_DIR}/FooConfigVersion.cmake @ONLY)

 # configure the headers into the build tree so the package can be used
 # without installing it and not hard-coding the source/build directory
 # information into FooConfig.cmake
 configure_file(include/foo.h
   ${PROJECT_BINARY_DIR}/include/foo.h COPYONLY)

 # build targets
 add_library(foo src/foo.cpp include/foo.h)
 set_target_properties(foo PROPERTIES
   PUBLIC_HEADER include/foo.h
   VERSION ${FOO_VERSION}
   SOVERSION 1.0)
 add_executable(bar bar.cpp)
 target_link_libraries(bar foo)

 # install targets and files
 install(TARGETS foo bar
   EXPORT FooExports
   RUNTIME DESTINATION ${INSTALL_BIN_DIR} COMPONENT bin
   LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT bin
   ARCHIVE DESTINATION ${INSTALL_LIB_DIR} COMPONENT dev
   PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR} COMPONENT dev)

 install(FILES
   ${PROJECT_BINARY_DIR}/FooConfig.cmake
   ${PROJECT_BINARY_DIR}/FooConfigVersion.cmake
   DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT dev)

 # export targets to build and install tree
 export(TARGETS foo bar NAMESPACE Foo_
   FILE ${PROJECT_BINARY_DIR}/FooExports.cmake)
 export(PACKAGE Foo)

 install(EXPORT FooExports
   DESTINATION ${INSTALL_CMAKE_DIR}
   NAMESPACE Foo_
   

[CMake] How to use different assemblers in single build?

2012-05-11 Thread Alexey Istomin
Is it possible to use different assemblers in single build with CMake? I try to use CMake for building embedded application - statically linked elf file.Main CPU has 2 cores: general-purpose MIPS based core and DSP. Project has simple structure: main dir contains asm and C sources for Mips core, dsp-lib subdir has only asm sources for DSP core: main/ crt0-mips.s  main.c  ...  dsp-lib/  fft.s   GCC compiler and assembler are used for Mips sources, special assembler (dspasm) based on gnu should be used for DSP. Main should be linked with dsp lib into single elf file.I can successfully build main app without dsp-lib. But when I try to add dsp-lib subdir and set dspadm as assembler, CMake still uses mips-asm in the dsp-lib. Is it any solution? ThanksAlex 
--

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] Default value for CMAKE_BUILD_TYPE

2012-05-11 Thread pellegrini

Hi all,

when cmake is run without specifying the build type using -D 
CMAKE_BUILD_TYPE, it is the Debug mode that is selected as
the default. I would like to find a way to use Release as the default 
value when the user does not specify any build

type in the cmake command line.

From one of my previous post concerning CMAKE_INSTALL_PREFIX variable, 
I was thinking to use a similar approach i.e.:


project(Foo)

if (CMAKE_BUILD_TYPE_INITIALIZED_TO_DEFAULT)
set(CMAKE_BUILD_TYPE Release)
endif

but cmake still sets CMAKE_BUILD_TYPE to Debug in the CMakeCache.txt file.

Would you have any idea about what is wrong with my implementation ?

thanks a lot.

Eric
--

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] Default value for CMAKE_BUILD_TYPE

2012-05-11 Thread Jean-Christophe Fillion-Robin
Hi Eric,

In our different projects, we use an approach similar to this one:

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS Setting build type to 'Debug' as none was specified.)
  set(CMAKE_BUILD_TYPE Debug CACHE STRING Choose the type of build. FORCE)
  # Set the possible values of build type for cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release
MinSizeRel RelWithDebInfo)
endif()



See
http://vtk.org/gitweb?p=VTK.git;a=blob;f=CMakeLists.txt;h=a57fd66ef333fc26bf74fe658c88c3c634f54c3a;hb=HEAD#l12


Hth
Jc

On Fri, May 11, 2012 at 11:21 AM, pellegrini pellegr...@ill.fr wrote:

 Hi all,

 when cmake is run without specifying the build type using -D
 CMAKE_BUILD_TYPE, it is the Debug mode that is selected as
 the default. I would like to find a way to use Release as the default
 value when the user does not specify any build
 type in the cmake command line.

 From one of my previous post concerning CMAKE_INSTALL_PREFIX variable, I
 was thinking to use a similar approach i.e.:

 project(Foo)

 if (CMAKE_BUILD_TYPE_INITIALIZED_**TO_DEFAULT)
set(CMAKE_BUILD_TYPE Release)
 endif

 but cmake still sets CMAKE_BUILD_TYPE to Debug in the CMakeCache.txt file.

 Would you have any idea about what is wrong with my implementation ?

 thanks a lot.

 Eric
 --

 Powered by www.kitware.com

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

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

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




-- 
+1 919 869 8849
--

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] different assemblers in single build?

2012-05-11 Thread Alexey Istomin
Hi all,

Is it possible to use different assemblers in single build with CMake?

I try to use CMake for building embedded application - statically linked elf 
file.
Main CPU has 2 cores: general-purpose MIPS based core and DSP. Project has 
simple structure: main dir contains asm and C sources for Mips core, dsp-lib 
subdir has only asm sources for DSP core:

main/
crt0-mips.s 
main.c 
... 
dsp-lib/ 
fft.s
 

GCC compiler and assembler are used for Mips sources, special assembler 
(dspasm) based on gnu should be used for DSP. Main should be linked with dsp 
lib into single elf file.
I can successfully build main app without dsp-lib. But when I try to add 
dsp-lib subdir and set dspadm as assembler, CMake still uses mips-asm in the 
dsp-lib. Is it any solution?
 
Thanks a lot
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


[CMake] CheckSymbolExists fails with multiple header files

2012-05-11 Thread Leif Walsh
I want to check whether M_MMAP_THRESHOLD is defined in either malloc.h or 
sys/malloc.h, and whether CLOCK_REALTIME is defined in either time.h or 
sys/time.h.  I thought this would work:

check_symbol_exists(M_MMAP_THRESHOLD malloc.h;sys/malloc.h 
HAVE_M_MMAP_THRESHOLD)
check_symbol_exists(CLOCK_REALTIME time.h;sys/time.h HAVE_CLOCK_REALTIME)

In this case, I found CLOCK_REALTIME but not M_MMAP_THRESHOLD (they both exist 
on this system, btw).

Here are some things I've tried and their outcomes:

for M_MMAP_THRESHOLD:
malloc.h;sys/malloc.h - not found
malloc.h - found
stdlib.h;malloc.h;sys/malloc.h - not found

and for CLOCK_REALTIME:
time.h - found
sys/time.h (which includes time.h in fact) - not found
time.h;sys/time.h - found

This leads me to believe that something funky is going on with this module.  
Perhaps there is a bug?

-- 
Cheers,
Leif

--

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] Passing back list of files from Function

2012-05-11 Thread Michael Jackson
I have a function where I am generating a number of files and I need to pass 
that list of files back to the original calling cmake command/file/scope. How 
would I go about that?



function(create_files)
  set(options)
  set(multiValueArgs GENERATED_HEADERS)
  cmake_parse_arguments( WIG ${options} ${oneValueArgs} ${multiValueArgs} 
${ARGN} )

  foreach ()
 .. Generate some files

  endforeach()


??

endfunction()


set(headers )
create_files (GENERATED_HEADERS headers)


Could someone help me fill in the blanks? Thanks
---
Mike Jackson www.bluequartz.net

--

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 use different assemblers in single build?

2012-05-11 Thread Alexander Neundorf
On Friday 11 May 2012, Alexey Istomin wrote:
 Is it possible to use different assemblers in single build with CMake?
 
 I try to use CMake for building embedded application - statically linked
 elf file. Main CPU has 2 cores: general-purpose MIPS based core and DSP.
 Project has simple structure: main dir contains asm and C sources for Mips
 core, dsp-lib subdir has only asm sources for DSP core:
 
 main/
  crt0-mips.s
  main.c
  ...
  dsp-lib/
  fft.s
  
 
 GCC compiler and assembler are used for Mips sources, special assembler
 (dspasm) based on gnu should be used for DSP. Main should be linked with
 dsp lib into single elf file. I can successfully build main app without
 dsp-lib. But when I try to add dsp-lib subdir and set dspadm as assembler,
 CMake still uses mips-asm in the dsp-lib. Is it any solution? 

Yes.
You need to duse two different assembler dialects, each dialect counts as 
a separate language to cmake, so you can have many in parallel.

So you should add e.g. a ASM-DSP dialect, and set the language of the source 
files to ASM-DSP.
This this assembler will be invoked on these files.
Adding an assembler dialect is not hard, you need just a few tiny files:
http://www.cmake.org/Wiki/CMake/Assembler

This page is slightly out of date, but the documentation how to add a new 
assembler is still valid.
Just have a look at the Modules/ directory for the ASM-related files, you 
should see how this works.

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] Passing back list of files from Function

2012-05-11 Thread Alexander Neundorf
On Friday 11 May 2012, Michael Jackson wrote:
 I have a function where I am generating a number of files and I need to
 pass that list of files back to the original calling cmake
 command/file/scope. How would I go about that?
 
 
 
 function(create_files)
   set(options)
   set(multiValueArgs GENERATED_HEADERS)
   cmake_parse_arguments( WIG ${options} ${oneValueArgs}
 ${multiValueArgs} ${ARGN} )
 
   foreach ()
  .. Generate some files
 
   endforeach()
 
 
 ??
 
 endfunction()
 
 
 set(headers )
 create_files (GENERATED_HEADERS headers)
 
 
 Could someone help me fill in the blanks? Thanks

Give the name of a variable to create_files() which will be used to return the 
values:

function(create_files)
  set(options)
  set(multiValueArgs GENERATED_HEADERS)
  cmake_parse_arguments( WIG ${options} ${oneValueArgs}
${multiValueArgs} ${ARGN} )
 
  foreach ()
 .. Generate some files

  endforeach()

  # the following line sets generatedFiles to file[123].x
  set(${outVar} file1.x file2.x file3.x PARENT_SCOPE)

endfunction()

 
 
set(headers foo.h bar.h blub.h)
set(generatedFiles )
create_files (GENERATED_HEADERS INFILES ${headers} OUTVAR generatedFiles)

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] Passing back list of files from Function

2012-05-11 Thread Michael Jackson
Thanks. Worked.
--
Mike Jackson www.bluequartz.net

On May 11, 2012, at 3:40 PM, Alexander Neundorf wrote:

 On Friday 11 May 2012, Michael Jackson wrote:
  I have a function where I am generating a number of files and I need to
  pass that list of files back to the original calling cmake
  command/file/scope. How would I go about that?
  
  
  
  function(create_files)
set(options)
set(multiValueArgs GENERATED_HEADERS)
cmake_parse_arguments( WIG ${options} ${oneValueArgs}
  ${multiValueArgs} ${ARGN} )
  
foreach ()
   .. Generate some files
  
endforeach()
  
  
  ??
  
  endfunction()
  
  
  set(headers )
  create_files (GENERATED_HEADERS headers)
  
  
  Could someone help me fill in the blanks? Thanks
 Give the name of a variable to create_files() which will be used to return 
 the values:
 function(create_files)
   set(options)
   set(multiValueArgs GENERATED_HEADERS)
   cmake_parse_arguments( WIG ${options} ${oneValueArgs}
 ${multiValueArgs} ${ARGN} )
  
   foreach ()
  .. Generate some files
   endforeach()
   # the following line sets generatedFiles to file[123].x
   set(${outVar} file1.x file2.x file3.x PARENT_SCOPE)
 endfunction()
  
  
 set(headers foo.h bar.h blub.h)
 set(generatedFiles )
 create_files (GENERATED_HEADERS INFILES ${headers} OUTVAR generatedFiles)
 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] Intel compilers

2012-05-11 Thread Mohammad Mirzadeh
 You generally need to set CC, CXX, LD, and AR.  I found that in some cases
 even that didn't work.  I use this:

 option(INTEL_CC Use the Intel compiler. OFF)

 if (INTEL_CC)
 find_program(CMAKE_C_COMPILER NAMES icc)
 find_program(CMAKE_CXX_COMPILER NAMES icpc)
 find_program(CMAKE_AR NAMES xiar)
 find_program(CMAKE_LINKER NAMES xild)

 if (CMAKE_C_COMPILER MATCHES CMAKE_C_COMPILER-NOTFOUND OR
 CMAKE_CXX_COMPILER MATCHES CMAKE_CXX_COMPILER-NOTFOUND OR
 CMAKE_AR MATCHES CMAKE_AR-NOTFOUND OR
 CMAKE_LINKER MATCHES CMAKE_LINKER-NOTFOUND)
   message(FATAL_ERROR Cannot find Intel compiler.  You may need to run
`. /opt/intel/bin/compilervars.sh intel64')
 endif ()
 endif (INTEL_CC)

When I run ccmake -DINTEL_CC:BOOL=ON path/to/CMakeLists.txt, It does not
pick up intel compilers and I'm stuck with gcc. If I do CC=icc CXX=icpc
ccmake -DINTEL_CC:BOOL=ON path/to/CMakeLists.txt it can correctly find all
the libraries and prints:

CMake Warning at CMakeLists.txt:10 (ADD_EXECUTABLE):
   Cannot generate a safe linker search path for target cmTryCompileExec
   because files in some directories may conflict with libraries in implicit
   directories:

 link library [libimf.so] in /opt/apps/intel/10.1/cc/lib may be hidden
by files in:
   /opt/apps/intel/10.1/fc/lib
 link library [libsvml.so] in /opt/apps/intel/10.1/cc/lib may be hidden
by files in:
   /opt/apps/intel/10.1/fc/lib
 link library [libipgo.a] in /opt/apps/intel/10.1/cc/lib may be hidden
by files in:
   /opt/apps/intel/10.1/fc/lib
 link library [libirc.so] in /opt/apps/intel/10.1/cc/lib may be hidden
by files in:
   /opt/apps/intel/10.1/fc/lib
 link library [libirc_s.a] in /opt/apps/intel/10.1/cc/lib may be hidden
by files in:
   /opt/apps/intel/10.1/fc/lib

   Some of these libraries may not be found correctly.

Do I need to fix my LD_LIBRARY_PATH? right now it seems echo
$LD_LIBRARY_PATH says: /opt/apps/intel/10.1/cc/lib is in path (along with
other stuff of course).

 What references is it missing?  I'm willing to bet it's having trouble
 finding the intel libraries, maybe irc or imf.  Make sure you have sourced
 the compiler vars script before running cmake.  Maybe if you tell me what
 references it can't find I can help better.

Its not system libraries its missing, it seems to be some of my own.
Problem is when I turn on ipo, apparently compiler requires all the other
symbols from all the functions that are called when building each library.
Normally I do not need them until linking to my executable so when I omit
ipo, there is no issue. Also, if if I use ip, which does the same sort of
optimization but restricts to the current file, I do not get linking issues.

 I guess you have some static libraries that need symbols from each other
 and you have not added all necessary target_link_libraries() calls.
 Without this the linking order is obviously not right.

Yes that seems to be the case. So normally, without ipo, there is no
linking problems since all the actual linking happens when building
the executable at which point I link to all required libraries. Question
is, when you are building a static libraries, do you require all the
linking symbols at that point or you could relax until linking the
executable? This brings us to my last question. Is this fundamentally
different when working object files? I do not think you would need symbols
when working with object files until you initiate the linking. That's why I
asked if I could bypass the static libraries and just make the objects
instead.
--

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

2012-05-11 Thread Leif Walsh

On 11 May, 2012, at 5:12 PM, Mohammad Mirzadeh wrote:

  You generally need to set CC, CXX, LD, and AR.  I found that in some cases
  even that didn't work.  I use this:
 
  option(INTEL_CC Use the Intel compiler. OFF)
 
  if (INTEL_CC)
  find_program(CMAKE_C_COMPILER NAMES icc)
  find_program(CMAKE_CXX_COMPILER NAMES icpc)
  find_program(CMAKE_AR NAMES xiar)
  find_program(CMAKE_LINKER NAMES xild)
 
  if (CMAKE_C_COMPILER MATCHES CMAKE_C_COMPILER-NOTFOUND OR
  CMAKE_CXX_COMPILER MATCHES CMAKE_CXX_COMPILER-NOTFOUND OR
  CMAKE_AR MATCHES CMAKE_AR-NOTFOUND OR
  CMAKE_LINKER MATCHES CMAKE_LINKER-NOTFOUND)
message(FATAL_ERROR Cannot find Intel compiler.  You may need to run `. 
  /opt/intel/bin/compilervars.sh intel64')
  endif ()
  endif (INTEL_CC)
 
 When I run ccmake -DINTEL_CC:BOOL=ON path/to/CMakeLists.txt, It does not pick 
 up intel compilers and I'm stuck with gcc. If I do CC=icc CXX=icpc ccmake 
 -DINTEL_CC:BOOL=ON path/to/CMakeLists.txt it can correctly find all the 
 libraries and prints:
 
I forgot to mention that this must happen before you call project(), because 
that is where cmake detects a bunch of things about your compiler.

 CMake Warning at CMakeLists.txt:10 (ADD_EXECUTABLE):
Cannot generate a safe linker search path for target cmTryCompileExec
because files in some directories may conflict with libraries in implicit
directories:
 
  link library [libimf.so] in /opt/apps/intel/10.1/cc/lib may be hidden by 
 files in:
/opt/apps/intel/10.1/fc/lib
  link library [libsvml.so] in /opt/apps/intel/10.1/cc/lib may be hidden 
 by files in:
/opt/apps/intel/10.1/fc/lib
  link library [libipgo.a] in /opt/apps/intel/10.1/cc/lib may be hidden by 
 files in:
/opt/apps/intel/10.1/fc/lib
  link library [libirc.so] in /opt/apps/intel/10.1/cc/lib may be hidden by 
 files in:
/opt/apps/intel/10.1/fc/lib
  link library [libirc_s.a] in /opt/apps/intel/10.1/cc/lib may be hidden 
 by files in:
/opt/apps/intel/10.1/fc/lib
 
Some of these libraries may not be found correctly.
 
 Do I need to fix my LD_LIBRARY_PATH? right now it seems echo $LD_LIBRARY_PATH 
 says: /opt/apps/intel/10.1/cc/lib is in path (along with other stuff of 
 course). 

possibly, I don't know what fc/lib is, maybe fortran libraries?
 
  What references is it missing?  I'm willing to bet it's having trouble
  finding the intel libraries, maybe irc or imf.  Make sure you have sourced
  the compiler vars script before running cmake.  Maybe if you tell me what
  references it can't find I can help better.
 
 Its not system libraries its missing, it seems to be some of my own. Problem 
 is when I turn on ipo, apparently compiler requires all the other symbols 
 from all the functions that are called when building each library. Normally I 
 do not need them until linking to my executable so when I omit ipo, there is 
 no issue. Also, if if I use ip, which does the same sort of optimization but 
 restricts to the current file, I do not get linking issues.

yeah I think you need to call target_link_libraries(foo bar) if foo depends on 
symbols in bar, regardless of whether one or both is static
 
  I guess you have some static libraries that need symbols from each other
  and you have not added all necessary target_link_libraries() calls.
  Without this the linking order is obviously not right.
 
 Yes that seems to be the case. So normally, without ipo, there is no linking 
 problems since all the actual linking happens when building the executable at 
 which point I link to all required libraries. Question is, when you are 
 building a static libraries, do you require all the linking symbols at that 
 point or you could relax until linking the executable? This brings us to my 
 last question. Is this fundamentally different when working object files? I 
 do not think you would need symbols when working with object files until you 
 initiate the linking. That's why I asked if I could bypass the static 
 libraries and just make the objects instead.

Here is what I do:

each library I build has a static and shared version (libfoo and 
libfoo_static).  All the programs that test libfoo link with the shared one, so 
you can do ipo when building the shared library and then you don't need to do 
it again when you link the executable.

I ship a shared library libfoobar.so, when I build it, I link with 
libfoo_static.a and it does optimization between the source files that make up 
libfoobar.so and the already built libfoo_static.a.  So that's basically whole 
program optimization, but since I still build libfoo.so, my tests can link with 
that and not have a gigantic headache as icc tries to do whole program 
optimization on pretty much my whole source tree once for each test at link 
time.

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

[Cmake-commits] CMake branch, next, updated. v2.8.8-2853-gef4f9a5

2012-05-11 Thread Brad King
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, next has been updated
   via  ef4f9a549355b901f00acbeefc21b928b5b2d92c (commit)
   via  a2f5d14c739d53184b09d353919948a6c7b21fff (commit)
   via  9d9fc18ffa6bbacacde62020e6f97908f118f5dd (commit)
  from  25ba9565fa1a17a506e9e6fbe5635878fdc2ab1c (commit)

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

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef4f9a549355b901f00acbeefc21b928b5b2d92c
commit ef4f9a549355b901f00acbeefc21b928b5b2d92c
Merge: 25ba956 a2f5d14
Author: Brad King brad.k...@kitware.com
AuthorDate: Fri May 11 08:01:55 2012 -0400
Commit: Brad King brad.k...@kitware.com
CommitDate: Fri May 11 08:01:55 2012 -0400

Merge branch 'master' into next


---

Summary of changes:
 Source/CMakeVersion.cmake |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits