[cmake-developers] [CMake 0012467]: Both FindSDL.cmake and FindSDL_mixer.cmake does not honor REQUIRED

2011-09-19 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=12467 
== 
Reported By:ogronom
Assigned To:
== 
Project:CMake
Issue ID:   12467
Category:   Modules
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2011-09-19 11:36 EDT
Last Modified:  2011-09-19 11:36 EDT
== 
Summary:Both FindSDL.cmake and FindSDL_mixer.cmake does not
honor REQUIRED
Description: 
Build does not terminate while using find_package(. REQUIRED) and there is no
sdl_mixer or sdl libraries in the system.

Steps to Reproduce: 
cmake_minimum_required(VERSION 2.8)

find_package(SDL_mixer REQUIRED)
find_package(SDL REQUIRED)

if (NOT SDL_mixer_FOUND)
message(Possible Bug in SDL_mixer)
endif (NOT SDL_mixer_FOUND)


if (NOT SDL_FOUND)
message(Possible Bug in SDL)
endif (NOT SDL_FOUND)

== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-09-19 11:36 ogronomNew Issue
==

___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] [CMake 0012469]: RPM COMPONENT packaging support for pre/post install scripts is weak

2011-09-19 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=12469 
== 
Reported By:Chip Christian
Assigned To:
== 
Project:CMake
Issue ID:   12469
Category:   CPack
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2011-09-19 20:29 WAST
Last Modified:  2011-09-19 20:29 WAST
== 
Summary:RPM COMPONENT packaging support for pre/post install
scripts is weak
Description: 
When I use any of the variables like
CPACK_RPM_POST_INSTALL_SCRIPT_FILE
I wind up with pre/post steps for all packages.  

I'd like to be able to have different steps per package.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-09-19 20:29 Chip Christian New Issue
==

___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Automoc in cmake

2011-09-19 Thread Alexander Neundorf
On Sunday, September 18, 2011 07:11:58 PM Marcus D. Hanwell wrote:
 On Sun, Sep 18, 2011 at 6:39 AM, Alexander Neundorf neund...@kde.org 
wrote:
  On Saturday, September 17, 2011 07:16:28 PM Stephen Kelly wrote:
  Stephen Kelly steveire@... writes:
   Alexander Neundorf wrote:
   
   
   Would it be possible to make CMAKE_AUTOMOC imply
   CMAKE_INCLUDE_CURRENT_DIR?
   
   All the best,
   
   Steve.
  
  Is it still possible to consider this? It's not ideal that you have to
  do this:
  
  set(CMAKE_AUTOMOC ON)
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  
  instead of this:
  
  set(CMAKE_AUTOMOC ON)
  
  Don't know.
  I'm usually ok with having to set the include directories explicitely.
  What do others think ?
 
 It seems to me that if you always need to do both for it to work, then
 it should be a candidate for consolidation.

set(CMAKE_INCLUDE_CURRENT_DIR ON) automatically adds the current source dir 
and the current binary dir for each directory which has a target as include 
directory.

This is a bit more than necessary for automoc.
For automoc for every target which needs moc'ing its current binary dir has to 
be added.

So, I'm still not sure.

Alex
___
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [CMake] export() vs. install(export...)

2011-09-19 Thread Michael Wild
On 09/19/2011 01:14 AM, Tim Gallagher wrote:
 Hi,
 
 I've been trying to figure out the exact differences between the 
 export() and install(export ...) functions and I have some questions 
 still.
 
 From the documentation, EXPORT() makes available the build tree for
 a given target and puts the path to the build tree in the 
 ~/.cmake/packages/project directory while INSTALL(EXPORT ...)
 makes the install tree available.
 
 What I don't understand is what happens with EXPORT() if you have 
 multiple builds of the same project. For example, we often build (in 
 two different directories) the same project with two compilers
 (Intel and GNU) and install them in two different locations. But the
 entries in the registry just show path names. How would
 find_package() work in that instance?

the ~/.cmake/packages/project registry is only queried if you don't
specify a project_DIR variable which points to a directory containing
the lower-project-config.cmake (or projectConfig.cmake) file. If not
specified, find_package() will use the latest build tree registered in
~/.cmake/package/project.

 
 When using INSTALL(EXPORT ...), I can get the information I need by 
 INCLUDE'ing the file, but I cannot find that file without the user's 
 input. Is there a way to put the path to the install tree in the 
 registry? If so, how would find_package() behave with multiple 
 installs?

See the documentation of the find_package() command for information on
where CMake looks for projectConfig.cmake files.

 
 If anybody has any suggestions, I would appreciate it.
 
 Tim

Does this help?

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] export() vs. install(export...)

2011-09-19 Thread Tim Gallagher
It does make sense and answered most of my questions. Maybe rather than asking 
more questions, I can make some suggestions based on what I'm trying to do and 
see what people think:

1. It would be nice to be able to register installation trees in the registry 
so the user does not have to provide the project_DIR variable to find the 
config file. 

2. It would likewise be nice if entries in the registry could be distinguished 
based on something other than the project name. For instance, we are always 
building our libraries with Intel and GNU compilers (in different build trees) 
and installing them both (in different installation trees, it's a Fortran 
project, so the module files are incompatible). It would be awesome if there 
was a way for find_package() to track down the version compiled with the same 
compiler currently being used based on the compiler ID string or something. 

Maybe there is a clever way to accomplish both of these that I'm missing. But, 
the vast majority of the time people complain that our code doesn't compile is 
because they specified the wrong project_DIR variable and are mixing 
compilers. The registry seems like a great way to keep the user from having to 
figure out the project_DIR variable for each of the libraries, but right now 
I don't know how or if it can be done. 

Has anybody else come across a similar issue and found a solution? 

Thanks,

Tim

- Original Message -
From: Michael Wild them...@gmail.com
To: cmake@cmake.org
Sent: Monday, September 19, 2011 2:29:47 AM
Subject: Re: [CMake] export() vs. install(export...)

On 09/19/2011 01:14 AM, Tim Gallagher wrote:
 Hi,
 
 I've been trying to figure out the exact differences between the 
 export() and install(export ...) functions and I have some questions 
 still.
 
 From the documentation, EXPORT() makes available the build tree for
 a given target and puts the path to the build tree in the 
 ~/.cmake/packages/project directory while INSTALL(EXPORT ...)
 makes the install tree available.
 
 What I don't understand is what happens with EXPORT() if you have 
 multiple builds of the same project. For example, we often build (in 
 two different directories) the same project with two compilers
 (Intel and GNU) and install them in two different locations. But the
 entries in the registry just show path names. How would
 find_package() work in that instance?

the ~/.cmake/packages/project registry is only queried if you don't
specify a project_DIR variable which points to a directory containing
the lower-project-config.cmake (or projectConfig.cmake) file. If not
specified, find_package() will use the latest build tree registered in
~/.cmake/package/project.

 
 When using INSTALL(EXPORT ...), I can get the information I need by 
 INCLUDE'ing the file, but I cannot find that file without the user's 
 input. Is there a way to put the path to the install tree in the 
 registry? If so, how would find_package() behave with multiple 
 installs?

See the documentation of the find_package() command for information on
where CMake looks for projectConfig.cmake files.

 
 If anybody has any suggestions, I would appreciate it.
 
 Tim

Does this help?

Michael
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

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


[CMake] Determining IntDir property for Visual Studio 10

2011-09-19 Thread Perry Ismangil
Hi,

I am trying to set the IntDir property in VS 10 project generation, I
could not find the right variable/property to set.

Inspecting the CMake generator code, it seems it is rather hardcoded,
it doesn't get the value externally.

Is this correct?

Using CMake 2.8.5.

-- 
Perry Ismangil
___
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] User generated header file

2011-09-19 Thread Perry Ismangil
On Sun, Sep 18, 2011 at 16:43, Eric Noulard eric.noul...@gmail.com wrote:

 You may tell CMake that this file is generated as part of the build:
 set_source_files_properties(your_header.h PROPERTIES GENERATED TRUE)


Thanks Eric, this is indeed the property I was looking for to get the
right behaviour.

-- 
Perry Ismangil
___
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] User generated header file

2011-09-19 Thread Eric Noulard
2011/9/19 Perry Ismangil pe...@pjsip.org:
 On Sun, Sep 18, 2011 at 16:47, C. Meissa carsten.mei...@gmx.de wrote:

 Do you want the user to manually add the header, or do you want cmake
 to create it?


 User will manually add it before compile, so Eric mentioned setting
 the GENERATED property to true, it works.

The fact is it works the way you want, which is good, but beside that
why would it be better for the user to face a failing build (because
he forgot to create the file)
than
face a failing CMake run (because he forgot to create the file)?



-- 
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] linker default library path /usr/local/lib on OSX

2011-09-19 Thread Michael Jackson
My guess is that the audio library has an install path of /usr/local/lib
encoded in it. Try posting tue output of otool for the actual audio
library.

-
Mike Jackson www.bluequartz.net
Principal Software Engineer   mike.jack...@bluequartz.net
BlueQuartz Software   Dayton, Ohio
Sent from my mobile device.

On Sep 18, 2011, at 23:38, Cristobal Navarro axisch...@gmail.com wrote:

ok i get your point.
mmm. In others words you need something equivalent to rpath command, im
pretty sure cmake can handle this easily let me know if the following helps.

have you tried adding more options to the find_library command ??
for example have you tried this (also, with the PATHS command just to be
sure):

find_library(IrrKlang_LIBRARIES irrKlang
PATHS
${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc
 NO_DEFAULT_PATH
 )

And what is your target_link_libraries command?



On Sun, Sep 18, 2011 at 12:33 PM, amine bezzarga abezz...@gmail.com wrote:

 The issue is not about finding the library at built time, event if my
 library is found in
 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc 
 and
 after building is done, my app is still looking for the library in
 /usr/local/lib at runtime as you can see with the otools output in my first
 message.

 I want to find a way to tell the linker to link the library from where it
 find it.
 Does it make sense ?

 On Sun, Sep 18, 2011 at 4:29 PM, Cristobal Navarro axisch...@gmail.comwrote:

 yes

 you have to provide another option
 find_library( IrrKlang_LIBRARIES irrKlang PATHS path1 to library path2
 to library ... )

 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library

 is this what you need?
 best regards
 Cristobal


 On Sun, Sep 18, 2011 at 10:16 AM, amine bezzarga abezz...@gmail.comwrote:

 Hello guys,

 I added a sound library to my project, So I first created a cmake module
 to find it

 MESSAGE(STATUS Looking for IrrKlang...)

 find_library(IrrKlang_LIBRARIES irrKlang

 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc
  )

 find_path(IrrKlang_INCLUDE_DIRS irrKlang.h
  ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/include
 )

 IF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)
SET(IrrKlang_FOUND TRUE)
 ENDIF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)


 IF (IrrKlang_FOUND)
IF (NOT IrrKlang_FIND_QUIETLY)
   MESSAGE(STATUS Found IrrKlang: ${IrrKlang_LIBRARIES})
