Re: [CMake] Asm support

2011-03-15 Thread Robert Bielik

Alexander Neundorf skrev 2011-03-15 21:19:

Assembler support works currently only in the makefile-based generators.
For having assembler supported in VisualStudio contributions from users are
needed (I don't have Windows, so I can't do that).


Thanks Alex, that pretty much explains it :) Ok, I'll have a look at what 
happens in the VS project files for included
asm files, meanwhile I'll add a custom command for it.

Regards,
/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] #cmakedefine vs #define

2011-03-15 Thread Alan W. Irwin

On 2011-03-15 16:26-0600 Balamurali Ananthan wrote:


Hello,

Sorry if this question is too primitive. I am trying to extract the build dir 
into the source code by populating it in a variable in my config.h file.


I do this by adding the following line in config.h.in

#cmakedefine PROJ_BUILD_DIR_CMAKEDEFINE "${PROJECT_BINARY_DIR}"

In the config.h, this produces

/* #undef PROJ_BUILD_DIR_CMAKEDEFINE */



But if i replace it to this in config.h.in,

#define PROJ_BUILD_DIR_DEFINE "${PROJECT_BINARY_DIR}"

Then the right value is populated in the config.h

#define PROJ_BUILD_DIR_DEFINE "/home/bala/projects/myproj/trunk/builds"

Wondering why didn't the cmakedefine work in this case? Any clues?


The man page for cmake covers this.  "#cmakedefine VAR will be
replaced with either #define VAR or /* #undef VAR  */
depending on  the  setting  of  VAR in CMake."

Note that VAR is the CMake variable name and not its value.
PROJ_BUILD_DIR_CMAKEDEFINE does not exist as a CMake variable in your
project so its CMake value is false and you get the above commented
out #undef result just like the man page says.  OTOH if you had
specified instead,

#cmakedefine PROJECT_BINARY_DIR

that would have configured (since PROJECT_BINARY_DIR is "True" in the
CMake sense for your project) as

#define PROJECT_BINARY_DIR

Of course, that would not have been too helpful to you since there is
no associated explicit value, but note #cmakedefine is quite useful
for the case of conditional programming depending on #ifdef (i.e.,
True/False binary macro logic).

For cases where you need to #define an explicit value, then you should
forget about #cmakedefine and use the configured #define (as you did
above).

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__
___
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] #cmakedefine vs #define

2011-03-15 Thread Balamurali Ananthan

Hello,

Sorry if this question is too primitive. I am trying to extract the 
build dir into the source code by populating it in a variable in my 
config.h file.


I do this by adding the following line in config.h.in

#cmakedefine PROJ_BUILD_DIR_CMAKEDEFINE "${PROJECT_BINARY_DIR}"

In the config.h, this produces

/* #undef PROJ_BUILD_DIR_CMAKEDEFINE */



But if i replace it to this in config.h.in,

#define PROJ_BUILD_DIR_DEFINE "${PROJECT_BINARY_DIR}"

Then the right value is populated in the config.h

#define PROJ_BUILD_DIR_DEFINE "/home/bala/projects/myproj/trunk/builds"

Wondering why didn't the cmakedefine work in this case? Any clues?

Thanks much.

--
Balamurali Ananthan

___
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] Eclipse generator - scanner-discovered include pathsand pre-processor symbols

2011-03-15 Thread Alexander Neundorf
On Tuesday 15 March 2011, Chatterjee, Shash wrote:
> Hi Alex,
>
> Yes, that is correct, that one pathentry line added to .cproject is all
> that is needed from the generator.  The scanner simply detects the built-in
> symbols and paths and sticks them in the container.  Then, the container
> contribution has to be added as part of the project paths.  Then, the
> indexer can find all the include files, and the pre-processor conditions
> work correctly.
>
> Or, at least, that is my understanding :-).

Ok.
I tried as it is now and also with the additional line.
In both cases I created an Eclipse project for cmake and loaded it in Eclipse.
In both cases Eclipse started building the workspace and the indexer was 
running.
In Both cases Eclipse offered autocompletion e.g. for the cmMakefile class, 
also in both cases a block
#ifdef __FLT_MIN__
was highlighted differently than a block
#ifdef __FLT_MIN__X__ 
(which is not a predefined macro).

Screenshots are here:
http://www.neundorf.net/pics/eclipse-without-patch.jpg
http://www.neundorf.net/pics/eclipse-with-patch.jpg

Which difference should the added line make ?

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] QtCreator project generator

2011-03-15 Thread Alexander Neundorf
On Tuesday 15 March 2011, Daniel Teske wrote:
> Hi,
>
> > My collegae has created the required patch for QtCreator 2.1.0 which
> > actually uses the defines created by the CMake patch.
> > Attached.
>
> I'd apply a patch like that to Creator. (There are some minor issues with
> it and it has to come via a merge request, but in general it does the right
> thing.)
>
> But modifying the codeblocks generator to add stuff that codeblocks is
> something *I* would rather avoid. 

