Re: [CMake] CMake with cminpack, link libraries

2011-11-26 Thread Michael Hertling
On 11/25/2011 05:02 PM, Fabian Torres wrote:
> Hi
> 
> I'm trying to use cminpack. I've downloaded cminpack 1.1.3 and configure it
> with cmake to create a Xcode 3.2 project. After building the xcode project
> successfully I found that it generates a debug directory which contains the
> library or if the shared_libs option in cmake was on or off respectively.
> The examples works fine.
> 
> Know I'm creating an Xcode project with Cmake in which I'm going to use the
> cminpack function lmdif1 I attach the CMakelist.txt which I'm using. I have
> no problems in generating the xcode project with CMake, but when I build
> the project I get the next errors
> 
> "_dpmpar", referenced from _main ProbeClaibration.o
> "_lmdif1", referenced from _main ProbeCalibration.o
> 
> Symbol(s) not found
> 
> After some research I found that it may be a problem linking the cminpack
> library.I'm new using CMake and I'm not sure if I`m using the correct
> method to link the cminpack libraries with
> LINK_DIRECTORIES(/opt/cminpack-binary).

No, you don't. LINK_DIRECTORIES() just provides the linker with a
hint where it should look for libraries, but it neither specifies
the actual libraries to link against nor performs any link action
by itself. Instead, you need to mention the CMinpack library in
TARGET_LINK_LIBRARIES() as you do with the VTK/ITK ones.

However, you shouldn't use LINK_DIRECTORIES() at all, see [1,2].
Instead, use FIND_LIBRARY(CMinpack_LIBRARY cminpack), so you can
give CMake a hint where to search via CMAKE_PREFIX_PATH et al. or
preset CMinpack_LIBRARY on the command line or the GUI. If you're
just doing so, do the same for the include directories, too, e.g.

FIND_PATH(CMinpack_INCLUDE_DIR cminpack.h PATH_SUFFIXES cminpack-1)
INCLUDE_DIRECTORIES(${CMinpack_INCLUDE_DIR})

and because you're just doing so - ;-) - combine these actions in a
FindCMinpack.cmake module to use with FIND_PACKAGE(), see [3] for
more information.

Anyway, since CMinpack can already be built by means of CMake, the
premier solution is, IMO, to ask the CMinpack people to provide a
configuration file cminpack-config.cmake or the like. The latter
would be installed along with the other files of the package, so
using CMinpack in an own project would roughly read as follows:

FIND_PACKAGE(CMinpack REQUIRED)
ADD_DEFINITIONS(${CMinpack_DEFINITIONS})
INCLUDE_DIRECTORIES(${CMinpack_INCLUDE_DIRS})
...
TARGET_LINK_LIBRARIES(... ${CMinpack_LIBRARIES})

> I wonder if you can help me figure it out. And also want to know which
> library do you recomend mi to use, the static libcminpack.a lib or the
> dynamic libcminpack.dlyb lib.

Usually, one prefers shared libraries unless one has a reason to choose
the static ones. FIND_LIBRARY() also prefers shared to static libraries
if it's not told otherwise, e.g. as FIND_LIBRARY(... libcminpack.a).

> Thanks for your help. I`m really stuck on this and I need to solve my
> problem as soon as possible.

'hope that helps, and feel free to ask anew if things still don't work.

Regards,

Michael

[1] http://www.mail-archive.com/cmake@cmake.org/msg33482.html
[2] http://www.mail-archive.com/cmake@cmake.org/msg39264.html
[3] ${CMAKE_ROOT}/Modules/readme.txt
--

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] [CPACK] Patch with componentwise extra install commands for NSIS-generator

2011-11-26 Thread Marcel

On 26.11.2011 20:20, Eric Noulard wrote:

Open a bug report in the tracker
http://public.kitware.com/Bug/my_view_page.php
and attach the patch to the report.


Done. Thanks.

Marcel
--

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] [CPACK] Patch with componentwise extra install commands for NSIS-generator