ENDIF (NOT IrrKlang_FIND_QUIETLY)
 ELSE (IrrKlang_FOUND)
IF (IrrKlang_FIND_REQUIRED)
   MESSAGE(FATAL_ERROR Could not find IrrKlang)
ENDIF (IrrKlang_FIND_REQUIRED)
 ENDIF (IrrKlang_FOUND)

 Everything works fine exept I can't control from where the library is
 linked.
 Why after I build my project OSX is looking for that library in
 /usr/local/lib ?
 Is there a way to tell cmake to link the library from where it find it
 i.e 
 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc
 ?

 here is my otool output after building the project
 $ otool -L ./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp
 ./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp:
 @executable_path/../Frameworks/Ogre.framework/Versions/1.7.1/Ogre
 (compatibility version 0.0.0, current version 1.7.1)
  @executable_path/../Components/libOgreRTShaderSystem.dylib
 (compatibility version 0.0.0, current version 1.7.1)
  @executable_path/../Frameworks/OIS.framework/Versions/A/OIS
 (compatibility version 1.0.0, current version 1.0.0)
  /usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current
 version 1.0.0) -- I want cmake to link that lib, because my lib is not
 there.
  /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
 version 7.9.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
 123.0.0)

 I know I can correct the path with bundleutilities, but the library still
 need to be copied in /usr/local/lib to be preccessed by bundleutilitities in
 that case.

 Do you have any ideas ?
 Mino


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

Re: [CMake] User generated header file

2011-09-19 Thread John Drescher
 Do you want the user to manually add the header, or do you want cmake
 to create it?


 User will manually add it before compile, so Eric mentioned setting
 the GENERATED property to true, it works.

 The fact is it works the way you want, which is good, but beside that
 why would it be better for the user to face a failing build (because
 he forgot to create the file)
 than
 face a failing CMake run (because he forgot to create the file)?


My question is can't you have CMake generate the header for the user
instead of them supplying a file? Is it just defines in this header?

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


[CMake] Cross compiling in Win32 environment doesn't work

2011-09-19 Thread Martin Kupke
I'm using CMake in version 2.8.5 and just want to cross compile with a 
decicated Compiler / Linker set on my Windows machine. Of course I've 
read the FAQ and the Tutorial, afterwards I started trying to use CMake 
on a DOS (cmd.exe) command line interface with CMakeLists.txt and a 
toolchain file. After all tests failed to get CMake work in the Win32 
environment, I tried it in my private Linux (Debian Squeeze) and the 
same procedure is successful. In Linux environment it works as 
described, in Win32 not.


My PC has installed Windows XP including SP3.
CMake version 2.8.5 is installed.
My development path contains a CMakeLists.txt and a toolchain_ppc.cmake 
file, because I want to compile on my WinXP code for an embedded 
hardware using a PPC processor.

The toolchain_ppc.cmake file contains the following settings:
set (CMAKE_GENERATOR NMake Makefiles)
set (CMAKE_SYSTEM_NAME Generic)
set (CMAKE_C_COMPILER dcc.exe)
set (CMAKE_SYSTEM_PROCESSOR ppc)

if(CMAKE_CROSSCOMPILING)
message(Cross Compiling)
endif(CMAKE_CROSSCOMPILING)

set(CMAKE_C_COMPILER C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe)
set(CMAKE_C_FLAGS -tPPCVLEEN:simple)

In my build environment I created an empty folder output and in the 
command line interface (console / cmd.exe) I'm calling the cmake tool:
D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -D 
CMAKE_TOOLCHAIN_FILE=..\toolchain_ppc.cmake ..

The output of the cmake tool always is:
-- Building for: Visual Studio 10
Cross Compiling

As you can see my message Cross Compiling is shown, this introduces 
that cmake is using the CMAKE_CROSSCOMPILING flag. But why the hell is 
there always the output -- Building for: Visual Studio 10?

I don't wan't to use anything from / for Visual Studio 10.

The CMakeOutput.log contains the following lines:
The target system is: Generic -  - ppc
The host system is: Windows - 5.1 - x86
Compiling the C compiler identification source file CMakeCCompilerId.c 
succeeded.

Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
Build flags: -tPPCVLEEN:simple
Id flags:

The output was:
0


Compilation of the C compiler identification source CMakeCCompilerId.c 
produced a.out


Compiling the C compiler identification source file CMakeCCompilerId.c 
succeeded.

Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
Build flags: -tPPCVLEEN:simple
Id flags: -c

The output was:
0


Compilation of the C compiler identification source CMakeCCompilerId.c 
produced CMakeCCompilerId.o


Compiling the CXX compiler identification source file 
CMakeCXXCompilerId.cpp succeeded.

Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
Build flags: -tPPCVLEEN:simple
Id flags:

The output was:
0


Compilation of the CXX compiler identification source 
CMakeCXXCompilerId.cpp produced a.out


Compiling the CXX compiler identification source file 
CMakeCXXCompilerId.cpp succeeded.

Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
Build flags: -tPPCVLEEN:simple
Id flags: -c

The output was:
0


Compilation of the CXX compiler identification source 
CMakeCXXCompilerId.cpp produced CMakeCXXCompilerId.o


Determining if the C compiler works passed with the following output:
Change Dir: 
D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMakeTmp


Run Build Command:C:\PROGRA~1\MICROS~2.0\Common7\IDE\devenv.com 
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec



Microsoft (R) Visual Studio Version 10.0.30319.1.

Copyright (C) Microsoft Corp. All rights reserved.

1-- Build started: Project: cmTryCompileExec, Configuration: Debug 
Win32 --


1  testCCompiler.c

1C:\Program 
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): 
warning MSB8012: 
TargetPath(D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec) 
does not match the Linker's OutputFile property value 
(D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec.exe). 
This may cause your project to build incorrectly. To correct this, 
please make sure that $(OutDir), $(TargetName) and $(TargetExt) property 
values match the value specified in %(Link.OutputFile).


1  cmTryCompileExec.vcxproj - 
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec


== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==



Detecting C compiler ABI info compiled with the following output:
Change Dir: 
D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMakeTmp


Run Build Command:C:\PROGRA~1\MICROS~2.0\Common7\IDE\devenv.com 
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec



Microsoft (R) Visual Studio Version 10.0.30319.1.

Copyright (C) Microsoft Corp. All rights reserved.

1-- Build started: Project: cmTryCompileExec, Configuration: Debug 
Win32 --


1  CMakeCCompilerABI.c

1C:\Program 
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): 
warning MSB8012: 

Re: [CMake] Cross compiling in Win32 environment doesn't work

2011-09-19 Thread Eric Noulard
2011/9/19 Martin Kupke martin.ku...@novero.com:
 I'm using CMake in version 2.8.5 and just want to cross compile with a
 decicated Compiler / Linker set on my Windows machine. Of course I've read
 the FAQ and the Tutorial, afterwards I started trying to use CMake on a DOS
 (cmd.exe) command line interface with CMakeLists.txt and a toolchain file.
 After all tests failed to get CMake work in the Win32 environment, I tried
 it in my private Linux (Debian Squeeze) and the same procedure is
 successful. In Linux environment it works as described, in Win32 not.

 My PC has installed Windows XP including SP3.
 CMake version 2.8.5 is installed.
 My development path contains a CMakeLists.txt and a toolchain_ppc.cmake
 file, because I want to compile on my WinXP code for an embedded hardware
 using a PPC processor.
 The toolchain_ppc.cmake file contains the following settings:
 set (CMAKE_GENERATOR NMake Makefiles)


I'm not sure whether if CMAKE_GENERATOR can be set in the toolchain file?
[...]

 D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -D
 CMAKE_TOOLCHAIN_FILE=..\toolchain_ppc.cmake ..

did you try to add '-G NMake Makefiles' to your command line?

[...]

 I just want to use a standard Assembler, C Compiler and Linker.
 I don't need CXX (C++) in my build environment and even I don't need (want)
 any Visual Studio in my Cross Compilation.
 The generator for CMake shall be NMake Makefiles so that the generated
 Makefile can be used with NMake.

 Hopefully you can help me out of this.


 ___
 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




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


[CMake] Windows: install conditionnaly an executable

2011-09-19 Thread ycollette . nospam
Hello,

I would like to do this kind of installation:

My package contains several executable with a version number by application

- first install: install all the application and write a version number into 
the windows registry

- update install: install only the application which have a greater version 
number.

I tryied the following example:

project (Test)

cmake_minimum_required (VERSION 2.6)

set(TEST_MAJOR 1)
set(TEST_MINOR 1)
set(TEST_REVISION 1)

get_filename_component(REG_TEST_MAJOR 
[HKEY_LOCAL_MACHINE\\Software\\Arpack\\Test;Major] NAME)
get_filename_component(REG_TEST_MINOR 
[HKEY_LOCAL_MACHINE\\Software\\Arpack\\Test;Minor] NAME)
get_filename_component(REG_TEST_REVISION 
[HKEY_LOCAL_MACHINE\\Software\\Arpack\\Test;Revision] NAME)

message(STATUS TEST_MAJOR= in registry - ${REG_TEST_MAJOR} - in cmake - 
${TEST_MAJOR})
message(STATUS TEST_MINOR= in registry - ${REG_TEST_MINOR} - in cmake - 
${TEST_MINOR})
message(STATUS TEST_REVISION = in registry - ${REG_TEST_REVISION} - in cmake - 
${TEST_REVISION})

set(REG_VERSION ${REG_MAJOR}.${REG_MINOR}.${REG_REVISION})
set(VERSION ${MAJOR}.${MINOR}.${REVISION})

if ((${REG_VERSION} VERSION_LESS ${VERSION}) OR (${REG_TEST_MAJOR} STREQUAL 
/registry))
  message(STATUS Test Not installed)
  
  install(FILES machine.h
  DESTINATION include/)

  set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS 
 WriteRegStr HKLM 
'SOFTWAREArpackTest' 'Major' '${TEST_MAJOR}'
 WriteRegStr HKLM 
'SOFTWAREArpackTest' 'Minor' '${TEST_MINOR}'
 WriteRegStr HKLM 
'SOFTWAREArpackTest' 'Revision' '${TEST_REVISION}')

else ()
  message(STATUS Test Already installed)
endif ()

include(CPack)




But it works only once (the version number are red only while the package is 
created by cpack).

How can I read with cmake the registry key dynamically in the installer and 
use this version number to install conditionnaly some applications ?

Best regards,

YC
___
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] Cross compiling in Win32 environment doesn't work

2011-09-19 Thread Martin Kupke

  
  
If adding the parameter -G "NMake Makefiles" to my command line,
then the output is different...but still errors:
* snip output *
Cross Compiling
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler:
C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
-- Check for working C compiler:
C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe --
broken
CMake Error at C:/Program Files/CMake
2.8/share/cmake-2.8/Modules/CMakeTestCComp
iler.cmake:52 (MESSAGE):
 The C compiler "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe" is
not able to
 compile a simple test program.

 It fails with the following output:

 Change Dir:
D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMak
eTmp

 Run Build Command:nmake /NOLOGO "cmTryCompileExec\fast"

 nmake -f CMakeFiles\cmTryCompileExec.dir\build.make /nologo
-L
 CMakeFiles\cmTryCompileExec.dir\build

 "C:\Program Files\CMake 2.8\bin\cmake.exe" -E
cmake_progress_report

D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\CMakeFil
es
 1

 Building C object
CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

 C:\WindRiver\diab\5.9.0.0\WIN32\bin\dcc.exe -o
 CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj -c

D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\testCCom
piler.c


 Target Unknown. Use the -t option or set a default target with
dctrl -t

 NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
code
 '0x1'

 Stop.

 NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
code
 '0x2'

 Stop.

* snap output *

As you can see above, now the CMAKE_C_FLAGS are not recognized.
set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")




On 19.09.11 15:24, Eric Noulard wrote:

  2011/9/19 Martin Kupke martin.ku...@novero.com:

  
I'm using CMake in version 2.8.5 and just want to cross compile with a
decicated Compiler / Linker set on my Windows machine. Of course I've read
the FAQ and the Tutorial, afterwards I started trying to use CMake on a DOS
(cmd.exe) command line interface with CMakeLists.txt and a toolchain file.
After all tests failed to get CMake work in the Win32 environment, I tried
it in my private Linux (Debian Squeeze) and the same procedure is
successful. In Linux environment it works as described, in Win32 not.

My PC has installed Windows XP including SP3.
CMake version 2.8.5 is installed.
My development path contains a CMakeLists.txt and a toolchain_ppc.cmake
file, because I want to compile on my WinXP code for an embedded hardware
using a PPC processor.
The toolchain_ppc.cmake file contains the following settings:
set (CMAKE_GENERATOR "NMake Makefiles")

  
  
I'm not sure whether if CMAKE_GENERATOR can be set in the toolchain file?
[...]


  
D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -D
CMAKE_TOOLCHAIN_FILE="..\toolchain_ppc.cmake" ..

  
  did you try to add '-G "NMake Makefiles"' to your command line?

[...]



  
I just want to use a standard Assembler, C Compiler and Linker.
I don't need CXX (C++) in my build environment and even I don't need (want)
any Visual Studio in my Cross Compilation.
The generator for CMake shall be "NMake Makefiles" so that the generated
Makefile can be used with "NMake".

Hopefully you can help me out of this.


___
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


  
  




-- 
  
  
  


  
  martin

kupke
   can diagnostics
  engineer | senior software developer 
  m: +49.151.5511.3632 | e: martin.ku...@novero.com
  skype: martin.kupke_novero

| w: www.novero.com
  
  
meesmannstr.103 | 44807 Bochum | germany

   
  novero gmbh | parsevalstr.  7 a | 40468 dsseldorf | germany |
  amtsgericht dsseldorf | hrb 58283 |
  umsatzsteueridentifikationsnummer: de 814973142 |
  geschftsfhrender gesellschafter: razvan olosu  
  

  

  

___
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 

Re: [CMake] Cross compiling in Win32 environment doesn't work

2011-09-19 Thread Martin Kupke

  
  
My problem (the error) already occurs in the toolchain file, this
means before the CMakeLists.txt is read. So far it is total
independent of the entries in the CMakeLists.txt!

I have added the line:
message ("Mein CMakeLists.txt File")
in top of my CMakeLists.txt and would assume that there is an output
on the console with the string, but it isn't.

The output is stopped while parsing the toolchain file and
determining the compiler.

On 19.09.11 15:26, Benjamin Ruard wrote:

  You can use the following commands to know what are compilers used in
the CMakeLists.txt:

message("C compiler: " ${CMAKE_C_COMPILER})
message("C++ compiler: " ${CMAKE_CXX_COMPILER})

Moreover, you can set them:

set(CMAKE_CXX_COMPILER ...)

regards

Benjamin JEANTY-RUARD

Le lundi 19 septembre 2011 à 14:44 +0200, Martin Kupke a écrit :

  
I'm using CMake in version 2.8.5 and just want to cross compile with a 
decicated Compiler / Linker set on my Windows machine. Of course I've 
read the FAQ and the Tutorial, afterwards I started trying to use CMake 
on a DOS (cmd.exe) command line interface with CMakeLists.txt and a 
toolchain file. After all tests failed to get CMake work in the Win32 
environment, I tried it in my private Linux (Debian Squeeze) and the 
same procedure is successful. In Linux environment it works as 
described, in Win32 not.

My PC has installed Windows XP including SP3.
CMake version 2.8.5 is installed.
My development path contains a CMakeLists.txt and a toolchain_ppc.cmake 
file, because I want to compile on my WinXP code for an embedded 
hardware using a PPC processor.
The toolchain_ppc.cmake file contains the following settings:
set (CMAKE_GENERATOR "NMake Makefiles")
set (CMAKE_SYSTEM_NAME "Generic")
set (CMAKE_C_COMPILER "dcc.exe")
set (CMAKE_SYSTEM_PROCESSOR "ppc")

if(CMAKE_CROSSCOMPILING)
message("Cross Compiling")
endif(CMAKE_CROSSCOMPILING)

set(CMAKE_C_COMPILER "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")
set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")

In my build environment I created an empty folder output and in the 
command line interface (console / cmd.exe) I'm calling the cmake tool:
D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -D 
CMAKE_TOOLCHAIN_FILE="..\toolchain_ppc.cmake" ..
The output of the cmake tool always is:
-- Building for: Visual Studio 10
Cross Compiling

As you can see my message "Cross Compiling" is shown, this introduces 
that cmake is using the "CMAKE_CROSSCOMPILING" flag. But why the hell is 
there always the output "-- Building for: Visual Studio 10"?
I don't wan't to use anything from / for Visual Studio 10.

The CMakeOutput.log contains the following lines:
The target system is: Generic -  - ppc
The host system is: Windows - 5.1 - x86
Compiling the C compiler identification source file "CMakeCCompilerId.c" 
succeeded.
Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
Build flags: -tPPCVLEEN:simple
Id flags:

The output was:
0


Compilation of the C compiler identification source "CMakeCCompilerId.c" 
produced "a.out"

Compiling the C compiler identification source file "CMakeCCompilerId.c" 
succeeded.
Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
Build flags: -tPPCVLEEN:simple
Id flags: -c

The output was:
0


Compilation of the C compiler identification source "CMakeCCompilerId.c" 
produced "CMakeCCompilerId.o"

Compiling the CXX compiler identification source file 
"CMakeCXXCompilerId.cpp" succeeded.
Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
Build flags: -tPPCVLEEN:simple
Id flags:

The output was:
0


Compilation of the CXX compiler identification source 
"CMakeCXXCompilerId.cpp" produced "a.out"

Compiling the CXX compiler identification source file 
"CMakeCXXCompilerId.cpp" succeeded.
Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
Build flags: -tPPCVLEEN:simple
Id flags: -c

The output was:
0


Compilation of the CXX compiler identification source 
"CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o"

Determining if the C compiler works passed with the following output:
Change Dir: 
D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMakeTmp

Run Build Command:C:\PROGRA~1\MICROS~2.0\Common7\IDE\devenv.com 
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec


Microsoft (R) Visual Studio Version 10.0.30319.1.

Copyright (C) Microsoft Corp. All rights reserved.

1-- Build started: Project: cmTryCompileExec, Configuration: Debug 
Win32 --

1  testCCompiler.c

1C:\Program 
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): 
warning MSB8012: 
TargetPath(D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec) 
does not match the Linker's OutputFile property value 
(D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec.exe). 
This may cause your project to build incorrectly. To correct this, 
please make sure that $(OutDir), $(TargetName) 

Re: [CMake] Cross compiling in Win32 environment doesn't work

2011-09-19 Thread Eric Noulard
2011/9/19 Martin Kupke martin.ku...@novero.com

 My problem (the error) already occurs in the toolchain file, this means 
 before the CMakeLists.txt is read. So far it is total independent of the 
 entries in the CMakeLists.txt!

 I have added the line:
 message (Mein CMakeLists.txt File)
 in top of my CMakeLists.txt and would assume that there is an output on the 
 console with the string, but it isn't.

 The output is stopped while parsing the toolchain file and determining the 
 compiler.

That's what I was about to say.

Read http://www.vtk.org/Wiki/CMake_Cross_Compiling  carefully
you'll see that you may have to write a

Platform/${CMAKE_SYSTEM_NAME}-compiler.cmake file
in order to inform CMake about your particular compiler compilation FLAGS.

Doing it in CMakeLists.txt may already be too late.
Nevertheless it puzzles me that it works on Linux and not on Windows...

I'm no expert concerning Cross-compiling with CMake so I let others
take over this discussion.

--
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] Cross compiling in Win32 environment doesn't work

2011-09-19 Thread Benjamin Ruard
You can use the following commands to know what are compilers used in
the CMakeLists.txt:

message(C compiler:  ${CMAKE_C_COMPILER})
message(C++ compiler:  ${CMAKE_CXX_COMPILER})

Moreover, you can set them:

set(CMAKE_CXX_COMPILER ...)

regards

Benjamin JEANTY-RUARD