Is there something missing in the sentence above ? E.g. a "not using" ?

> But that's not a question for me to decide.
>
> The original "plan" was to start with a new generator once the information
> Creator needs exceeds what the codeblocks generator provides, which I guess
> would be the case now. I do not have the time to work on that though.

It would be nice if somebody could contact the C::B developers and talk with 
them about this.

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

2011-03-15 Thread Alexander Neundorf
Hi,

On Tuesday 15 March 2011, Robert Bielik wrote:
> Robert Bielik skrev 2011-03-15 08:59:
> > Using 2.8.4, I'm trying to add an assembler file with cmake (64 bit
> > VS2008 build), but I'm at a loss, I tried:
> >
> > ENABLE_LANGUAGE(ASM_MASM)
> > IF(NOT CMAKE_ASM_MASM_COMPILER_WORKS)
> > MESSAGE(FATAL_ERROR "No assembler found!")
> > ENDIF(NOT CMAKE_ASM-MASM_COMPILER_WORKS)
> >
> > but the ml64 assembler does not seem to be found, cmake output is:
> >
> > -- The ASM_MASM compiler identification is unknown
> > -- Didn't find assembler
> > -- Loaded CMakeASM_MASMInformation - ASM_MASM support is still
> > experimental, please report issues CMake Error at
> > common/external/cryptopp561/CMakeLists.txt:259 (MESSAGE): No assembler
> > found!
>
> Further information: In CMakeDetermineASMCompiler.cmake
> ${_CMAKE_USER_C_COMPILER_PATH} & ${_CMAKE_USER_CXX_COMPILER_PATH} aswell as
> ${_CMAKE_TOOLCHAIN_LOCATION} are empty.
>
> And even though I set CMAKE_ASM_MASM_COMPILER explicitly in advanced view,
> the added assembler file never gets built (its included in the project, but
> cannot be "compiled")

In current cmake master, there is this code in 
CMakeDetermineASMCompiler.cmake:

...
ELSE("ASM${ASM_DIALECT}" STREQUAL "ASM") # some specific assembler "dialect"

   IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
  ${CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT})
   ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
  MESSAGE(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be
   preset !")
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)

ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")


# Find the compiler.
IF (_CMAKE_USER_CXX_COMPILER_PATH OR _CMAKE_USER_C_COMPILER_PATH)
   FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER
NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST}
PATHS ${_CMAKE_USER_C_COMPILER_PATH}
  ${_CMAKE_USER_CXX_COMPILER_PATH}
DOC "Assembler" NO_DEFAULT_PATH)
ENDIF (_CMAKE_USER_CXX_COMPILER_PATH OR _CMAKE_USER_C_COMPILER_PATH)
FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER
 NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST}
 PATHS ${_CMAKE_TOOLCHAIN_LOCATION} DOC "Assembler")


So, in your case, ${CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST} should be set 
to "ml" or "ml64".
This should then go into the second find_program() call, and there it should 
be found. The assembler should AFAIK be in the same directory as cl.exe.

Assembler support works currently only in the makefile-based generators.
For having assembler supported in VisualStudio contributions from users are 
needed (I don't have Windows, so I can't do that).

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

2011-03-15 Thread Dixon, Shane
I'm trying to add the vendor name ot the CPACK_NSIS_INSTALL_ROOT variable.  
Right now, I have this line:

 

set( CPACK_NSIS_INSTALL_ROOT $PROGRAMFILES\Atmel)

 

Unfortunately policy CMP0010 keeps kicking in and warning me that \A is 
invalid.  I can't find any escape sequence that makes the NSIS configuration 
happy.  I also noticed I can't use variables like ${CPACK_PACKAGE_VENDOR} 
because it will never resolve to the actual vendor and my NSIS installer 
actually has the literal C:\Program Files (x86)${CPACK_PACKAGE_VENDOR}\f.  
Using the above line works and creates a valid NSIS installer, but I get that 
annoying error on every build.  I can't use the forward slash either or it 
shows up in the NSIS window as a forward slash rather than a backslash, making 
it an invalid address.

 

How do I make this error go away and still keep NSIS happy?

 

 

---

Shane Dixon

Linux Engineer / Atmel Corporation

Tel: (+1)(719)540-1123

shane.di...@atmel.com / www.atmel.com

 

The information contained in this email message may be privileged, confidential 
and/or protected from unauthorized disclosure. If you are not the intended 
recipient, any dissemination, distribution or copying is strictly prohibited. 
Please immediately notify the sender by reply if you received this email in 
error. Thank you for your cooperation.

 

___
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] Test properties

2011-03-15 Thread Belcourt, Kenneth