2011-11-26 Thread Eric Noulard
2011/11/26 Marcel :
> Hi,
>
> I extended cpack's NSIS-generator and want to contribute the attached patch.
>
> It adds the CPACK_COMPONENT__EXTRA_INSTALL_COMMANDS option to cpack
> that allows to add NSIS commands exclusivly to the install section generated
> for the component . So it adopts the option
> CPACK_NSIS_EXTRA_INSTALL_COMMANDS for single components/sections.
>
> That way special code can be added to a section that ist only executed if
> the user chooses to install the section.
>
> Perhaps this change could be merged into the cmake, because I think this
> could be of some use for other cpack users.
>
> If this is not the right place to contribute, could someone please give me a
> pointer.

Open a bug report in the tracker
http://public.kitware.com/Bug/my_view_page.php
and attach the patch to the report.


>
> Best regards,
>
> Marcel
>
>
> --
>
> 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] BUILD_COMMAND having a hard time getting usable command lines

2011-11-26 Thread J Decker
Earlier I wondered if there was a way to stop recusive invocation of a
build command in a cmake script - I found something like a solution;
when I run the command, set an environment variable and don't run the
command if that environment variable is set... But...

If I specify 'TARGET' in BUILD_COMMAND, then it gets extra quotes
around it, which make it impossible to pass to execute_process.  Also
why doesn't cmake-gui run certain commands?

--example - probably incomplete ---

PROJECT( whatever )
  build_command( GENERATOR_BUILD_COMMAND CONFIGURATION
${CMAKE_BUILD_TYPE} PROJECT_NAME ${PROJECT_NAME} TARGET all )
  message( "build command:${GENERATOR_BUILD_COMMAND}" )

- output  ---