Le lundi 19 septembre 2011 à 14:44 +0200, Martin Kupke a écrit :
 I'm using CMake in version 2.8.5 and just want to cross compile with a 
 decicated Compiler / Linker set on my Windows machine. Of course I've 
 read the FAQ and the Tutorial, afterwards I started trying to use CMake 
 on a DOS (cmd.exe) command line interface with CMakeLists.txt and a 
 toolchain file. After all tests failed to get CMake work in the Win32 
 environment, I tried it in my private Linux (Debian Squeeze) and the 
 same procedure is successful. In Linux environment it works as 
 described, in Win32 not.
 
 My PC has installed Windows XP including SP3.
 CMake version 2.8.5 is installed.
 My development path contains a CMakeLists.txt and a toolchain_ppc.cmake 
 file, because I want to compile on my WinXP code for an embedded 
 hardware using a PPC processor.
 The toolchain_ppc.cmake file contains the following settings:
 set (CMAKE_GENERATOR NMake Makefiles)
 set (CMAKE_SYSTEM_NAME Generic)
 set (CMAKE_C_COMPILER dcc.exe)
 set (CMAKE_SYSTEM_PROCESSOR ppc)
 
 if(CMAKE_CROSSCOMPILING)
 message(Cross Compiling)
 endif(CMAKE_CROSSCOMPILING)
 
 set(CMAKE_C_COMPILER C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe)
 set(CMAKE_C_FLAGS -tPPCVLEEN:simple)
 
 In my build environment I created an empty folder output and in the 
 command line interface (console / cmd.exe) I'm calling the cmake tool:
 D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -D 
 CMAKE_TOOLCHAIN_FILE=..\toolchain_ppc.cmake ..
 The output of the cmake tool always is:
 -- Building for: Visual Studio 10
 Cross Compiling
 
 As you can see my message Cross Compiling is shown, this introduces 
 that cmake is using the CMAKE_CROSSCOMPILING flag. But why the hell is 
 there always the output -- Building for: Visual Studio 10?
 I don't wan't to use anything from / for Visual Studio 10.
 
 The CMakeOutput.log contains the following lines:
 The target system is: Generic -  - ppc
 The host system is: Windows - 5.1 - x86
 Compiling the C compiler identification source file CMakeCCompilerId.c 
 succeeded.
 Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
 Build flags: -tPPCVLEEN:simple
 Id flags:
 
 The output was:
 0
 
 
 Compilation of the C compiler identification source CMakeCCompilerId.c 
 produced a.out
 
 Compiling the C compiler identification source file CMakeCCompilerId.c 
 succeeded.
 Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
 Build flags: -tPPCVLEEN:simple
 Id flags: -c
 
 The output was:
 0
 
 
 Compilation of the C compiler identification source CMakeCCompilerId.c 
 produced CMakeCCompilerId.o
 
 Compiling the CXX compiler identification source file 
 CMakeCXXCompilerId.cpp succeeded.
 Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
 Build flags: -tPPCVLEEN:simple
 Id flags:
 
 The output was:
 0
 
 
 Compilation of the CXX compiler identification source 
 CMakeCXXCompilerId.cpp produced a.out
 
 Compiling the CXX compiler identification source file 
 CMakeCXXCompilerId.cpp succeeded.
 Compiler: C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
 Build flags: -tPPCVLEEN:simple
 Id flags: -c
 
 The output was:
 0
 
 
 Compilation of the CXX compiler identification source 
 CMakeCXXCompilerId.cpp produced CMakeCXXCompilerId.o
 
 Determining if the C compiler works passed with the following output:
 Change Dir: 
 D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMakeTmp
 
 Run Build Command:C:\PROGRA~1\MICROS~2.0\Common7\IDE\devenv.com 
 CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
 
 
 Microsoft (R) Visual Studio Version 10.0.30319.1.
 
 Copyright (C) Microsoft Corp. All rights reserved.
 
 1-- Build started: Project: cmTryCompileExec, Configuration: Debug 
 Win32 --
 
 1  testCCompiler.c
 
 1C:\Program 
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): 
 warning MSB8012: 
 TargetPath(D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec)
  
 does not match the Linker's OutputFile property value 
 (D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec.exe).
  
 This may cause your project to build incorrectly. To correct this, 
 please make sure that $(OutDir), $(TargetName) and $(TargetExt) property 
 values match the value specified in %(Link.OutputFile).
 
 1  cmTryCompileExec.vcxproj - 
 D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec
 
 == Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==
 
 
 
 Detecting C compiler ABI info compiled with the following output:
 Change Dir: 
 D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMakeTmp
 
 Run Build 

Re: [CMake] Windows: install conditionnaly an executable

2011-09-19 Thread Eric Noulard
2011/9/19  ycollette.nos...@free.fr:
 Hello,

 I would like to do this kind of installation:

 My package contains several executable with a version number by application

 - first install: install all the application and write a version number into 
 the windows registry
 - update install: install only the application which have a greater version 
 number.


[...]


 But it works only once (the version number are red only while the package is 
 created by cpack).

Yes because CMakeLists.txt is read at CMake time (when CMake run) and
not at Install time.


 How can I read with cmake the registry key dynamically in the installer and 
 use this version number to install conditionnaly some applications ?

You need to have a look at your specific installer language (seems to
be NSIS) in order to embbed such script
in your installer (with some extra commands in
CPACK_NSIS_EXTRA_INSTALL_COMMANDS)


-- 
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] Windows: install conditionnaly an executable

2011-09-19 Thread Eric Noulard
Please do not drop the ML address.


2011/9/19  ycollette.nos...@free.fr:

 How can I read with cmake the registry key dynamically in the installer 
 and use this version number to install conditionnaly some applications ?

You need to have a look at your specific installer language (seems to be 
NSIS) in order to embbed such script
in your installer (with some extra commands in 
CPACK_NSIS_EXTRA_INSTALL_COMMANDS)

 So I need to get rid of al the install commands in my CMakeFiles.txt and 
 replace them by NSIS commands embedded in the 
 CPACK_NSIS_EXTRA_INSTALL_COMMANDS ?

I don't really know NSIS enough to be sure but may be you can:

 1) Use CMake install command as usual may be some extra COMPONENT
argument in order to create logical groups
 http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack

 2) Use NSIS scripting in order to enable/disable component
installation depending on the thing
 the installer found on the machine.

You cannot use CMake (nor CPack) to decide what to install or not to
install on the target machine because
I suppose you build the NSIS installer on one machine and then install
on another one right?

So I think you must put into your NSIS installer all the files, and
then decide with some
installer specific mean what to effectively install or not.

This not much of a CMake/CPack problem but more an NSIS problem.

Currently there is no cross-platform/cross-installer install time action which
can be implemented using CMake/CPack.

install(CODE
or
install(SCRIPT

may be the beginning of such a feature but this is not enough and would
require CMake to be present at install time which is not the case today.


-- 
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] Determining IntDir property for Visual Studio 10

2011-09-19 Thread David Cole
On Mon, Sep 19, 2011 at 5:25 AM, Perry Ismangil pe...@pjsip.org wrote:
 Hi,

 I am trying to set the IntDir property in VS 10 project generation, I
 could not find the right variable/property to set.

 Inspecting the CMake generator code, it seems it is rather hardcoded,
 it doesn't get the value externally.

 Is this correct?

 Using CMake 2.8.5.

 --
 Perry Ismangil
 ___
 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


The code writes out reasonable per-target values for both IntDir and
OutDir -- you can change the output directory on a per-target basis
for various types of files with the following target properties:

  
http://cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:ARCHIVE_OUTPUT_DIRECTORY
  
http://cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:LIBRARY_OUTPUT_DIRECTORY
  
http://cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:RUNTIME_OUTPUT_DIRECTORY

See also the _CONFIG variants to specify per-configuration output directories.

You cannot change IntDir, but you can use ${CMAKE_CFG_INTDIR} in
custom commands if necessary, to direct custom output to the same
location as build output.

  http://cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_CFG_INTDIR


HTH,
David
___
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] Cross compiling in Win32 environment doesn't work

2011-09-19 Thread Martin Kupke

  
  
That's a hint, I changed my toolchain file "toolchain_ppc.cmake" to
the following:
INCLUDE(CMakeForceCompiler)
set(CMAKE_SYSTEM_NAME "Discovery")

if(CMAKE_CROSSCOMPILING)
message("Cross Compiling")
endif(CMAKE_CROSSCOMPILING)

# which compilers to use for C and C++
set(CMAKE_C_COMPILER "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")
set(CMAKE_FORCE_C_COMPILER
"C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")
set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")

Then I created a folder with the name Platform containing a file
with CMAKE_SYSTEM_NAME which is Discovery - at this point I had
already problems, because CMake doesn't use as described the
filename with .cmake extension. The filename in the Platform folder
has to have the name from CMAKE_SYSTEM_NAME without the extension
.cmake (even the documentation says something different). I checked
this by adding the output of a message("SYSTEM_NAME=Discovery").

The Platform/Discovery file contains the lines:
message("SYSTEM_NAME=Discovery")
set(CMAKE_FORCE_C_COMPILER
"C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")
set(CMAKE_C_COMPILER "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")
set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")
set(CMAKE_FORCE_C_FLAGS "-tPPCVLEEN:simple")
set(CMAKE_FORCE_CXX_COMPILER
"C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")
set(CMAKE_CXX_COMPILER
"C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe")
set(CMAKE_CXX_FLAGS "-tPPCVLEEN:simple")
set(CMAKE_MAKE_PROGRAM
"D:/novero/Discovery/impl/win32/nmake/nmake.exe")

Then I call from the command line the CMake tool with the
parameters:
D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -G "NMake
Makefiles" -D CMAKE_TOOLCHAIN_FILE="..\toolchain_ppc.cmake" ..

The following output will be produced:
* snip output * 
Cross Compiling
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
SYSTEM_NAME=Discovery
SYSTEM_NAME=Discovery
-- Check for working C compiler:
C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
System is unknown to cmake, create:
Platform/Discovery to use this system, please send your config file
to cmake@www
.cmake.org so it can be added to cmake
-- Check for working C compiler:
C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe --
broken
CMake Error at C:/Program Files/CMake
2.8/share/cmake-2.8/Modules/CMakeTestCComp
iler.cmake:52 (MESSAGE):
 The C compiler "C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe" is
not able to
 compile a simple test program.

 It fails with the following output:

 Change Dir:
D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMak
eTmp

 Run Build Command:nmake /NOLOGO "cmTryCompileExec\fast"

 nmake -f CMakeFiles\cmTryCompileExec.dir\build.make /nologo
-L
 CMakeFiles\cmTryCompileExec.dir\build

 "C:\Program Files\CMake 2.8\bin\cmake.exe" -E
cmake_progress_report

D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\CMakeFil
es
 1

 Building C object
CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

 C:\WindRiver\diab\5.9.0.0\WIN32\bin\dcc.exe -o
 CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj -c

D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\testCCom
piler.c


 Target Unknown. Use the -t option or set a default target with
dctrl -t

 NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
code
 '0x1'

 Stop.

 NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
code
 '0x2'

 Stop.

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


-- Configuring incomplete, errors occurred!
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_CXX_COMPILER= cl

-- Generating done
-- Build files have been written to:
D:/novero/Discovery/impl/target/CarIF_Appl/
output

* snap output * 

1.) with the output SYSTEM_NAME=Discovery I can see that the
platform file is used
2.) the compilation doesn't complete, because the CMAKE_C_FLAGS are
still not used
3.) why do I have to have a CXX (C++) compiler, even if I don't need
it in my embedded solution
4.) is there any reason why CMake needs to know my system? I want
just to compile some files... (wondering)


On 19.09.11 15:46, Eric Noulard wrote:

  2011/9/19 Martin Kupke martin.ku...@novero.com

  

My problem 

Re: [CMake] Determining IntDir property for Visual Studio 10

2011-09-19 Thread Perry Ismangil
On Mon, Sep 19, 2011 at 15:36, David Cole david.c...@kitware.com wrote:

  http://cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:ARCHIVE_OUTPUT_DIRECTORY
  http://cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:LIBRARY_OUTPUT_DIRECTORY
  http://cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:RUNTIME_OUTPUT_DIRECTORY

 See also the _CONFIG variants to specify per-configuration output 
 directories.

Yup, got this bit working just fine.

 You cannot change IntDir, but you can use ${CMAKE_CFG_INTDIR} in
 custom commands if necessary, to direct custom output to the same
 location as build output.

Thanks for the confirmation.

Regards,

-- 
Perry Ismangil
___
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] User generated header file

2011-09-19 Thread Perry Ismangil
On Mon, Sep 19, 2011 at 12:47, Eric Noulard eric.noul...@gmail.com wrote:

 The fact is it works the way you want, which is good, but beside that
 why would it be better for the user to face a failing build (because
 he forgot to create the file)
 than
 face a failing CMake run (because he forgot to create the file)?