Hi,

Another add_test() question.  I reuse the same test directory because  
I run both Fortran and C executables on the same test and the input  
files are so large that I don't want to replicate the entire test  
hierarchy.  The problem is that I need to remove files both before I  
run the first Fortran tests (this assumes I've done a previous run)  
and then remove files again before I run the C executable tests.  I  
have CMake code (below) but the remove files only happens once before  
the first Fortran tests run even though I have the remove files in  
there twice.


Is there any way to add a pre or post per test hook where I can remove  
files or run other commands (or perhaps there's undocumented test  
properties that I can use to do this)?


-- Noel

Here's what I mean.


# list of files I need to remove
set(Bwr_Files ...)

# remove the files
file(REMOVE ${Bwr_Files})

# Fortran executable
add_test(
  NAME bwr_fmelcor
  WORKING_DIRECTORY ${Bwr_Dir}
  COMMAND fmelcor.x BWR_v2-0.inp
)

# remove the output files before running C executable
# this remove never happens
file(REMOVE ${Bwr_Files})

# C executables
add_test(
  NAME bwr_melcor
  WORKING_DIRECTORY ${Bwr_Dir}
  COMMAND melcor.x BWR_v2-0.inp
)

# Make C executables run after Fortran does
SET_TESTS_PROPERTIES (bwr_melcor PROPERTIES DEPENDS bwr_fmelcor)


___
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 precedence when using enable_language to search for compilers

2011-03-15 Thread rocwhite168
Hi again,

I'm not sure if it is the time I posted this happened to be Sunday
that no one has read it or we simply cannot specify a precedence to
let cmake change its default sequence of searching for available
compilers?

Thanks,
Roc

On Fri, Mar 11, 2011 at 6:10 PM, rocwhite168  wrote:
> Hi everyone,
>
> I wonder how I can specify precedence when using enable_language to
> search for compilers. For example, if my system has both ifort and
> gfortran installed, and I want to use ifort instead of the gfortran,
> how could I set up this?
>
> From what I currently found, a work-around is to set
> CMAKE_Fortran_Compiler before project(xxx), so that this variable can
> never gets overridden later, but clearly this is not the best way,
> since I need gfortran if there turns out to be no ifort available.
>
> By the way, what's the best place to look for this kind of
> information? The documentation does not seem to be very complete..
>
> Thanks,
> Roc
>
___
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] Adding new language.

2011-03-15 Thread arrowdodger
On Tue, Mar 15, 2011 at 12:20 PM, Michael Wild  wrote:

> Just one warning: AFAIK these rule variables are only used for
> Makefile-based generators, *NOT* for Xcode and VisualStudio and the
> like. I'd prefer the route via add_custom_command/add_custom_target...
>
> Michael
>

Oh, great, then i should abandon what i've written. So, since adding new
language involves creating rule variables, this too works only with
Makefile's?
___
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] avoid substitution of semicolon

2011-03-15 Thread Clinton Stimpson
On Tuesday, March 15, 2011 10:25:17 am Tim Blechmann wrote:
> hi all,
> 
> i am trying to write a ctest script, compiling for different OSX
> architectures. the CMAKE_OSX_ARCHITECTURES option uses the semicolon to
> distinguish between architectures, but my attempts to generate the
> argument string with semicolons haven't been successful, it seems they are
> not escaped:
> 
> foreach(ARCH ppc i386 x86_64 "ppc\;i386" "i386\;x86_64"
> "ppc\;i386\;x86_64") set(x -DCMAKE_OSX_ARCHITECTURES=${ARCH})
>   message (${x})
> endforeach()
> 
> gives me:
> -DCMAKE_OSX_ARCHITECTURES=ppc
> -DCMAKE_OSX_ARCHITECTURES=i386
> -DCMAKE_OSX_ARCHITECTURES=x86_64
> -DCMAKE_OSX_ARCHITECTURES=ppci386
> -DCMAKE_OSX_ARCHITECTURES=i386x86_64
> -DCMAKE_OSX_ARCHITECTURES=ppci386x86_64
> 
> any idea how i could create the correct argument string?
> 
> thanks, tim

Have you tried quotes in your message() so it doesn't remove the semi-colons?
message("${x}")

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com
___
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] avoid substitution of semicolon

2011-03-15 Thread David Cole
What are you going to do with it once it's in the value ARCH or x?

It's hard to see the literal contents of a cmake variable without
using "" in the message command.

This code:
set(x "-DCMAKE_OSX_ARCHITECTURES=i386\\;x86_64")
message("${x}")

produces this output:
-DCMAKE_OSX_ARCHITECTURES=i386\;x86_64

The "\" needs escaping, and needs to be doubled up in the set call.
The arg to message needs to be quoted so that semi-colons do not get
eaten.

Does that help?

If not, we need more context..