build command:e:/tools/unix/mingw/bin/mingw32-make.exe -i "all"
mingw32-make.exe: *** No rule to make target `"all"'.  Stop.

---end output, begin explanation

In order to get BUILD_COMMAND output to work at all I have to

STRING( REPLACE "\ " ";" GENERATOR_BUILD_COMMAND
${GENERATOR_BUILD_COMMAND} )

which replaces the spaces in the command with semicolons, so it looks
like seperate commands for

  EXECUTE_PROCESS(COMMAND ${GENERATOR_BUILD_COMMAND}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )

 and in cmake-gui the output looks something like

---
build command:e:/tools/unix/mingw/bin/mingw32-make.exe -i "all"
Executing command... (output just before Execute_process)
Configuring done
---
  but the command is never actually executed?  I go out to a command
line and type cmake . and the build goes.
--

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] Build doesn't work with Mac OS X Lion...

2011-11-26 Thread David Cole
Are you using CMake 2.8.6...? Older CMake versions have not been used
much on Lion. It wouldn't surprise me if 2.8.6 works, but earlier
versions have issues...


HTH,
David


On Sat, Nov 26, 2011 at 6:37 AM, Daniel Dekkers  wrote:
> This:
>
> SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
> seems to result in a "standard" Xcode setting (armv7 (standard)) which is 
> also set when you let Xcode create a fresh iOS app (from its own templates).
>
> But you also see this a lot on the fora:
> SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)")
>
> Not sure.
>
> On Nov 26, 2011, at 4:38 AM, Michael Jackson wrote:
>
>> There is a cmake variable that you set during  onfiguration time.
>> Something like os_x_architectures. There you can add the specific arch
>> that you want to build for.
>>
>> -
>> Mike Jackson                     www.bluequartz.net
>> Principal Software Engineer       mike.jack...@bluequartz.net
>> BlueQuartz Software               Dayton, Ohio
>> 
>> Sent from my mobile device. Please excuse the shortness of the reply.
>>
>> On Nov 25, 2011, at 14:47, Dick Munroe  wrote:
>>
>>> I've got a build that works just fine with Leopard.
>>>
>>> For reasons I won't get into, I had to upgrade one of my systems to Lion 
>>> and now (I've installed XCode 4.2) the build won't work.  I get the 
>>> following error:
>>>
>>> [  0%] Reaping winning child 0x10260c510 PID 1009
>>> Live child 0x10260c510 
>>> (libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o)
>>>  PID 1010
>>> Building CXX object 
>>> libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o
>>> Reaping winning child 0x10260c510 PID 1010
>>> Live child 0x10260c510 
>>> (libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o)
>>>  PID 1011
>>> llvm-g++-4.2: Invalid arch name : -O2
>>> Reaping losing child 0x10260c510 PID 1011
>>> make[2]: *** 
>>> [libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o]
>>>  Error 1
>>> Removing child 0x10260c510 PID 1011 from chain.
>>> Reaping losing child 0x10c20c290 PID 1008
>>> make[1]: *** [libxp/CMakeFiles/xp.dir/all] Error 2
>>> Removing child 0x10c20c290 PID 1008 from chain.
>>> Reaping losing child 0x10940e730 PID 996
>>>
>>> If I dig around, I find the CXX flags to be:
>>>
>>> -arch  -O2 -fPIC
>>>
>>> and for some reason the Lion g++ compiler is choking thinking that there 
>>> should be and arch value.  Which if I dig around in the Leopard build I 
>>> find:
>>>
>>> -Dxp_EXPORTS  -arch i386 -O2 -g -fPIC
>>>
>>> Which brings up the questions, (1) with the same CMakeLists.txt file, why 
>>> am I getting different values and (2) how do I get the arch to be i386 on 
>>> the Lion build.
>>>
>>> Best,
>>>
>>> Dick Munroe
>>>
>>> --
>>>
>>> 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 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] iOS Archiving (Xcode 4.2, Lion, CMake2.8-6)

2011-11-26 Thread David Cole
Really?
The only error output is:

  "Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++
failed with exit code 1"

?? How are we supposed to figure out what's wrong with the
archiving step with that?

What are the Xcode project file differences between a CMake-generated
project that demonstrates this problem, and an Xcode generated project
that does not...? Can you reduce it down to a simplest case that's
easy to analyze?


Thx,
David


On Fri, Nov 25, 2011 at 12:30 PM, Daniel Dekkers  wrote:
> Hi,
>
> Has anyone managed to perform a successful iOS Archiving pass yet?
>
> Our apps run on the simulator (both iPhone (5.0) and iPad (5.0)) and on the 
> actual devices iPhone 3GS (5.0.1) and iPad2 (5.0.1), but archiving always 
> gives a link error:
>
> Ld 
> /Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/InstallationBuildProductsLocation/Application/Discs.app/Discs
>  normal armv7
>    cd /Users/danieldekkers/development
>    setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
>    setenv PATH 
> "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
>    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ -arch 
> armv7 -isysroot 
> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk 
> -L/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/BuildProductsPath/Release-iphoneos
>  
> -F/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/BuildProductsPath/Release-iphoneos
>  -filelist 
> /Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/IntermediateBuildFilesPath/All.build/Release-iphoneos/Discs.build/Objects-normal/armv7/Discs.LinkFileList
>  -dead_strip -ObjC -framework OpenGLES -framework UIKit -framework Foundation 
> -framework CoreGraphics -framework QuartzCore -framework CoreData -framework 
> Coremotion -Wl,-search_paths_first -Wl,-headerpad_max_install_names 
> /Users/danieldekkers/development/build/iOS/ES1/rendertools/src/Rel
>  ease-iphoneos/libRenderTools.a -lz -miphoneos-version-min=4.3 -o 
> /Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/InstallationBuildProductsLocation/Application/Discs.app/Discs
> Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ 
> failed with exit code 1
>
> This is a problem, because you have to archive an ipa file, AdHoc or AppStore 
> to ship your application.
>
> These are our IOS specific settings at the moment, lots of trial-and-error, 
> but at least they work on the simulator and attached devices:
>
> IF( RT_IOS )
>        # "Toolchain" settings can (for the time being) just be included...
>        SET (CMAKE_SYSTEM_NAME Generic)
>        SET (CMAKE_SYSTEM_VERSION 1)
>        SET (CMAKE_SYSTEM_PROCESSOR arm)
>
>        SET (RT_SDKVER "5.0" CACHE PATH "iOS SDK version" )
>        SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
>        SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${RT_SDKVER}.sdk")
>        IF( EXISTS ${SDKROOT} )
>                SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
>        ELSE()
>                MESSAGE( "Warning, iOS SDK path not found: " ${SDKROOT})
>        ENDIF()
>        SET (CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)") # Either 
> "$(ARCHS_UNIVERSAL_IPHONE_OS)" or "arm6" "arm7"
>
>        # SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc")      # Can be 
> removed, just let Xcode choose the default.
>        # SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++")    # Can be 
> removed, just let Xcode choose the default.
>
>        SET (CMAKE_FIND_ROOT_PATH "${DEVELOPMENT_ROOT}" "${SDKROOT}" 
> "${DEVROOT}")
>        SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
>        SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
>        SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
>
>        SET( RT_DEPLOYMENT_TARGET "4.3" CACHE STRING "minimum required SDK" )
>
>        SET( GCC_INPUT_FILETYPE "Objective-C++" )
>        SET( CMAKE_CXX_FLAGS "-x objective-c++ -mno-thumb" )
>
>        # For iOS builds this is needed for the app to initiate the 
> UIApplication delegate instance...
>        SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ObjC" )
>
>        # Look in the correct build directories when linking the app to the 
> RenderTools library...
>        SET( CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator" )
> ENDIF()
>
> Just wondering if someone is following the same path.
>
> Thanks,
>
> Daniel
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubs

Re: [CMake] add_test WORKING_DIRECTORY

2011-11-26 Thread David Cole
You are calling add_test correctly.

Now you need to call ctest like this:

  ctest -C Release
or
  ctest -C Debug

to test a particular configuration...


HTH,
David


On Fri, Nov 25, 2011 at 11:21 AM, W Eryk Wolski  wrote:
> I am testing against reference data in the source directory.
> However, I would like to perform out of source builds.
>
>
> With
> add_test(SpoofTest ${BinOut}/SpoofTest )
> the test dont find's the data, because the data path is hard coded in the
> tests and the build directory location is arbitrary.
>
>
> My Idea is to use the WORKING_DIRECTORY option to execute the tests in the
> Source directory.
>
> add_test(NAME SpoofTest
> WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
> COMMAND ${BinOut}/SpoofTest)
>
> However, I do not understand the COMMAND parameter.
>
> This is what I am getting when I run ctest:
> Checking test dependency graph end
> test 1
>     Start 1: SpoofTest
>
> 1: Test command: NOT_AVAILABLE
> Test not available without configuration.  (Missing "-C "?)
> 1/1 Test #1: SpoofTest ***Not Run   0.00 sec
>
> 0% tests passed, 1 tests failed out of 1
>
> Total Test time (real) =   2.29 sec
>
> The following tests FAILED:
>   1 - SpoofTest (Not Run)
> Errors while running CTest
>
> Can anyone please explain the COMMAND parameter to me!
>
> Regards
> Eryk
>
>
>
>
>
>
>
> --
> Witold Eryk Wolski
>
> Heidmark str 5
> D-28329 Bremen
> tel.: 04215261837
>
> --
>
> 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] parallel build using "cmake --build"?

2011-11-26 Thread John Drescher
On Fri, Nov 25, 2011 at 10:16 PM, Steve M. Robbins  wrote:
> Hi,
>
> To build VTK on our windows build server, I wrote a small batch script
> that invokes "cmake --build".
>
> My developer machine is multicore; is there a way to get "cmake --build"
> to run multiple jobs?
>

On windows, I use the following tool

http://www.codeproject.com/KB/cpp/runjobs.aspx

to build each configuration (Debug, Release, RelWithDebInfo ...) in
parallel using separate calls to cmake --build.

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] parallel build using "cmake --build"?

2011-11-26 Thread Michael Hertling
On 11/26/2011 04:16 AM, Steve M. Robbins wrote:
> Hi,
> 
> To build VTK on our windows build server, I wrote a small batch script
> that invokes "cmake --build".
> 
> My developer machine is multicore; is there a way to get "cmake --build" 
> to run multiple jobs?
> 
> Thanks,
> -Steve

"cmake --build" is just a front-end for the native build tool CMake
generates input for. If this tool can be invoked via the command line
with options for parallel building, you can provide them after the "--"
in the "cmake --build" command, e.g. "cmake --build  -- -j 4"
for parallel building with Makefiles.

Regards,

Michael
--

Powered by www.kitware.com

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

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

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


[CMake] [CPACK] Patch with componentwise extra install commands for NSIS-generator

2011-11-26 Thread Marcel

Hi,

I extended cpack's NSIS-generator and want to contribute the attached patch.

It adds the CPACK_COMPONENT__EXTRA_INSTALL_COMMANDS option to 
cpack that allows to add NSIS commands exclusivly to the install section 
generated for the component . So it adopts the option 
CPACK_NSIS_EXTRA_INSTALL_COMMANDS for single components/sections.


That way special code can be added to a section that ist only executed 
if the user chooses to install the section.


Perhaps this change could be merged into the cmake, because I think this 
could be of some use for other cpack users.


If this is not the right place to contribute, could someone please give 
me a pointer.


Best regards,

Marcel

>From 88dcca63c40aaa25902023a3b7c7ae8e9f9c44c2 Mon Sep 17 00:00:00 2001
From: Marcel 
Date: Mon, 14 Nov 2011 15:13:49 +0100
Subject: [PATCH] CPack: Added EXTRA_INSTALL_COMMANDS option for single
 COMPONENTs to NSIS-Generator. NSIS commands given to
 CPACK_COMPONENT__EXTRA_INSTALL_COMMANDS are added
 exclusivly to the install section generated for the
 component .

This gives greater flexibility in contrast to
CPACK_NSIS_EXTRA_INSTALL_COMMANDS that only allows to add NSIS commands to
the overall install section, in case that extra commands should only be
executed if the user chooses to install a certain section.

Also, removed the constraint that only components with files are added
to the generated NSIS-Script, so that components with extra install
commands only can be created.

BUFIX: check for empty extraInstallCommands.
---
 Source/CPack/cmCPackComponentGroup.h  |3 +++
 Source/CPack/cmCPackGenerator.cxx |   20 
 Source/CPack/cmCPackNSISGenerator.cxx |   31 +++
 3 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/Source/CPack/cmCPackComponentGroup.h 
b/Source/CPack/cmCPackComponentGroup.h
index cebdd6d..af81fc2 100644
--- a/Source/CPack/cmCPackComponentGroup.h
+++ b/Source/CPack/cmCPackComponentGroup.h
@@ -89,6 +89,9 @@ public:
   /// The list of installed directories that are part of this component.
   std::vector Directories;
 
+  /// Extra install commands that are added to this section
+  std::vector ExtraInstallCommands;
+
   /// Get the total installed size of all of the files in this
   /// component, in bytes. installDir is the directory into which the 
   /// component was installed.
diff --git a/Source/CPack/cmCPackGenerator.cxx 
b/Source/CPack/cmCPackGenerator.cxx
index 083279f..e086c26 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1520,6 +1520,26 @@ cmCPackGenerator::GetComponent(const char *projectName, 
const char *name)
   component->Description = description;
   }
 
+// Process extra install commands
+const char* extraInstallCommands
+  = this->GetOption((macroPrefix + "_EXTRA_INSTALL_COMMANDS").c_str());
+if (extraInstallCommands != NULL)
+  {
+  std::vector eCommandsVector;
+  cmSystemTools::ExpandListArgument(extraInstallCommands, eCommandsVector);
+  std::vector::iterator eCommIt;
+  for (eCommIt = eCommandsVector.begin();
+  eCommIt != eCommandsVector.end();
+  ++eCommIt)
+{
+  if (!eCommIt->empty())
+{
+  component->ExtraInstallCommands.push_back(*eCommIt);
+}
+}
+  }
+
+
 // Determine the installation types.
 const char *installTypes 
   = this->GetOption((macroPrefix + "_INSTALL_TYPES").c_str());
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx 
b/Source/CPack/cmCPackNSISGenerator.cxx
index 2b94067..e5e49ca 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -242,7 +242,10 @@ int cmCPackNSISGenerator::PackageFiles()
   if (compIt->second.Files.empty())
 {
 // NSIS cannot cope with components that have no files.
-continue;
+   if (compIt->second.ExtraInstallCommands.empty())
+ {
+ continue;
+ }
 }
 
   anyDownloadedComponents =
@@ -819,8 +822,18 @@ CreateComponentDescription(cmCPackComponent *component,
 }
   else
 {
-componentCode += "  File /r \"${INST_DIR}\\" +
-  component->Name + "\\*.*\"\n";
+  if (!component->Files.empty())
+{
+componentCode += "  File /r \"${INST_DIR}\\" +
+component->Name + "\\*.*\"\n";
+}
+}
+  std::vector::iterator extraIt;
+  for (extraIt = component->ExtraInstallCommands.begin();
+   extraIt != component->ExtraInstallCommands.end();
+   extraIt++)
+{
+componentCode += "  " + *extraIt + "\n";
 }
   componentCode += "SectionEnd\n";
 
@@ -972,9 +985,19 @@ CreateComponentGroupDescription(cmCPackComponentGroup 
*group,
comp != group->Components.end(); 
++comp)
 {
+
 if ((*comp)->Files.empty())
   {
-  continue;
+  if ((*comp)->ExtraInstallCommands.empty())
+{
+continue;
+  

Re: [CMake] Build doesn't work with Mac OS X Lion...

2011-11-26 Thread Daniel Dekkers
This:

SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
seems to result in a "standard" Xcode setting (armv7 (standard)) which is also 
set when you let Xcode create a fresh iOS app (from its own templates).

But you also see this a lot on the fora:
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)")

Not sure.

On Nov 26, 2011, at 4:38 AM, Michael Jackson wrote:

> There is a cmake variable that you set during  onfiguration time.
> Something like os_x_architectures. There you can add the specific arch
> that you want to build for.
> 
> -
> Mike Jackson www.bluequartz.net
> Principal Software Engineer   mike.jack...@bluequartz.net
> BlueQuartz Software   Dayton, Ohio
> 
> Sent from my mobile device. Please excuse the shortness of the reply.
> 
> On Nov 25, 2011, at 14:47, Dick Munroe  wrote:
> 
>> I've got a build that works just fine with Leopard.
>> 
>> For reasons I won't get into, I had to upgrade one of my systems to Lion and 
>> now (I've installed XCode 4.2) the build won't work.  I get the following 
>> error:
>> 
>> [  0%] Reaping winning child 0x10260c510 PID 1009
>> Live child 0x10260c510 
>> (libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o)
>>  PID 1010
>> Building CXX object 
>> libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o
>> Reaping winning child 0x10260c510 PID 1010
>> Live child 0x10260c510 
>> (libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o)
>>  PID 1011
>> llvm-g++-4.2: Invalid arch name : -O2
>> Reaping losing child 0x10260c510 PID 1011
>> make[2]: *** 
>> [libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o]
>>  Error 1
>> Removing child 0x10260c510 PID 1011 from chain.
>> Reaping losing child 0x10c20c290 PID 1008
>> make[1]: *** [libxp/CMakeFiles/xp.dir/all] Error 2
>> Removing child 0x10c20c290 PID 1008 from chain.
>> Reaping losing child 0x10940e730 PID 996
>> 
>> If I dig around, I find the CXX flags to be:
>> 
>> -arch  -O2 -fPIC
>> 
>> and for some reason the Lion g++ compiler is choking thinking that there 
>> should be and arch value.  Which if I dig around in the Leopard build I find:
>> 
>> -Dxp_EXPORTS  -arch i386 -O2 -g -fPIC
>> 
>> Which brings up the questions, (1) with the same CMakeLists.txt file, why am 
>> I getting different values and (2) how do I get the arch to be i386 on the 
>> Lion build.
>> 
>> Best,
>> 
>> Dick Munroe
>> 
>> --
>> 
>> 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 CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

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