This is because for now, we are going to supply pre-made VS solution
files instead of geting developers running CMake on their Windows
machine. That is, we'll run CMake to generate VS 10 files and ship
that.

So we're using CMake just as a VS10 generator at release time.

Probably later on we'll decide if we just ship CMakeLists and get the
developers to run CMake generators themselves. If they do, then yes we
can generate this header on the fly like the configure/Makefile-based
system we use now on the Unix platforms.

Thanks for the suggestions, much appreciated.

Regards,

-- 
Perry Ismangil
___
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] User generated header file

2011-09-19 Thread Perry Ismangil
On Mon, Sep 19, 2011 at 14:13, John Drescher dresche...@gmail.com wrote:
 My question is can't you have CMake generate the header for the user
 instead of them supplying a file? Is it just defines in this header?


It's basically user/site-specific defines that is based on user
preferences and availability of libraries/devices on their Windows
platform. At the moment for Windows Visual Studio users we force them
to do this manually.

Thanks.

-- 
Perry Ismangil
___
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] Where to declare the CMAKE_C_FLAGS for cross compiling

2011-09-19 Thread Martin Kupke
I'm using a toolchain file with the CMAKE_SYSTEM_NAME Generic, because 
I want to cross compile on a Windows XP machine for a PPC (PowerPC) 
processor. From my point of view it should be in a way as in the 
documentation for the SDCC.

My toolchain file toolchain_ppc.cmake is setup:
#
set(CMAKE_SYSTEM_NAME Generic)

if(CMAKE_CROSSCOMPILING)
message(Cross Compiling)
endif(CMAKE_CROSSCOMPILING)

# which compilers to use for C and C++
set(CMAKE_C_COMPILER dcc.exe)
set(CMAKE_FIND_ROOT_PATH C:/WindRiver/diab/5.9.0.0/WIN32/bin)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_C_FLAGS -tPPCVLEEN:simple)
#

Additionally in the Platform folder I created a Generic-dcc file for 
system specific options:

#
MESSAGE(SYSTEM_NAME=Generic)
set(CMAKE_C_FLAGS -tPPCVLEEN:simple)
#

In the windows console I call the CMake tool in an empty output folder:
D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -G NMake 
Makefiles -D CMAKE_TOOLCHAIN_FILE=..\toolchain_ppc.cmake ..


The output of the CMake process shows that the test compilation could 
not be performed and the reason for that is, that my CMAKE_C_FLAGS are 
not passed to the configured compiler dcc.exe.

#
Cross Compiling
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
SYSTEM_NAME=Generic
-- Check for working C compiler: c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
-- Check for working C compiler: 
c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe --broken
CMake Error at C:/Program Files/CMake 
2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe is not 
able to compile a simple test program.


  It fails with the following output:
   Change Dir: 
D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMakeTmp

  Run Build Command:nmake /NOLOGO cmTryCompileExec\fast
nmake -f CMakeFiles\cmTryCompileExec.dir\build.make /nologo -L
  CMakeFiles\cmTryCompileExec.dir\build

C:\Program Files\CMake 2.8\bin\cmake.exe -E 
cmake_progress_report  
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\CMakeFiles  
1


  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

(LOOK_HERE)-c:\WindRiver\diab\5.9.0.0\WIN32\bin\dcc.exe -o  
CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj -c  
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\testCCompiler.c


  Target Unknown.  Use the -t option or set a default target with dctrl -t

  NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return 
code  '0x1'

  Stop.

  NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return 
code  '0x2'

  Stop.

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

CMake Error: your CXX compiler: cl was not found.   Please set 
CMAKE_CXX_COMPILER to a valid compiler path or name.

-- Configuring incomplete, errors occurred!
#

I marked the position in the output with (LOOK_HERE)- where you can see 
that the necessary compile flags  CMAKE_C_FLAGS -tPPCVLEEN:simple have 
not been passed to the compiler. Where do I have to declare the 
CMAKE_C_FLAGS?



___
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] User generated header file

2011-09-19 Thread John Drescher
 On Mon, Sep 19, 2011 at 14:13, John Drescher dresche...@gmail.com wrote:
 My question is can't you have CMake generate the header for the user
 instead of them supplying a file? Is it just defines in this header?


 It's basically user/site-specific defines that is based on user
 preferences and availability of libraries/devices on their Windows
 platform. At the moment for Windows Visual Studio users we force them
 to do this manually.


To me this sounds like something that would be perfect to do with
CMake options and some usage of find_libraray, maybe some environment
variables to help out. However I do not mean to tell you how to
configure your software..

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] providing your own exp file on AIX

2011-09-19 Thread Michael Hertling
On 09/14/2011 04:38 PM, Domen Vrankar wrote:
 Hi,
 
 I'm trying to use my own exp file for linking of a shared library on AIX.
 Currently CMake generates an objects.exp file and I don't know how to
 replace it with my own that was used in Makefile files before I switched to
 CMake and contains less entries than the generated one.
 
 Is there a way to use my own exp file without changing the code of cmake?
 
 I'm using cmake 2.8.5 and xlC_r compiler.
 
 Thanks,
 Domen

If you can get along with Makefiles, you might use one of the
RULE_LAUNCH_LINK properties in order to perform last-minute
modifications of the linker command line; see [1] for an
example how to tweak command lines in this way.

Regards,

Michael

[1] http://www.mail-archive.com/cmake@cmake.org/msg38085.html
___
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] User generated header file

2011-09-19 Thread Michael Jackson


On Sep 19, 2011, at 11:58 AM, Perry Ismangil wrote:

 On Mon, Sep 19, 2011 at 12:47, Eric Noulard eric.noul...@gmail.com wrote:
 
 The fact is it works the way you want, which is good, but beside that
 why would it be better for the user to face a failing build (because
 he forgot to create the file)
 than
 face a failing CMake run (because he forgot to create the file)?
 
 This is because for now, we are going to supply pre-made VS solution
 files instead of geting developers running CMake on their Windows
 machine. That is, we'll run CMake to generate VS 10 files and ship
 that.
 
 So we're using CMake just as a VS10 generator at release time.
 
 Probably later on we'll decide if we just ship CMakeLists and get the
 developers to run CMake generators themselves. If they do, then yes we
 can generate this header on the fly like the configure/Makefile-based
 system we use now on the Unix platforms.
 
 Thanks for the suggestions, much appreciated.
 
 Regards,
 
 -- 
 Perry Ismangil

Aren't the Generated VS10 Solutions _still_ dependent on CMake or has that 
changed? 
___
Mike Jackson  www.bluequartz.net
Principal Software Engineer   mike.jack...@bluequartz.net 
BlueQuartz Software   Dayton, Ohio

___
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] User generated header file

2011-09-19 Thread Perry Ismangil
On Mon, Sep 19, 2011 at 17:04, John Drescher dresche...@gmail.com wrote:
 To me this sounds like something that would be perfect to do with
 CMake options and some usage of find_libraray, maybe some environment
 variables to help out. However I do not mean to tell you how to
 configure your software..

I agree. We already generate the header file on 'configure' systems.
And of course if we migrate totally to CMake for all platforms we can
even get rid of configure alltogether.

It's just we're not quite ready yet to tell our Visual Studio
developers they need to run CMake to get the project files, which have
been so far over the years handed to them ready to build :)


-- 
Perry Ismangil
___
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] User generated header file

2011-09-19 Thread Perry Ismangil
On Mon, Sep 19, 2011 at 17:26, Michael Jackson
mike.jack...@bluequartz.net wrote:

 Aren't the Generated VS10 Solutions _still_ dependent on CMake or has that 
 changed?

Not that I can see on CMake 2.8.5, so far I suppressed generating the
ZERO_CHECK target which automatically re-runs CMake if it detects
relevant changes.

The resulting sln and vcxproj files seems only dependent on VS 10.

-- 
Perry Ismangil
___
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] Specify the link command in CMake

2011-09-19 Thread Michael Hertling
On 09/13/2011 11:01 AM, Federico Carminati wrote:
 Hello Eric,
sorry for not having changed the subject, I realize it only now. Thanks 
 for your answer. I am trying to use clang / clang++. This works if I do 
 
 cmake $MY_SOURCE_DIRECTORY  -DCMAKE_C_COMPILER=clang  
 -DCMAKE_CXX_COMPILER=clang++ 
 
 however CMake decides to use clang / clang++ as linker, and I need plain ld. 
 However I am fine with all other flags and arguments. I would just like to 
 have ld as linker command and not clang / clang++. I tried adding
 
  -DCMAKE_C_LINK_EXECUTABLE=ld \
  -DCMAKE_CXX_LINK_EXECUTABLE=ld
 
 with the result that the whole linker command is now just what I specify as 
 argument to CMAKE_LANG_LINK_EXECUTABLE, I do not even have the executable, 
 object files and libraries any more. Thanks for help and best regards, 
 
 Federico Carminati
 CERN-PH 
 1211 Geneva 23
 Switzerland
 Tel: +41 22 76 74959
 Fax: +41 22 76 68505
 Mobile: +41 76 487 4843

If you just want to replace clang/clang++ with ld in the linker command
line and if you can get along with Makefiles, you might use one of the
RULE_LAUNCH_LINK properties in order to perform a suitable last-minute
modification of the linker command line; see [1] for an example how to
tweak command lines in this way. BTW, CMAKE_LANG_LINK_EXECUTABLE is
a *rule* variable, i.e. it specifies the entire linker command line
including flags and object files, not just the linker executable.

Regards,

Michael

[1] http://www.mail-archive.com/cmake@cmake.org/msg38085.html

 On 13 Sep 2011, at 10:56, Eric Noulard wrote:
 
 2011/9/13 Federico Carminati federico.carmin...@cern.ch:
 Dear All,
   is there a way to specify the link command in CMake? If I specify

 export LD=/usr/bin/ld ; cmake $MY_SOURCE_DIRECTORY

 it is not taken and if I set

 I dont' know if LD env var is supposed to be used at all.

 cmake $MY_SOURCE_DIRECTORY \
 -DCMAKE_C_LINK_EXECUTABLE=ld \
 -DCMAKE_CXX_LINK_EXECUTABLE=ld

 what I observe is that the entire link command is replaced by just ld. 
 Am I missing something?

 What are you trying to do?
 Replacing the linker application while keeping the option of the one
 CMake would have chosen?
 Seems weird, if you change linker may be you should specify linker
 option as well, no?

 This looks like incomplete cross compiling (see
 http://www.cmake.org/Wiki/CMake_Cross_Compiling)
 or unsupported compiler use.

 May be you can explain us what you are trying to do.
 and please do not hijack unrelated thread for asking new question.

 -- 
 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] Where to declare the CMAKE_C_FLAGS for cross compiling

2011-09-19 Thread Martin Kupke

  
  
For cross compiling I need to set the variables "CMAKE_C_FLAGS_INIT"
and "CMAKE_CXX_FLAGS_INIT" in the Platform Generic-dcc file.
Not sure why I need to configure CXX compiler and flags, even I
don't use them...but that's another story.