Cheers,
David


On Tue, Mar 15, 2011 at 12:25 PM, Tim Blechmann  wrote:
> hi all,
>
> i am trying to write a ctest script, compiling for different OSX 
> architectures.
> the CMAKE_OSX_ARCHITECTURES option uses the semicolon to distinguish between
> architectures, but my attempts to generate the argument string with semicolons
> haven't been successful, it seems they are not escaped:
>
> foreach(ARCH ppc i386 x86_64 "ppc\;i386" "i386\;x86_64" "ppc\;i386\;x86_64")
>  set(x -DCMAKE_OSX_ARCHITECTURES=${ARCH})
>  message (${x})
> endforeach()
>
> gives me:
> -DCMAKE_OSX_ARCHITECTURES=ppc
> -DCMAKE_OSX_ARCHITECTURES=i386
> -DCMAKE_OSX_ARCHITECTURES=x86_64
> -DCMAKE_OSX_ARCHITECTURES=ppci386
> -DCMAKE_OSX_ARCHITECTURES=i386x86_64
> -DCMAKE_OSX_ARCHITECTURES=ppci386x86_64
>
> any idea how i could create the correct argument string?
>
> thanks, tim
>
> --
> t...@klingt.org
> http://tim.klingt.org
>
> /"\  ASCII Ribbon Campaign
> \ /   no HTML in email & vCards
>  X     no proprietary attachments
> / \     use open standards
>
>
> ___
> 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] avoid substitution of semicolon

2011-03-15 Thread Tim Blechmann
hi all,

i am trying to write a ctest script, compiling for different OSX architectures. 
the CMAKE_OSX_ARCHITECTURES option uses the semicolon to distinguish between 
architectures, but my attempts to generate the argument string with semicolons 
haven't been successful, it seems they are not escaped:

foreach(ARCH ppc i386 x86_64 "ppc\;i386" "i386\;x86_64" "ppc\;i386\;x86_64")
  set(x -DCMAKE_OSX_ARCHITECTURES=${ARCH})
  message (${x})
endforeach()

gives me:
-DCMAKE_OSX_ARCHITECTURES=ppc
-DCMAKE_OSX_ARCHITECTURES=i386
-DCMAKE_OSX_ARCHITECTURES=x86_64
-DCMAKE_OSX_ARCHITECTURES=ppci386
-DCMAKE_OSX_ARCHITECTURES=i386x86_64
-DCMAKE_OSX_ARCHITECTURES=ppci386x86_64

any idea how i could create the correct argument string?

thanks, tim

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

/"\  ASCII Ribbon Campaign
\ /   no HTML in email & vCards
 X no proprietary attachments
/ \ use open standards


___
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] INSTALL CODE using EXEC_PROGRAM with spaces in path

2011-03-15 Thread David Cole
Generator expressions (like your "")
are only valid within the context of an add_custom_command call. Some
are also available from the newer signature of the add_test command.

See the docs for each of those for specific supported generator expressions.

In the context of a CMake -P script (which an INSTALL(SCRIPT snippet
is...) those are not interpreted in any way, and so will be passed
directly as arguments to regsvr.

You could see exactly what's being passed to the called executable by
using a batch file or writing the tiniest c program possible to figure
it all out.

Boil it down to the very simplest script you can. Write an install
script that has a bunch of hard-coded values in it until you have an
execute_process command line that works. Then gradually generalize it
from there. I think that approach will show you that execute_process
works just fine if you pass it reasonable arguments.


HTH,
David


On Tue, Mar 15, 2011 at 5:11 AM, Urbach, Marcel [Rohmann GmbH]
 wrote:
>
> Hi David
>
> Your solution works fine, but i still got the problem with execute_process.
> Right now I use it this way:
>
> #cmakelists.txt
> ADD_LIBRARY(${project_name} SHARED ${sources} ${headers} ${idls} ${generated} 
> ${resources}  )
> SET(project_out "${INSTALL_LIB_DIR}/${project_name}_d.dll")
> STRING(REGEX REPLACE "/" "" project_out ${project_out} )
> register_shared_libraries(${project_name} "${project_out}" )
>
> #global.cmake
> FUNCTION(register_shared_libraries)
>    IF (WIN32)
>        SET(param1 ${ARGV0})
>        SET(param2 ${ARGV1})
>        CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/post_install.cmake.in
>            ${CMAKE_CURRENT_BINARY_DIR}/post_install.cmake @ONLY
>            )
>        INSTALL(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/post_install.cmake")
>    ENDIF()
> ENDFUNCTION()
>
> #post_install.cmake.in
> SET(file_name "@param2@")
> MESSAGE(STATUS "file_name: ${file_name}")
> EXEC_PROGRAM( regsvr32
>              ARGS \"/s\"
>              ARGS \"${file_name}\"
>              OUTPUT_VARIABLE ov RETURN_VALUE rv )
>
> MESSAGE("out ${ov}")
> MESSAGE("res ${rv}")
>
> SET(project_name "@param1@")
> MESSAGE(STATUS "project_name: ${project_name}")
> EXECUTE_PROCESS(COMMAND regsvr32 #$
>    INPUT_FILE $
>    WORKING_DIRECTORY $
>    OUTPUT_VARIABLE ov RESULT_VARIABLE rv
> )
> MESSAGE("out ${ov}")
> MESSAGE("res ${rv}")
>
>
> The first version using EXEC_PROGRAM works fine, but there is a problem 
> resolving the target name. XXX.dll for release or XXX_d.for debug.
> The second (EXECUTE_PROCESS) never returns from regsvr32 when using regsvr32 
> #$ or it says wrong syntax for file name or dir 
> name when using regsvr32 INPUT_FILE $ 
> WORKING_DIRECTORY $
>
>
>
>
>
> -Ursprüngliche Nachricht-
> Von: David Cole [mailto:david.c...@kitware.com]
> Gesendet: Montag, 14. März 2011 17:17
> An: Urbach, Marcel [Rohmann GmbH]
> Cc: cmake@cmake.org
> Betreff: Re: [CMake] INSTALL CODE using EXEC_PROGRAM with spaces in path
>
> On Mon, Mar 14, 2011 at 11:17 AM, Urbach, Marcel [Rohmann GmbH]
>  wrote:
>> I have already tried to use the SCRIPT. But there is a problem to submit the 
>> name of the dll or the project name to the extern script. I need something 
>> like a  parameter and I guess that doesn't exsist. Do you have any ideas to 
>> solve this?
>> INSTALL(SCRIPT "PostInst.cmake" PARAMETeR...)
>>
>
> How about something like this?
>
>  # File "script.cmake.in"
>  set(p1 "@param1@")
>  execute_process(COMMAND xyz ${p1} OUTPUT_VARIABLE ov RESULT_VARIABLE rv)
>  if(NOT rv STREQUAL "0")
>    message(FATAL_ERROR "xyz failed: rv='${rv}'")
>  endif()
>
> And then:
>
>  # in CMakeLists.txt
>  set(param1 "value-of-p1")
>  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/script.cmake.in
> ${CMAKE_CURRENT_BINARY_DIR}/script.cmake @ONLY)
>  install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/script.cmake")
>
>
> I have written code in the past which calls regsvr32 successfully.
> What are the arguments you are passing that are causing problems? Can
> you call the same regsvr32 from the Windows command prompt
> successfully? Are you using the same regsvr32 in both scenarios?
>
>
>> I also tried to use execute_process, but it didn't work with regsvr32.
>> It ended in an endless loop. Only a timeout could break it. Can you confirm 
>> that?
>>
>> -Ursprüngliche Nachricht-
>> Von: David Cole [mailto:david.c...@kitware.com]
>> Gesendet: Freitag, 11. März 2011 16:50
>> An: Tyler
>> Cc: Urbach, Marcel [Rohmann GmbH]; cmake@cmake.org
>> Betreff: Re: [CMake] INSTALL CODE using EXEC_PROGRAM with spaces in path
>>
>> Tyler's right. Use install(SCRIPT instead.
>>
>> And use execute_process instead of exec_program. It's better.
>>
>> From the help at
>> http://cmake.org/cmake/help/cmake-2-8-docs.html#command:execute_process
>> :
>> "The execute_process command is a newer more powerful version of
>> exec_program, but the old command has been kept for compatibility."
>>
>>
>> On Fri, Mar 11, 2011 at 10:34 AM, Tyler  wrote:
>>> I believe the cano

Re: [CMake] add_test WORKING_DIRECTORY option

2011-03-15 Thread David Cole
On Mon, Mar 14, 2011 at 6:54 PM, Belcourt, Kenneth  wrote:
>
> On Mar 14, 2011, at 4:19 PM, Belcourt, Kenneth wrote:
>
>> Hi David,
>
> Oops, busted.  The modules I loaded inserted an older version of CMake,
> v2.8.1.  When I run with my local copy of CMake 2.8.4, the error goes away.
>
> Sorry about the noise.
>
> -- Noel
>
>
>

Whew.

You had me going there...
___
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] vs2010 MANIFESTUAC not handled correctly

2011-03-15 Thread Aaron_Wright
I'm trying to use this in my CMake file for a simple executable:

SET_TARGET_PROPERTIES(
your_executable 
PROPERTIES LINK_FLAGS "/MANIFESTUAC:\"level='requireAdministrator' 
uiAccess='false'\"")

This worked in vs2008, but not in vs2010. The project contains:

level='requireAdministrator' uiAccess='false'

But needs:

requireAdministrator
false