Now the CMake tool passes and finished without any errors, but the
created Makefile for "NMake Makefiles" Generator can't compile my
source file.
### output of NMake ###
D:\novero\Discovery\impl\target\CarIF_Appl\outputnmake

Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
code '0x1'
Stop.
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return
code '0x2'
Stop.
### output of NMake ###

I assume that there is a problem with blanks in the path name,
because of the output "'C:\Program' is not recognized as an internal
or external command,". I guess it would be something like
"C:\Program Files\" and the blank / space character confuses the
build process.

Any ideas to blanks / spaces in files and foldernames?

Thanks
Martin...

On 19.09.11 18:04, Martin Kupke wrote:

  I'm using a toolchain file with the CMAKE_SYSTEM_NAME "Generic", because 
I want to cross compile on a Windows XP machine for a PPC (PowerPC) 
processor. From my point of view it should be in a way as in the 
documentation for the SDCC.
My toolchain file "toolchain_ppc.cmake" is setup:
#
set(CMAKE_SYSTEM_NAME "Generic")

if(CMAKE_CROSSCOMPILING)
message("Cross Compiling")
endif(CMAKE_CROSSCOMPILING)

# which compilers to use for C and C++
set(CMAKE_C_COMPILER "dcc.exe")
set(CMAKE_FIND_ROOT_PATH "C:/WindRiver/diab/5.9.0.0/WIN32/bin")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")
#

Additionally in the Platform folder I created a Generic-dcc file for 
system specific options:
#
MESSAGE("SYSTEM_NAME=Generic")
set(CMAKE_C_FLAGS "-tPPCVLEEN:simple")
#

In the windows console I call the CMake tool in an empty output folder:
D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -G "NMake 
Makefiles" -D CMAKE_TOOLCHAIN_FILE="..\toolchain_ppc.cmake" ..

The output of the CMake process shows that the test compilation could 
not be performed and the reason for that is, that my CMAKE_C_FLAGS are 
not passed to the configured compiler dcc.exe.
#
Cross Compiling
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
SYSTEM_NAME=Generic
-- Check for working C compiler: c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe
-- Check for working C compiler: 
c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe --broken
CMake Error at C:/Program Files/CMake 
2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
   The C compiler "c:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe" is not 
able to compile a simple test program.

   It fails with the following output:
Change Dir: 
D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMakeTmp
   Run Build Command:nmake /NOLOGO "cmTryCompileExec\fast"
 nmake -f CMakeFiles\cmTryCompileExec.dir\build.make /nologo -L
   CMakeFiles\cmTryCompileExec.dir\build

 "C:\Program Files\CMake 2.8\bin\cmake.exe" -E 
cmake_progress_report  
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\CMakeFiles  
1

   Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

(LOOK_HERE)-c:\WindRiver\diab\5.9.0.0\WIN32\bin\dcc.exe -o  
CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj -c  
D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\testCCompiler.c

   Target Unknown.  Use the -t option or set a default target with dctrl -t

   NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return 
code  '0x1'
   Stop.

   NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return 
code  '0x2'
   Stop.

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

CMake Error: your CXX compiler: "cl" was not found.   Please set 
CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!
#

I marked the position in the output with (LOOK_HERE)- where 

[CMake] How to setup toolchain correctly for C compiler only (no CXX present for target)

2011-09-19 Thread Martin Kupke
Is there a way to setup the toolchain file in a way to work only with a 
C compiler?

What if no C++ compiler is present (or wanted) for the target HW?
E.g. we use standard C compiler for different processors on our embedded 
solutions. We need to buy the compiler for C and / or C++, but mostly we 
only develop in C and therewith we don't buy the C++ licence. While 
configuring my build environment with CMake the first time the 
CMakeTestCCompiler and even the CMakeTestCXXCompiler used.

I wasn't able to suppress the CXX part. Is there any option to do this?

___
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 setup toolchain correctly for C compiler only (no CXX present for target)

2011-09-19 Thread Rolf Eike Beer
Am Montag, 19. September 2011, 18:58:49 schrieb Martin Kupke:
 Is there a way to setup the toolchain file in a way to work only with a
 C compiler?
 What if no C++ compiler is present (or wanted) for the target HW?
 E.g. we use standard C compiler for different processors on our embedded
 solutions. We need to buy the compiler for C and / or C++, but mostly we
 only develop in C and therewith we don't buy the C++ licence. While
 configuring my build environment with CMake the first time the
 CMakeTestCCompiler and even the CMakeTestCXXCompiler used.
 I wasn't able to suppress the CXX part. Is there any option to do this?

PROJECT(something C)

The default is C CXX, therefore it scans for the C++ compiler, too.

Eike

signature.asc
Description: This is a digitally signed message part.
___
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] Fwd: How to setup toolchain correctly for C compiler only (no CXX present for target)

2011-09-19 Thread Bjørn Forsman
Forgot to CC list...


-- Forwarded message --
From: Bjørn Forsman bjorn.fors...@gmail.com
Date: 2011/9/19
Subject: Re: [CMake] How to setup toolchain correctly for C compiler
only (no CXX present for target)
To: Martin Kupke martin.ku...@novero.com


On 19 September 2011 18:58, Martin Kupke martin.ku...@novero.com wrote:
 Is there a way to setup the toolchain file in a way to work only with a C
 compiler?

Maybe (I don't know), but you can easily do it in the CMakeLists.txt
file of your project:

project(myproject C)

Since the source code dictates what compiler it must be built with, I think
you actually want to define it like above, and not in the toolchain
file (which can
be used with C *and* C++ projects).

Best regards,
Bjørn Forsman
___
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] Second post: find_package with config file always set xyz_FOUND to true?

2011-09-19 Thread Anton Deguet
Hello,

I haven't heard anything following my previous post.  Is there any chance 
someone could provide some guidance?

Sincerely,

Anton

On Aug 29, 2011, at 6:02 PM, Anton Deguet wrote:

 Hello,
 
 I am trying to use the following syntax:
 find_package (xyz REQUIRED xyz1 xyz2) using a config file, i.e. NOT 
 Findxyz.cmake.
 
 I have a file named xyz-config.cmake that contains some code to check if the 
 required components are available or not (based on how xyz was compiled).  
 Ideally I would like the find_package command to set xyz_FOUND to false if:
 - xyz-config.cmake file is not found (that's working by default)
 OR
 - xyz-config.cmake file is found BUT one or more component is missing
 
 In my xyz-config.cmake, I tried:
 - set (xyz_FOUND FALSE)  # overall package not found as required
 - set (xyz2_FOUND FALSE)  # component not found, hoping find_package would 
 compare this to the list xyz_FIND_COMPONENTS
 
 But in all cases, it seems that find_package resets xyz_FOUND to 1 as long as 
 the file xyz-config.cmake is found.  Is there a way to set xyz_FOUND to 0 
 within xyz-config.cmake?
 
 Anton
 
 

___
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] Second post: find_package with config file always set xyz_FOUND to true?

2011-09-19 Thread Michael Hertling
On 09/19/2011 07:09 PM, Anton Deguet wrote:
 Hello,
 
 I haven't heard anything following my previous post.  Is there any chance 
 someone could provide some guidance?
 
 Sincerely,
 
 Anton
 
 On Aug 29, 2011, at 6:02 PM, Anton Deguet wrote:
 
 Hello,

 I am trying to use the following syntax:
 find_package (xyz REQUIRED xyz1 xyz2) using a config file, i.e. NOT 
 Findxyz.cmake.

 I have a file named xyz-config.cmake that contains some code to check if the 
 required components are available or not (based on how xyz was compiled).  
 Ideally I would like the find_package command to set xyz_FOUND to false if:
 - xyz-config.cmake file is not found (that's working by default)
 OR
 - xyz-config.cmake file is found BUT one or more component is missing

 In my xyz-config.cmake, I tried:
 - set (xyz_FOUND FALSE)  # overall package not found as required
 - set (xyz2_FOUND FALSE)  # component not found, hoping find_package would 
 compare this to the list xyz_FIND_COMPONENTS

 But in all cases, it seems that find_package resets xyz_FOUND to 1 as long 
 as the file xyz-config.cmake is found.  Is there a way to set xyz_FOUND to 0 
 within xyz-config.cmake?

 Anton

Second try: http://www.mail-archive.com/cmake@cmake.org/msg37840.html

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] Second post: find_package with config file always set xyz_FOUND to true?

2011-09-19 Thread Anton Deguet
Hi Michael,

Sorry, I mistakenly trashed your previous answer, thank you for both replies.

It looks like I am not the first one to raise that question.  If I understand 
well, the primary issue is to agree on the semantic of:

find_package (xyz COMPONENTS c1 c2)
if (xyz_FOUND) …

xyz_FOUND can mean:
- xyz has been found and since you asked for components c1 and c2, please check 
the variables xyz_c1_FOUND and xyz_c2_FOUND to see if these components are 
available
- xyz has been found along with c1 and c2

I would personally prefer the second approach as it makes it easy to test if 
everything has been found as required.  Maybe there is yet another variable to 
indicate that all components have been found, say xyz_FOUND_AS_REQUIRED.  That 
would allow users to write simpler code:

if (xyz_FOUND AND xyz_c1_FOUND AND xyz_c2_FOUND)

would become:

if (xyz_FOUND_AS_REQUIRED)

Ultimately I will stick to the recommended approach.


The second aspect of the issue (and this is what I initially encountered) is 
the different behavior of find_package for either a module find or a config 
file.  I wrote a CMake file/scripts that sets xyz_FOUND and used it for both 
cases, i.e. installed it as either Findxyz.cmake or xyz-config.cmake.  It was a 
bit disconcerting to have my xyz_FOUND variable overwritten in one case and not 
the other.  I understand that this is strongly tied to the defined/accepted 
meaning of xyz_FOUND and I was apparently mis-using it.  But ... maybe … the 
find_package could be slightly modified:
- send a warning to the user (developer message) if the variable xyz_FOUND is 
modified/set by the file xyz-config.cmake
- more subtle and might have implications I don't foresee, if after loading the 
file xyz-config.cmake find_package realizes that xyz_FOUND has been set, let it 
as is.  That would allow me to keep using xyz_FOUND incorrectly :-)

Again, thank you for your answer.

Anton


On Sep 19, 2011, at 2:21 PM, Michael Hertling wrote:

 On 09/19/2011 07:09 PM, Anton Deguet wrote:
 Hello,
 
 I haven't heard anything following my previous post.  Is there any chance 
 someone could provide some guidance?
 
 Sincerely,
 
 Anton
 
 On Aug 29, 2011, at 6:02 PM, Anton Deguet wrote:
 
 Hello,
 
 I am trying to use the following syntax:
 find_package (xyz REQUIRED xyz1 xyz2) using a config file, i.e. NOT 
 Findxyz.cmake.
 
 I have a file named xyz-config.cmake that contains some code to check if 
 the required components are available or not (based on how xyz was 
 compiled).  Ideally I would like the find_package command to set xyz_FOUND 
 to false if:
 - xyz-config.cmake file is not found (that's working by default)
 OR
 - xyz-config.cmake file is found BUT one or more component is missing
 
 In my xyz-config.cmake, I tried:
 - set (xyz_FOUND FALSE)  # overall package not found as required
 - set (xyz2_FOUND FALSE)  # component not found, hoping find_package would 
 compare this to the list xyz_FIND_COMPONENTS
 
 But in all cases, it seems that find_package resets xyz_FOUND to 1 as long 
 as the file xyz-config.cmake is found.  Is there a way to set xyz_FOUND to 
 0 within xyz-config.cmake?
 
 Anton
 
 Second try: http://www.mail-archive.com/cmake@cmake.org/msg37840.html
 
 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

___
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] linker default library path /usr/local/lib on OSX

2011-09-19 Thread amine bezzarga
Yeah, I tried the NO_DEFAULT_PATH option but without success.
My target_link_library command look like this:

target_link_libraries(${CMAKE_PROJECT_NAME} ${OGRE_LIBRARIES}
${OGRE_PLUGIN_LIBRARIES} ${Boost_LIBRARIES} ${OIS_LIBRARIES}
${IrrKlang_LIBRARIES})

Here is the otool output of the sound library:
$ otool -L
./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib
./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib
(architecture ppc):
 /usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current
version 1.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
(compatibility version 1.0.0, current version 1.0.0)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
1.0.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
88.3.3)
./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib
(architecture i386):
 /usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current
version 1.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
(compatibility version 1.0.0, current version 1.0.0)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
1.0.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
88.3.3)

Does it help ?


On Mon, Sep 19, 2011 at 1:56 PM, Michael Jackson 
mike.jack...@bluequartz.net wrote:

 My guess is that the audio library has an install path of /usr/local/lib
 encoded in it. Try posting tue output of otool for the actual audio
 library.

 -
 Mike Jackson http://www.bluequartz.net
 www.bluequartz.net
 Principal Software Engineer   mike.jack...@bluequartz.net
 mike.jack...@bluequartz.net
 BlueQuartz Software   Dayton, Ohio
 Sent from my mobile device.

 On Sep 18, 2011, at 23:38, Cristobal Navarro axisch...@gmail.com wrote:

 ok i get your point.
 mmm. In others words you need something equivalent to rpath command, im
 pretty sure cmake can handle this easily let me know if the following helps.

 have you tried adding more options to the find_library command ??
 for example have you tried this (also, with the PATHS command just to be
 sure):

 find_library(IrrKlang_LIBRARIES irrKlang
 PATHS
 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc
  NO_DEFAULT_PATH
  )

 And what is your target_link_libraries command?



 On Sun, Sep 18, 2011 at 12:33 PM, amine bezzarga  abezz...@gmail.com
 abezz...@gmail.com wrote:

 The issue is not about finding the library at built time, event if my
 library is found in
 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc 
 and
 after building is done, my app is still looking for the library in
 /usr/local/lib at runtime as you can see with the otools output in my first
 message.

 I want to find a way to tell the linker to link the library from where it
 find it.
 Does it make sense ?

 On Sun, Sep 18, 2011 at 4:29 PM, Cristobal Navarro axisch...@gmail.com
 axisch...@gmail.com wrote:

 yes

 you have to provide another option
 find_library( IrrKlang_LIBRARIES irrKlang PATHS path1 to
 library path2 to library ... )


 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library
 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library

 is this what you need?
 best regards
 Cristobal


 On Sun, Sep 18, 2011 at 10:16 AM, amine bezzarga  abezz...@gmail.com
 abezz...@gmail.com wrote:

 Hello guys,

 I added a sound library to my project, So I first created a cmake module
 to find it

 MESSAGE(STATUS Looking for IrrKlang...)

 find_library(IrrKlang_LIBRARIES irrKlang

 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc
  )

 find_path(IrrKlang_INCLUDE_DIRS irrKlang.h
  ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/include
 )

 IF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)
SET(IrrKlang_FOUND TRUE)
 ENDIF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)


 IF (IrrKlang_FOUND)
IF (NOT IrrKlang_FIND_QUIETLY)
   MESSAGE(STATUS Found IrrKlang: ${IrrKlang_LIBRARIES})
ENDIF (NOT IrrKlang_FIND_QUIETLY)
 ELSE (IrrKlang_FOUND)
IF (IrrKlang_FIND_REQUIRED)
   MESSAGE(FATAL_ERROR Could not find IrrKlang)
ENDIF (IrrKlang_FIND_REQUIRED)
 ENDIF (IrrKlang_FOUND)

 Everything works fine exept I can't control from where the library is
 linked.
 Why after I build my project OSX is looking for that library in
 /usr/local/lib ?
 Is there a way to tell cmake to link the library from where it find it
 i.e 
 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc
 ?

 here is my otool output after building the project
 $ otool -L ./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp
 ./bin/MacOSX/OgreApp.app/Contents/MacOS/OgreApp:
 

Re: [CMake] linker default library path /usr/local/lib on OSX

2011-09-19 Thread Michael Jackson
Yes. Who ever built the irrklang library has set an install_name of
/usr/local/lib on that library. So it does not matter where the library is
located. OS X thinks it is in /usr/local/lib.
You need to fix how that library is compiled and linked. Does that make
it clear what is going on?

-
Mike Jackson www.bluequartz.net
Principal Software Engineer   mike.jack...@bluequartz.net
BlueQuartz Software   Dayton, Ohio
Sent from my mobile device.

On Sep 19, 2011, at 19:56, amine bezzarga abezz...@gmail.com wrote:

Yeah, I tried the NO_DEFAULT_PATH option but without success.
My target_link_library command look like this:

target_link_libraries(${CMAKE_PROJECT_NAME} ${OGRE_LIBRARIES}
${OGRE_PLUGIN_LIBRARIES} ${Boost_LIBRARIES} ${OIS_LIBRARIES}
${IrrKlang_LIBRARIES})

Here is the otool output of the sound library:
$ otool -L
./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib
./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib
(architecture ppc):
 /usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current
version 1.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
(compatibility version 1.0.0, current version 1.0.0)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
1.0.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
88.3.3)
./Dependencies/IrrKLangAudioEngine/bin/macosx-gcc/libirrklang.dylib
(architecture i386):
 /usr/local/lib/libirrklang.dylib (compatibility version 1.0.0, current
version 1.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
(compatibility version 1.0.0, current version 1.0.0)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
1.0.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
88.3.3)

Does it help ?


On Mon, Sep 19, 2011 at 1:56 PM, Michael Jackson 
mike.jack...@bluequartz.net wrote:

 My guess is that the audio library has an install path of /usr/local/lib
 encoded in it. Try posting tue output of otool for the actual audio
 library.

 -
 Mike Jackson http://www.bluequartz.net
 www.bluequartz.net
 Principal Software Engineer   mike.jack...@bluequartz.net
 mike.jack...@bluequartz.net
 BlueQuartz Software   Dayton, Ohio
 Sent from my mobile device.

 On Sep 18, 2011, at 23:38, Cristobal Navarro axisch...@gmail.com wrote:

 ok i get your point.
 mmm. In others words you need something equivalent to rpath command, im
 pretty sure cmake can handle this easily let me know if the following helps.

 have you tried adding more options to the find_library command ??
 for example have you tried this (also, with the PATHS command just to be
 sure):

 find_library(IrrKlang_LIBRARIES irrKlang
 PATHS
 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc
  NO_DEFAULT_PATH
  )

 And what is your target_link_libraries command?



 On Sun, Sep 18, 2011 at 12:33 PM, amine bezzarga  abezz...@gmail.com
 abezz...@gmail.com wrote:

 The issue is not about finding the library at built time, event if my
 library is found in
 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc 
 and
 after building is done, my app is still looking for the library in
 /usr/local/lib at runtime as you can see with the otools output in my first
 message.

 I want to find a way to tell the linker to link the library from where it
 find it.
 Does it make sense ?

 On Sun, Sep 18, 2011 at 4:29 PM, Cristobal Navarro axisch...@gmail.com
 axisch...@gmail.com wrote:

 yes

 you have to provide another option
 find_library( IrrKlang_LIBRARIES irrKlang PATHS path1 to
 library path2 to library ... )


 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library
 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_library

 is this what you need?
 best regards
 Cristobal


 On Sun, Sep 18, 2011 at 10:16 AM, amine bezzarga  abezz...@gmail.com
 abezz...@gmail.com wrote:

 Hello guys,

 I added a sound library to my project, So I first created a cmake module
 to find it

 MESSAGE(STATUS Looking for IrrKlang...)

 find_library(IrrKlang_LIBRARIES irrKlang

 ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/bin/macosx-gcc
  )

 find_path(IrrKlang_INCLUDE_DIRS irrKlang.h
  ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/IrrKLangAudioEngine/include
 )

 IF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)
SET(IrrKlang_FOUND TRUE)
 ENDIF (IrrKlang_INCLUDE_DIRS AND IrrKlang_LIBRARIES)


 IF (IrrKlang_FOUND)
IF (NOT IrrKlang_FIND_QUIETLY)
   MESSAGE(STATUS Found IrrKlang: ${IrrKlang_LIBRARIES})
ENDIF (NOT IrrKlang_FIND_QUIETLY)
 ELSE (IrrKlang_FOUND)
IF (IrrKlang_FIND_REQUIRED)
   MESSAGE(FATAL_ERROR Could not find IrrKlang)
ENDIF 

Re: [CMake] Cross compiling in Win32 environment doesn't work

2011-09-19 Thread Alexander Neundorf
Hi,

can you please adjust your mail client so it doesn't send HTML mails ?

On Monday, September 19, 2011 04:57:32 PM Martin Kupke wrote:
  That's a hint, I changed my toolchain file toolchain_ppc.cmake to the
 following: INCLUDE(CMakeForceCompiler)
  set(CMAKE_SYSTEM_NAME Discovery)
 
  if(CMAKE_CROSSCOMPILING)
  message(Cross Compiling)
  endif(CMAKE_CROSSCOMPILING)
 
  # which compilers to use for C and C++
  set(CMAKE_C_COMPILER C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe)
  set(CMAKE_FORCE_C_COMPILER C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe)
  set(CMAKE_C_FLAGS -tPPCVLEEN:simple)
 
  Then I created a folder with the name Platform containing a file with
 CMAKE_SYSTEM_NAME which is Discovery - at this point I had already
 problems, because CMake doesn't use as described the filename with .cmake
 extension. The filename in the Platform folder has to have the name from
 CMAKE_SYSTEM_NAME without the extension .cmake (even the documentation
 says something different). I checked this by adding the output of a
 message(SYSTEM_NAME=Discovery).