Am I using this the correct way, or is there a way to do it to get the 
desired results?
---
Aaron Wright
___
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] Asm support

2011-03-15 Thread Robert Bielik

Eric Noulard skrev 2011-03-15 10:36:

There has been a lot of work done (Alex and Brad I think) in topic
"ReworkedAsmSupport"
it has been merged to master last week.

May be you can try a nightly build
http://www.cmake.org/files/vCVS/cmake-2.8.4.20110314-gf52ca-win32-x86.exe
in order to see if this makes your case work.


Unfortunately not, the ml64 assembler is still not found :(

/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] Eclipse generator - scanner-discovered include pathsand pre-processor symbols

2011-03-15 Thread Chatterjee, Shash

Hi Alex,

Yes, that is correct, that one pathentry line added to .cproject is all that is 
needed from the generator.  The scanner simply detects the built-in symbols and 
paths and sticks them in the container.  Then, the container contribution has 
to be added as part of the project paths.  Then, the indexer can find all the 
include files, and the pre-processor conditions work correctly.

Or, at least, that is my understanding :-).

Thanks,
Shash

-Original Message-
From: Alexander Neundorf [mailto:a.neundorf-w...@gmx.net]


But all you want is to add the line 

to the file ?

And even with all the builtin include dirs and macros already in the .cproject 
file, the indexer still needs to find them again itself ?

___
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] QtCreator project generator

2011-03-15 Thread Daniel Teske
Hi,

> My collegae has created the required patch for QtCreator 2.1.0 which
> actually uses the defines created by the CMake patch.
> Attached.

I'd apply a patch like that to Creator. (There are some minor issues with it 
and it has to come via a merge request, but in general it does the right 
thing.)

But modifying the codeblocks generator to add stuff that codeblocks is 
something *I* would rather avoid. But that's not a question for me to decide.

The original "plan" was to start with a new generator once the information 
Creator needs exceeds what the codeblocks generator provides, which I guess 
would be the case now. I do not have the time to work on that though.

So in summary, if the codeblocks generator would be patched, I'd apply a patch 
to creator to support that. But IMHO, that's the lesser solution.

daniel
___
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] Ralph Barth/AEH/DBS/GDB ist außer Haus.

2011-03-15 Thread Ralph . Barth

Ralph Barth will be out of the office starting  15.03.2011 and will be
returning on 21.03.2011.

Ich werde Ihre Nachrichten nach meiner Rückkehr beantworten.




Deutsche Börse Systems AG
Chairman of the Supervisory Board/
Vorsitzender des Aufsichtsrats:
Reto Francioni
Executive Board/Vorstand:
Michael Kuhn (Chief Executive Officer/Vorsitzender),
Yves Baguet (Deputy Chief Executive Officer/
stellv. Vorsitzender), Gerhard Leßmann.
Aktiengesellschaft with registered seat in/mit Sitz in
Frankfurt am Main.
Commercial register/Handelsregister:
Local court/Amtsgericht Frankfurt am Main HRB 42413.

-
Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte
sofort den Absender und loeschen Sie diese E-Mail. Das unbefugte Kopieren
dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen
ist nicht gestattet.

The information contained in this message is confidential or protected by
law. If you are not the intended recipient, please contact the sender and
delete this message. Any unauthorised copying of this message or
unauthorised distribution of the information contained herein is prohibited.

Legally required information for business correspondence/
Gesetzliche Pflichtangaben fuer Geschaeftskorrespondenz:
http://deutsche-boerse.com/letterhead

___
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] Asm support

2011-03-15 Thread Eric Noulard
2011/3/15 Robert Bielik :
> Robert Bielik skrev 2011-03-15 08:59:
>>
>> Using 2.8.4, I'm trying to add an assembler file with cmake (64 bit VS2008
>> build), but I'm at a loss, I tried:

There has been a lot of work done (Alex and Brad I think) in topic
"ReworkedAsmSupport"
it has been merged to master last week.

May be you can try a nightly build
http://www.cmake.org/files/vCVS/cmake-2.8.4.20110314-gf52ca-win32-x86.exe
in order to see if this makes your case work.


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

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

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

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


Re: [CMake] Adding new language.

2011-03-15 Thread Michael Wild
On 03/15/2011 09:53 AM, arrowdodger wrote:
> On Tue, Mar 15, 2011 at 1:44 AM, Michael Hertling wrote:
> 
>> To be exact, it's a rule variable which describes how to compile a C
>> source file to an object file. On my system, it currently expands to:
>>
>>-o  -c 
>>
>> AFAIK, these rule variables can be redefined and have the usual
>> directory scope; the bracketed placeholders have a special meaning
>> when the rule is used to generate command lines in a Makefile, e.g.
>> So, you might set CMAKE_C_COMPILE_OBJECT in a directory to whatever
>> is necessary to compile a C source file to byte code while you can
>> refer to flags, preprocessor definitions and the source and object
>> file via the placeholders. With just a few files to be byte-code-
>> compiled, that's possibly more appropriate than defining a new
>> language for this purpose.
>>
>> Regards,
>>
>> Michael
> 
> 
> Thanks, it worked.
> 