The filename must be Discovery.cmake in your case.
Did you say this didn't work ?
This file must be either in the cmake Modules/Platfom/ directory, or in a 
subdirectory Platform/ of a directory which is in CMAKE_MODULE_PATH.
 
  The Platform/Discovery file contains the lines:
  message(SYSTEM_NAME=Discovery)
  set(CMAKE_FORCE_C_COMPILER C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe)
  set(CMAKE_C_COMPILER C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe)
  set(CMAKE_C_FLAGS -tPPCVLEEN:simple)
  set(CMAKE_FORCE_C_FLAGS -tPPCVLEEN:simple)
  set(CMAKE_FORCE_CXX_COMPILER
 C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe) set(CMAKE_CXX_COMPILER
 C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe) set(CMAKE_CXX_FLAGS
 -tPPCVLEEN:simple)
  set(CMAKE_MAKE_PROGRAM D:/novero/Discovery/impl/win32/nmake/nmake.exe)

That last line should not be necessary.

  Then I call from the command line the CMake tool with the parameters:
  D:\novero\Discovery\impl\target\CarIF_Appl\outputcmake -G NMake
 Makefiles -D CMAKE_TOOLCHAIN_FILE=..\toolchain_ppc.cmake ..
 
  The following output will be produced:
  * snip output *
  Cross Compiling
  -- The C compiler identification is unknown
  -- The CXX compiler identification is unknown
  SYSTEM_NAME=Discovery
  SYSTEM_NAME=Discovery
  -- Check for working C compiler:
 C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe System is unknown to cmake,
 create:
  Platform/Discovery to use this system, please send your config file to
 cmake@www .cmake.org so it can be added to cmake
  -- Check for working C compiler:
 C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe -- broken
  CMake Error at C:/Program Files/CMake
 2.8/share/cmake-2.8/Modules/CMakeTestCComp iler.cmake:52 (MESSAGE):
The C compiler C:/WindRiver/diab/5.9.0.0/WIN32/bin/dcc.exe is not able
 to compile a simple test program.
 
It fails with the following output:
 
 Change Dir:
 D:/novero/Discovery/impl/target/CarIF_Appl/output/CMakeFiles/CMak eTmp
 
Run Build Command:nmake /NOLOGO cmTryCompileExec\fast
 
  nmake -f CMakeFiles\cmTryCompileExec.dir\build.make /nologo -L
CMakeFiles\cmTryCompileExec.dir\build
 
  C:\Program Files\CMake 2.8\bin\cmake.exe -E
 cmake_progress_report
 D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\CMak
 eFil es
1
 
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj
 
  C:\WindRiver\diab\5.9.0.0\WIN32\bin\dcc.exe -o
CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj -c
   
 D:\novero\Discovery\impl\target\CarIF_Appl\output\CMakeFiles\CMakeTmp\test
 CCom piler.c
 
 
Target Unknown.  Use the -t option or set a default target with dctrl -t
 
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code
'0x1'
 
Stop.
 
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code
'0x2'
 
Stop.
 
CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
CMakeLists.txt:2 (project)
 
 
  -- Configuring incomplete, errors occurred!
  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_CXX_COMPILER= cl
 
  -- Generating done
  -- Build files have been written to:
 D:/novero/Discovery/impl/target/CarIF_Appl/ output
 
  * snap output *
 
  1.) with the output SYSTEM_NAME=Discovery I can see that the platform file
 is used 2.) the compilation doesn't complete, because the CMAKE_C_FLAGS
 are still not used 

They are initialized later on.
There is a set of variables which are used for initialization, I think it's 
name is CMAKE_C_FLAGS_INIT .

 3.) why do I have to have a CXX (C++) compiler, even if
 I don't need it in my embedded solution 

By default cmake enables C and C++.
If you put a 
project(MyProject 

[Cmake-commits] CMake branch, next, updated. v2.8.5-1915-gbeb2cd7

2011-09-19 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  beb2cd74fc7de307e76a69c3cc2adc20b7ef248f (commit)
   via  cfc6e01851b58ba61faecbf085d123294e5a78f4 (commit)
  from  49807b451540af0f3c3cf7cf2e20d81b89e4dcbf (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=beb2cd74fc7de307e76a69c3cc2adc20b7ef248f
commit beb2cd74fc7de307e76a69c3cc2adc20b7ef248f
Merge: 49807b4 cfc6e01
Author: Brad King brad.k...@kitware.com
AuthorDate: Mon Sep 19 14:49:42 2011 -0400
Commit: Brad King brad.k...@kitware.com
CommitDate: Mon Sep 19 14:49:42 2011 -0400

Merge branch 'master' into next


---

Summary of changes:
 Source/kwsys/kwsysDateStamp.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


[Cmake-commits] CMake branch, next, updated. v2.8.5-1918-g33e1a63

2011-09-19 Thread Marcus D . Hanwell
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  33e1a63ca1084abf76939f8a4a6bf112d69abcde (commit)
   via  2d1acfe359852836f3096da0d3262d558ee383d3 (commit)
   via  d6795685ae25f1a9d0d7cda02d639ce8b402f9f9 (commit)
  from  beb2cd74fc7de307e76a69c3cc2adc20b7ef248f (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=33e1a63ca1084abf76939f8a4a6bf112d69abcde
commit 33e1a63ca1084abf76939f8a4a6bf112d69abcde
Merge: beb2cd7 2d1acfe
Author: Marcus D. Hanwell marcus.hanw...@kitware.com
AuthorDate: Mon Sep 19 15:21:19 2011 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Mon Sep 19 15:21:19 2011 -0400

Merge topic 'generate-export-header' into next

2d1acfe Don't warn when nothing to do in visibility function.
d679568 Just code style changes.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d1acfe359852836f3096da0d3262d558ee383d3
commit 2d1acfe359852836f3096da0d3262d558ee383d3
Author: Marcus D. Hanwell marcus.hanw...@kitware.com
AuthorDate: Mon Sep 19 14:55:19 2011 -0400
Commit: Marcus D. Hanwell marcus.hanw...@kitware.com
CommitDate: Mon Sep 19 14:55:19 2011 -0400

Don't warn when nothing to do in visibility function.

diff --git a/Modules/GenerateExportHeader.cmake 
b/Modules/GenerateExportHeader.cmake
index e1ce16d..f2eaf8c 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -353,7 +353,7 @@ function(add_compiler_export_flags)
   _test_compiler_has_deprecated()
 
   if(NOT (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY))
-message(WARNING Compiler doesn't have hidden visibility)
+# Just return if there are no flags to add.
 return()
   endif()
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6795685ae25f1a9d0d7cda02d639ce8b402f9f9
commit d6795685ae25f1a9d0d7cda02d639ce8b402f9f9
Author: Marcus D. Hanwell marcus.hanw...@kitware.com
AuthorDate: Mon Sep 19 14:04:42 2011 -0400
Commit: Marcus D. Hanwell marcus.hanw...@kitware.com
CommitDate: Mon Sep 19 14:04:42 2011 -0400

Just code style changes.

diff --git a/Modules/GenerateExportHeader.cmake 
b/Modules/GenerateExportHeader.cmake
index 4eb67b5..e1ce16d 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -25,7 +25,8 @@
 # adds -fvisibility=hidden to CMAKE_CXX_FLAGS if supported, and is a no-op on 
Windows
 # which does not need extra compiler flags for exporting support.
 #
-# This means that in the simplest case, users of these functions will be 
equivalent to:
+# This means that in the simplest case, users of these functions will be
+# equivalent to:
 #
 #   add_compiler_export_flags()
 #   add_library(somelib someclass.cpp)
@@ -43,8 +44,8 @@
 # ...
 #   };
 #
-# The CMake fragment will generate a file in the ${CMAKE_CURRENT_BUILD_DIR} 
called
-# somelib_export.h containing the macros SOMELIB_EXPORT, SOMELIB_NO_EXPORT,
+# The CMake fragment will generate a file in the ${CMAKE_CURRENT_BUILD_DIR}
+# called somelib_export.h containing the macros SOMELIB_EXPORT, 
SOMELIB_NO_EXPORT,
 # SOMELIB_DEPRECATED, SOMELIB_DEPRECATED_EXPORT and 
SOMELIB_DEPRECATED_NO_EXPORT.
 # The resulting file should be installed with other headers in the library.
 #
@@ -86,11 +87,14 @@
 #   add_library(shared_variant SHARED ${lib_SRCS})
 #   add_library(static_variant ${lib_SRCS})
 #   generate_export_header(shared_variant BASE_NAME libshared_and_static)
-#   set_target_properties(static_variant PROPERTIES COMPILE_FLAGS 
-DLIBSHARED_AND_STATIC_STATIC_DEFINE)
+#   set_target_properties(static_variant PROPERTIES
+# COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
 #
-# This will cause the export macros to expand to nothing when building the 
static library.
+# This will cause the export macros to expand to nothing when building the
+# static library.
 #
-# If DEFINE_NO_DEPRECATED is specified, then a macro 
${BASE_NAME}_NO_DEPRECATED will be defined
+# If DEFINE_NO_DEPRECATED is specified, then a macro ${BASE_NAME}_NO_DEPRECATED
+# will be defined
 # This macro can be used to remove deprecated code from preprocessor output.
 #
 #   option(EXCLUDE_DEPRECATED Exclude deprecated parts of the library FALSE)
@@ -122,7 +126,6 @@
 #
 # Generates the macros VTK_SOMELIB_EXPORT etc.
 
-
 #=
 # Copyright 2011 Stephen Kelly steve...@gmail.com
 #
@@ -139,10 +142,10 @@
 include(CMakeParseArguments)
 include(CheckCXXCompilerFlag)
 
-
 # TODO: Install this macro separately?
 macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT)
-  

[Cmake-commits] CMake branch, next, updated. v2.8.5-1924-ge6636f4

2011-09-19 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  e6636f4a232a30837ea242942b4eae0bf9b3b7d7 (commit)
   via  3c61e41deb9d4893e6c32296fe0892be64284ea0 (commit)
  from  2f4df3a7917a16740613e4310a7d41c81a3fbd37 (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=e6636f4a232a30837ea242942b4eae0bf9b3b7d7
commit e6636f4a232a30837ea242942b4eae0bf9b3b7d7
Merge: 2f4df3a 3c61e41
Author: Brad King brad.k...@kitware.com
AuthorDate: Mon Sep 19 17:41:18 2011 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Mon Sep 19 17:41:18 2011 -0400

Merge topic 'file-download-http-error' into next

3c61e41 Check return code from setting curl option in file(DOWNLOAD)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c61e41deb9d4893e6c32296fe0892be64284ea0
commit 3c61e41deb9d4893e6c32296fe0892be64284ea0
Author: Brad King brad.k...@kitware.com
AuthorDate: Mon Sep 19 17:38:51 2011 -0400
Commit: Brad King brad.k...@kitware.com
CommitDate: Mon Sep 19 17:38:51 2011 -0400

Check return code from setting curl option in file(DOWNLOAD)

diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 15ebc60..f933666 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2755,6 +2755,7 @@ 
cmFileCommand::HandleDownloadCommand(std::vectorstd::string const args)
 
   // enable HTTP ERROR parsing
   res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
+  check_curl_result(res, DOWNLOAD cannot set http failure option: );
 
   res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
cmWriteToFileCallback);

---

Summary of changes:
 Source/cmFileCommand.cxx |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


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