Just one warning: AFAIK these rule variables are only used for
Makefile-based generators, *NOT* for Xcode and VisualStudio and the
like. I'd prefer the route via add_custom_command/add_custom_target...

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

2011-03-15 Thread Robert Bielik

Robert Bielik skrev 2011-03-15 08:59:

Using 2.8.4, I'm trying to add an assembler file with cmake (64 bit VS2008 
build), but I'm at a loss, I tried:

ENABLE_LANGUAGE(ASM_MASM)
IF(NOT CMAKE_ASM_MASM_COMPILER_WORKS)
MESSAGE(FATAL_ERROR "No assembler found!")
ENDIF(NOT CMAKE_ASM-MASM_COMPILER_WORKS)

but the ml64 assembler does not seem to be found, cmake output is:

-- The ASM_MASM compiler identification is unknown
-- Didn't find assembler
-- Loaded CMakeASM_MASMInformation - ASM_MASM support is still experimental, 
please report issues
CMake Error at common/external/cryptopp561/CMakeLists.txt:259 (MESSAGE):
No assembler found!


Further information: In CMakeDetermineASMCompiler.cmake 
${_CMAKE_USER_C_COMPILER_PATH} & ${_CMAKE_USER_CXX_COMPILER_PATH}
aswell as ${_CMAKE_TOOLCHAIN_LOCATION} are empty.

And even though I set CMAKE_ASM_MASM_COMPILER explicitly in advanced view, the 
added assembler file never gets built (its
included in the project, but cannot be "compiled")

/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] INSTALL CODE using EXEC_PROGRAM with spaces in path

2011-03-15 Thread Urbach, Marcel [Rohmann GmbH]

Hi David

Your solution works fine, but i still got the problem with execute_process.
Right now I use it this way:

#cmakelists.txt
ADD_LIBRARY(${project_name} SHARED ${sources} ${headers} ${idls} ${generated} 
${resources}  )
SET(project_out "${INSTALL_LIB_DIR}/${project_name}_d.dll")
STRING(REGEX REPLACE "/" "" project_out ${project_out} )
register_shared_libraries(${project_name} "${project_out}" )

#global.cmake
FUNCTION(register_shared_libraries)
IF (WIN32)
SET(param1 ${ARGV0})
SET(param2 ${ARGV1})
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/post_install.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/post_install.cmake @ONLY
)
INSTALL(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/post_install.cmake")
ENDIF()
ENDFUNCTION()

#post_install.cmake.in
SET(file_name "@param2@")
MESSAGE(STATUS "file_name: ${file_name}")
EXEC_PROGRAM( regsvr32 
  ARGS \"/s\" 
  ARGS \"${file_name}\" 
  OUTPUT_VARIABLE ov RETURN_VALUE rv )

MESSAGE("out ${ov}")
MESSAGE("res ${rv}")

SET(project_name "@param1@")
MESSAGE(STATUS "project_name: ${project_name}")
EXECUTE_PROCESS(COMMAND regsvr32 #$ 
INPUT_FILE $
WORKING_DIRECTORY $
OUTPUT_VARIABLE ov RESULT_VARIABLE rv
)
MESSAGE("out ${ov}")
MESSAGE("res ${rv}")


The first version using EXEC_PROGRAM works fine, but there is a problem 
resolving the target name. XXX.dll for release or XXX_d.for debug.
The second (EXECUTE_PROCESS) never returns from regsvr32 when using regsvr32 
#$ or it says wrong syntax for file name or dir 
name when using regsvr32 INPUT_FILE $ 
WORKING_DIRECTORY $





-Ursprüngliche Nachricht-
Von: David Cole [mailto:david.c...@kitware.com] 
Gesendet: Montag, 14. März 2011 17:17
An: Urbach, Marcel [Rohmann GmbH]
Cc: cmake@cmake.org
Betreff: Re: [CMake] INSTALL CODE using EXEC_PROGRAM with spaces in path

On Mon, Mar 14, 2011 at 11:17 AM, Urbach, Marcel [Rohmann GmbH]
 wrote:
> I have already tried to use the SCRIPT. But there is a problem to submit the 
> name of the dll or the project name to the extern script. I need something 
> like a  parameter and I guess that doesn't exsist. Do you have any ideas to 
> solve this?
> INSTALL(SCRIPT "PostInst.cmake" PARAMETeR...)
>

How about something like this?

  # File "script.cmake.in"
  set(p1 "@param1@")
  execute_process(COMMAND xyz ${p1} OUTPUT_VARIABLE ov RESULT_VARIABLE rv)
  if(NOT rv STREQUAL "0")
message(FATAL_ERROR "xyz failed: rv='${rv}'")
  endif()

And then:

  # in CMakeLists.txt
  set(param1 "value-of-p1")
  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/script.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/script.cmake @ONLY)
  install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/script.cmake")


I have written code in the past which calls regsvr32 successfully.
What are the arguments you are passing that are causing problems? Can
you call the same regsvr32 from the Windows command prompt
successfully? Are you using the same regsvr32 in both scenarios?


> I also tried to use execute_process, but it didn't work with regsvr32.
> It ended in an endless loop. Only a timeout could break it. Can you confirm 
> that?
>
> -Ursprüngliche Nachricht-
> Von: David Cole [mailto:david.c...@kitware.com]
> Gesendet: Freitag, 11. März 2011 16:50
> An: Tyler
> Cc: Urbach, Marcel [Rohmann GmbH]; cmake@cmake.org
> Betreff: Re: [CMake] INSTALL CODE using EXEC_PROGRAM with spaces in path
>
> Tyler's right. Use install(SCRIPT instead.
>
> And use execute_process instead of exec_program. It's better.
>
> From the help at
> http://cmake.org/cmake/help/cmake-2-8-docs.html#command:execute_process
> :
> "The execute_process command is a newer more powerful version of
> exec_program, but the old command has been kept for compatibility."
>
>
> On Fri, Mar 11, 2011 at 10:34 AM, Tyler  wrote:
>> I believe the canonical answer is to write the command line you wish
>> to execute into a file and use install(SCRIPT ...) instead of
>> install(CODE ...).
>>
>> tyler
>>
>> On Fri, Mar 11, 2011 at 7:14 AM, Urbach, Marcel [Rohmann GmbH]
>>  wrote:
>>> Hi,
>>>
>>> I am using Windows 7 and I have tried to register my builded dll files with
>>> regsvr32 after installing them. It works for paths without spaces.
>>>
>>>
>>>
>>> INSTALL( CODE
>>>
>>>     "EXEC_PROGRAM( regsvr32 ARGS \"/s\" ARGS \"C:\\lib\\test.dll\"
>>> OUTPUT_VARIABLE POST_INST_OUT RETURN_VALUE POST_INST_RES )"
>>>
>>> )
>>>
>>>
>>>
>>> But when there a spaces inside a path regsvr32 returns with an error:
>>>
>>> "Error loading module "C:\Program".
>>>
>>>
>>>
>>> INSTALL( CODE
>>>
>>>     "EXEC_PROGRAM( regsvr32 ARGS \"/s\" ARGS \"C:\\Program
>>> Files\\test\\lib\\test.dll\" OUTPUT_VARIABLE POST_INST_OUT RETURN_VALUE
>>> POST_INST_RES )"
>>>
>>> )
>>>
>>>
>>>
>>> I have spended the whole day  escaping the path in the right way but I don't
>>> get it.
>>>
>>>
>>>
>>> ___
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects 

Re: [CMake] Adding new language.

2011-03-15 Thread arrowdodger
On Tue, Mar 15, 2011 at 1:44 AM, Michael Hertling wrote:

> To be exact, it's a rule variable which describes how to compile a C
> source file to an object file. On my system, it currently expands to:
>
>-o  -c 
>
> AFAIK, these rule variables can be redefined and have the usual
> directory scope; the bracketed placeholders have a special meaning
> when the rule is used to generate command lines in a Makefile, e.g.
> So, you might set CMAKE_C_COMPILE_OBJECT in a directory to whatever
> is necessary to compile a C source file to byte code while you can
> refer to flags, preprocessor definitions and the source and object
> file via the placeholders. With just a few files to be byte-code-
> compiled, that's possibly more appropriate than defining a new
> language for this purpose.
>
> Regards,
>
> Michael


Thanks, it worked.
___
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] Asm support

2011-03-15 Thread Robert Bielik

Using 2.8.4, I'm trying to add an assembler file with cmake (64 bit VS2008 
build), but I'm at a loss, I tried:

ENABLE_LANGUAGE(ASM_MASM)
IF(NOT CMAKE_ASM_MASM_COMPILER_WORKS)
MESSAGE(FATAL_ERROR "No assembler found!")
ENDIF(NOT CMAKE_ASM-MASM_COMPILER_WORKS)

but the ml64 assembler does not seem to be found, cmake output is:

-- The ASM_MASM compiler identification is unknown
-- Didn't find assembler
-- Loaded CMakeASM_MASMInformation - ASM_MASM support is still experimental, 
please report issues
CMake Error at common/external/cryptopp561/CMakeLists.txt:259 (MESSAGE):
  No assembler found!

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