Re: [CMake] Forcing project to be included in a solution?

2012-04-04 Thread Fraser Hutchison

David's original answer does what you require.

Simply include |add_custom_target(Foo ...)| and don't include 
|add_dependencies(Bar Foo)|.


If your project is also called Bar, then Bar.sln will include Foo.vcproj 
and Bar.vcproj, but Foo will not be built when invoking "Build Solution".


Cheers,

Fraser.



On 04/04/2012 21:33, Robert Dailey wrote:

Sorry I think we are not on the same page.

My custom target is: "Foo"
My C++ executable target is: "Bar"

I don't want Bar depend on Foo, because I do not want Foo's commands 
to execute when I build Bar. However, because Bar does not depend on 
Foo, Foo.vcproj will not be part of Bar.sln. I need a way to make sure 
that Foo.vcproj opens with Bar.sln without creating that dependency.


I hope this makes a little more sense.

On Wed, Apr 4, 2012 at 2:01 PM, David Cole > wrote:


Your original message said you didn't want to make it a dependency.
So, why then use "add_dependencies" ...?


On Wed, Apr 4, 2012 at 3:00 PM, David Cole mailto:david.c...@kitware.com>> wrote:
> Well, add_dependencies means that the custom target will be built
> *before* the target that needs it. So it becomes part of "ALL"
if the
> other target is part of "ALL".
>
> I thought nothing depended on it, that's why I offered the leave out
> "ALL" advice. If something depends on it, then it's going to be
> executed before the thing that depends on it...
>
>
>
> On Wed, Apr 4, 2012 at 2:35 PM, Robert Dailey
mailto:rcdailey.li...@gmail.com>> wrote:
>> I add the custom targets as a dependency
with add_dependencies(), and I
>> create the targets with add_custom_target(), I don't specify "ALL".
>>
>> In my test with Visual Studio 2008, building the parent project
results in
>> these custom targets being built as well. According to your
instruction,
>> this should not happen, correct?
>>
>> On Wed, Apr 4, 2012 at 12:10 PM, David Cole
mailto:david.c...@kitware.com>> wrote:
>>>
>>> Sure, just use add_custom_target without the "ALL" argument.
If you
>>> don't use "ALL", then the project is completely disconnected from
>>> ALL_BUILD and everything else, and will only be triggered when you
>>> explicitly build that target/project.
>>>
>>>
>>> HTH,
>>> David
>>>
>>>
>>> On Wed, Apr 4, 2012 at 12:53 PM, Robert Dailey
mailto:rcdailey.li...@gmail.com>>
>>> wrote:
>>> > Hi,
>>> >
>>> > I have a custom target that just runs some commands that
have nothing to
>>> > do
>>> > with building source. For convenience, when generating
visual studio
>>> > projects, I'd like for that target to be included in the SLN
generated
>>> > by
>>> > project() but I don't want to make it a dependency, since
that would
>>> > force
>>> > it to build when I build any other project in the solution
(I think).
>>> >
>>> > Is there a way to make a vcproj be included in a sln without
it building
>>> > as
>>> > part of the dependency chain?
>>> >
>>> > Thanks in advance.
>>> >
>>> > --
>>> >
>>> > 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] Trying to build Paraview for Visual Studio Express 2010

2012-04-04 Thread Bill Hoffman

On 3/14/2012 1:21 PM, Francisco Caraballo wrote:

Hello everyone.

I'm using CMAKE to build Paraview with Visual Studio Express 2010. I'm
having a problem with the generated solution. The problem is that one
of the entries generated for included libraries (the MPI libraries)
should be semi colon separated but it is space separated. The result
of this is that the linker generates a lot of errors when building the
project.

This is the problematic entry:
LINK : fatal error LNK1104: cannot open file 'C:\Program Files
(x86)\MPICH2\lib\mpi.lib C:\Program Files (x86)\MPICH2\lib\cxx.lib'

I tried to fix it by changing the included libraries manually project
by project, but it is taking way too long.

How can I solve this? I'm not familiar enough with CMAKE's
architecture to pinpoint what I need to change.

I have reproduced your problem.  Adding the ; manually worked for me. 
The problem is in FindMPI.cmake.  It is already fixed in master of CMake.


Here is the bug report and the fix:

http://public.kitware.com/Bug/view.php?id=12874

-Bill

--

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] [EXTERNAL] A required library with BLAS API not found.

2012-04-04 Thread Maxime Boissonneault
The point of CMake is to not have to specify all of these directories 
(blas dir, lapack dir, name of the library, etc.).


After messing around quite a bit, I found out that if I add "pthread" at 
the end of line 533 of FindBLAS.cmake, it solves the problem and cmake 
finds all it needs (blas and lapack).
It seems that cmake finds the library, but its trycompile test fails 
because it does not link with all the required libraries (it's missing 
pthread).


This works for my mkl/10.2.2.025, but it does not work for mkl/10.3.4.

I think this should be fixed in FindBLAS.cmake!


Best,

Maxime Boissonneault


Le 12-04-04 16:43, Mitchell, John A a écrit :

  I'm not totally sure what the issue is you are having.  Make sure that you 
have your 'intel' environment set up.  See my .bashrc snippet below.

It may be as simple as not having an include directory defined in your 
CMakeLists.txt file(s).

Getting MKL hooked up can be something of a pain.For what its worth, here 
is how I have recently made this work.


In my .bashrc file:

export MKLROOT=/opt/intel/mkl
export MKLPATH=$MKLROOT/lib/intel64
export MKLINCLUDE=$MKLROOT/include
source ${MKLROOT}/bin/mklvars.sh intel64

In my shell script that launches cmake:

# Blas/Lapack

LAPACK_LIB_DIRS=$MKLPATH
BLAS_LIB_DIRS=$MKLPATH


In the actual cmake command:

cmake ...(whatever other command you have) \
  -D BLAS_LIBRARY_DIRS:PATH=$BLAS_LIB_DIRS \
  -D LAPACK_LIBRARY_DIRS:PATH=$LAPACK_LIB_DIRS \


In my CMakeLists.txt file:

 # Blas and Lapack Libraries
 find_library(Blas_LIBRARY
   NAMES mkl_blas95_lp64
   PATHS ${BLAS_LIBRARY_DIRS}
 )
 find_library(Lapack_LIBRARY
   NAMES mkl_lapack95_lp64
   PATHS ${LAPACK_LIBRARY_DIRS}
 )
 set(BlasLapack_Libraries mkl_blas95_lp64 mkl_lapack95_lp64)








From: cmake-boun...@cmake.org [cmake-boun...@cmake.org] on behalf of Maxime 
Boissonneault [maxime.boissonnea...@clumeq.ca]
Sent: Wednesday, April 04, 2012 2:28 PM
To: cmake@cmake.org
Subject: [EXTERNAL] [CMake] A required library with BLAS API not found.

Hi,
I am trying to compile a code with cmake on a cluster. However, whatever
I do, cmake can not seem to find BLAS, even though BLAS is definitely
installed (MKL version) and in my LD_LIBRARY_PATH.

Please help!

Below is the output of a few commands, with the cmake output.

Thanks,

Maxime Boissonneault


[mboisson@colosse1 squack-code]$ echo $LD_LIBRARY_PATH
/software/intel/mkl/10.2.2.025/lib/em64t:/software/intel/Compiler/11.1.059/lib/intel64:/software/misc-libs/gsl/1.15_gcc/lib
[mboisson@colosse1 squack-code]$ ls /software/intel/mkl/10.2.2.025/lib/em64t
libguide.a  libmkl_blacs_intelmpi_lp64.so
libmkl_core.a libmkl_intel_ilp64.a
libmkl_lapack95_lp64.a libmkl_scalapack_lp64.a
libmkl_vml_def.so
libguide.so libmkl_blacs_lp64.a
libmkl_core.solibmkl_intel_ilp64.so
libmkl_lapack.so   libmkl_scalapack_lp64.so
libmkl_vml_mc2.so
libiomp5.a  libmkl_blacs_openmpi_ilp64.a
libmkl_def.so libmkl_intel_lp64.a
libmkl_mc3.so  libmkl_sequential.a
libmkl_vml_mc3.so
libiomp5.so libmkl_blacs_openmpi_lp64.a
libmkl_gf_ilp64.a libmkl_intel_lp64.so
libmkl_mc.so   libmkl_sequential.so
libmkl_vml_mc.so
libmkl_avx.so   libmkl_blacs_sgimpt_ilp64.a
libmkl_gf_ilp64.solibmkl_intel_sp2dp.a
libmkl_p4n.so  libmkl_solver_ilp64.a
libmkl_vml_p4n.so
libmkl_blacs_ilp64.alibmkl_blacs_sgimpt_lp64.a
libmkl_gf_lp64.a  libmkl_intel_sp2dp.so
libmkl_pgi_thread.alibmkl_solver_ilp64_sequential.a  locale
libmkl_blacs_intelmpi_ilp64.a   libmkl_blas95_ilp64.a
libmkl_gf_lp64.so libmkl_intel_thread.a
libmkl_pgi_thread.so   libmkl_solver_lp64.a
libmkl_blacs_intelmpi_ilp64.so  libmkl_blas95_lp64.a
libmkl_gnu_thread.a   libmkl_intel_thread.so
libmkl_scalapack_ilp64.a   libmkl_solver_lp64_sequential.a
libmkl_blacs_intelmpi_lp64.alibmkl_cdft_core.a
libmkl_gnu_thread.so  libmkl_lapack95_ilp64.a
libmkl_scalapack_ilp64.so  libmkl_vml_avx.so

[mboisson@colosse1 squack-code]$ cmake .
-- CMAKE_INSTALL_PREFIX = /usr/local
-- Looking for sgemm_
-- Looking for sgemm_ - not found
CMake Error at
/software/tools/cmake/2.8.7/share/cmake-2.8/Modules/FindBLAS.cmake:612
(message):
A required library with BLAS API not found.  Please specify library
location.
Call Stack (most recent call first):
CMakeLists.txt:24 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
[mboisson@colosse1 squack-code]$


--

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





--
-
Maxime Boissonneault

Re: [CMake] [EXTERNAL] A required library with BLAS API not found.

2012-04-04 Thread Mitchell, John A
 I'm not totally sure what the issue is you are having.  Make sure that you 
have your 'intel' environment set up.  See my .bashrc snippet below.  

It may be as simple as not having an include directory defined in your 
CMakeLists.txt file(s). 

Getting MKL hooked up can be something of a pain.For what its worth, here 
is how I have recently made this work. 


In my .bashrc file:

export MKLROOT=/opt/intel/mkl
export MKLPATH=$MKLROOT/lib/intel64
export MKLINCLUDE=$MKLROOT/include
source ${MKLROOT}/bin/mklvars.sh intel64

In my shell script that launches cmake:

# Blas/Lapack

LAPACK_LIB_DIRS=$MKLPATH
BLAS_LIB_DIRS=$MKLPATH


In the actual cmake command:

cmake ...(whatever other command you have) \
 -D BLAS_LIBRARY_DIRS:PATH=$BLAS_LIB_DIRS \
 -D LAPACK_LIBRARY_DIRS:PATH=$LAPACK_LIB_DIRS \


In my CMakeLists.txt file:

# Blas and Lapack Libraries
find_library(Blas_LIBRARY
  NAMES mkl_blas95_lp64
  PATHS ${BLAS_LIBRARY_DIRS}
)
find_library(Lapack_LIBRARY
  NAMES mkl_lapack95_lp64
  PATHS ${LAPACK_LIBRARY_DIRS}
)
set(BlasLapack_Libraries mkl_blas95_lp64 mkl_lapack95_lp64)








From: cmake-boun...@cmake.org [cmake-boun...@cmake.org] on behalf of Maxime 
Boissonneault [maxime.boissonnea...@clumeq.ca]
Sent: Wednesday, April 04, 2012 2:28 PM
To: cmake@cmake.org
Subject: [EXTERNAL] [CMake] A required library with BLAS API not found.

Hi,
I am trying to compile a code with cmake on a cluster. However, whatever
I do, cmake can not seem to find BLAS, even though BLAS is definitely
installed (MKL version) and in my LD_LIBRARY_PATH.

Please help!

Below is the output of a few commands, with the cmake output.

Thanks,

Maxime Boissonneault


[mboisson@colosse1 squack-code]$ echo $LD_LIBRARY_PATH
/software/intel/mkl/10.2.2.025/lib/em64t:/software/intel/Compiler/11.1.059/lib/intel64:/software/misc-libs/gsl/1.15_gcc/lib
[mboisson@colosse1 squack-code]$ ls /software/intel/mkl/10.2.2.025/lib/em64t
libguide.a  libmkl_blacs_intelmpi_lp64.so
libmkl_core.a libmkl_intel_ilp64.a
libmkl_lapack95_lp64.a libmkl_scalapack_lp64.a
libmkl_vml_def.so
libguide.so libmkl_blacs_lp64.a
libmkl_core.solibmkl_intel_ilp64.so
libmkl_lapack.so   libmkl_scalapack_lp64.so
libmkl_vml_mc2.so
libiomp5.a  libmkl_blacs_openmpi_ilp64.a
libmkl_def.so libmkl_intel_lp64.a
libmkl_mc3.so  libmkl_sequential.a
libmkl_vml_mc3.so
libiomp5.so libmkl_blacs_openmpi_lp64.a
libmkl_gf_ilp64.a libmkl_intel_lp64.so
libmkl_mc.so   libmkl_sequential.so
libmkl_vml_mc.so
libmkl_avx.so   libmkl_blacs_sgimpt_ilp64.a
libmkl_gf_ilp64.solibmkl_intel_sp2dp.a
libmkl_p4n.so  libmkl_solver_ilp64.a
libmkl_vml_p4n.so
libmkl_blacs_ilp64.alibmkl_blacs_sgimpt_lp64.a
libmkl_gf_lp64.a  libmkl_intel_sp2dp.so
libmkl_pgi_thread.alibmkl_solver_ilp64_sequential.a  locale
libmkl_blacs_intelmpi_ilp64.a   libmkl_blas95_ilp64.a
libmkl_gf_lp64.so libmkl_intel_thread.a
libmkl_pgi_thread.so   libmkl_solver_lp64.a
libmkl_blacs_intelmpi_ilp64.so  libmkl_blas95_lp64.a
libmkl_gnu_thread.a   libmkl_intel_thread.so
libmkl_scalapack_ilp64.a   libmkl_solver_lp64_sequential.a
libmkl_blacs_intelmpi_lp64.alibmkl_cdft_core.a
libmkl_gnu_thread.so  libmkl_lapack95_ilp64.a
libmkl_scalapack_ilp64.so  libmkl_vml_avx.so

[mboisson@colosse1 squack-code]$ cmake .
-- CMAKE_INSTALL_PREFIX = /usr/local
-- Looking for sgemm_
-- Looking for sgemm_ - not found
CMake Error at
/software/tools/cmake/2.8.7/share/cmake-2.8/Modules/FindBLAS.cmake:612
(message):
   A required library with BLAS API not found.  Please specify library
   location.
Call Stack (most recent call first):
   CMakeLists.txt:24 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
[mboisson@colosse1 squack-code]$


--

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] Forcing project to be included in a solution?

2012-04-04 Thread Robert Dailey
Sorry I think we are not on the same page.

My custom target is: "Foo"
My C++ executable target is: "Bar"

I don't want Bar depend on Foo, because I do not want Foo's commands to
execute when I build Bar. However, because Bar does not depend on Foo,
Foo.vcproj will not be part of Bar.sln. I need a way to make sure that
Foo.vcproj opens with Bar.sln without creating that dependency.

I hope this makes a little more sense.

On Wed, Apr 4, 2012 at 2:01 PM, David Cole  wrote:

> Your original message said you didn't want to make it a dependency.
> So, why then use "add_dependencies" ...?
>
>
> On Wed, Apr 4, 2012 at 3:00 PM, David Cole  wrote:
> > Well, add_dependencies means that the custom target will be built
> > *before* the target that needs it. So it becomes part of "ALL" if the
> > other target is part of "ALL".
> >
> > I thought nothing depended on it, that's why I offered the leave out
> > "ALL" advice. If something depends on it, then it's going to be
> > executed before the thing that depends on it...
> >
> >
> >
> > On Wed, Apr 4, 2012 at 2:35 PM, Robert Dailey 
> wrote:
> >> I add the custom targets as a dependency with add_dependencies(), and I
> >> create the targets with add_custom_target(), I don't specify "ALL".
> >>
> >> In my test with Visual Studio 2008, building the parent project results
> in
> >> these custom targets being built as well. According to your instruction,
> >> this should not happen, correct?
> >>
> >> On Wed, Apr 4, 2012 at 12:10 PM, David Cole 
> wrote:
> >>>
> >>> Sure, just use add_custom_target without the "ALL" argument. If you
> >>> don't use "ALL", then the project is completely disconnected from
> >>> ALL_BUILD and everything else, and will only be triggered when you
> >>> explicitly build that target/project.
> >>>
> >>>
> >>> HTH,
> >>> David
> >>>
> >>>
> >>> On Wed, Apr 4, 2012 at 12:53 PM, Robert Dailey <
> rcdailey.li...@gmail.com>
> >>> wrote:
> >>> > Hi,
> >>> >
> >>> > I have a custom target that just runs some commands that have
> nothing to
> >>> > do
> >>> > with building source. For convenience, when generating visual studio
> >>> > projects, I'd like for that target to be included in the SLN
> generated
> >>> > by
> >>> > project() but I don't want to make it a dependency, since that would
> >>> > force
> >>> > it to build when I build any other project in the solution (I think).
> >>> >
> >>> > Is there a way to make a vcproj be included in a sln without it
> building
> >>> > as
> >>> > part of the dependency chain?
> >>> >
> >>> > Thanks in advance.
> >>> >
> >>> > --
> >>> >
> >>> > 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] A required library with BLAS API not found.

2012-04-04 Thread Maxime Boissonneault

Hi,
I am trying to compile a code with cmake on a cluster. However, whatever 
I do, cmake can not seem to find BLAS, even though BLAS is definitely 
installed (MKL version) and in my LD_LIBRARY_PATH.


Please help!

Below is the output of a few commands, with the cmake output.

Thanks,

Maxime Boissonneault


[mboisson@colosse1 squack-code]$ echo $LD_LIBRARY_PATH
/software/intel/mkl/10.2.2.025/lib/em64t:/software/intel/Compiler/11.1.059/lib/intel64:/software/misc-libs/gsl/1.15_gcc/lib
[mboisson@colosse1 squack-code]$ ls /software/intel/mkl/10.2.2.025/lib/em64t
libguide.a  libmkl_blacs_intelmpi_lp64.so  
libmkl_core.a libmkl_intel_ilp64.a 
libmkl_lapack95_lp64.a libmkl_scalapack_lp64.a   
libmkl_vml_def.so
libguide.so libmkl_blacs_lp64.a
libmkl_core.solibmkl_intel_ilp64.so
libmkl_lapack.so   libmkl_scalapack_lp64.so  
libmkl_vml_mc2.so
libiomp5.a  libmkl_blacs_openmpi_ilp64.a   
libmkl_def.so libmkl_intel_lp64.a  
libmkl_mc3.so  libmkl_sequential.a   
libmkl_vml_mc3.so
libiomp5.so libmkl_blacs_openmpi_lp64.a
libmkl_gf_ilp64.a libmkl_intel_lp64.so 
libmkl_mc.so   libmkl_sequential.so  
libmkl_vml_mc.so
libmkl_avx.so   libmkl_blacs_sgimpt_ilp64.a
libmkl_gf_ilp64.solibmkl_intel_sp2dp.a 
libmkl_p4n.so  libmkl_solver_ilp64.a 
libmkl_vml_p4n.so
libmkl_blacs_ilp64.alibmkl_blacs_sgimpt_lp64.a 
libmkl_gf_lp64.a  libmkl_intel_sp2dp.so
libmkl_pgi_thread.alibmkl_solver_ilp64_sequential.a  locale
libmkl_blacs_intelmpi_ilp64.a   libmkl_blas95_ilp64.a  
libmkl_gf_lp64.so libmkl_intel_thread.a
libmkl_pgi_thread.so   libmkl_solver_lp64.a
libmkl_blacs_intelmpi_ilp64.so  libmkl_blas95_lp64.a   
libmkl_gnu_thread.a   libmkl_intel_thread.so   
libmkl_scalapack_ilp64.a   libmkl_solver_lp64_sequential.a
libmkl_blacs_intelmpi_lp64.alibmkl_cdft_core.a 
libmkl_gnu_thread.so  libmkl_lapack95_ilp64.a  
libmkl_scalapack_ilp64.so  libmkl_vml_avx.so


[mboisson@colosse1 squack-code]$ cmake .
-- CMAKE_INSTALL_PREFIX = /usr/local
-- Looking for sgemm_
-- Looking for sgemm_ - not found
CMake Error at 
/software/tools/cmake/2.8.7/share/cmake-2.8/Modules/FindBLAS.cmake:612 
(message):

  A required library with BLAS API not found.  Please specify library
  location.
Call Stack (most recent call first):
  CMakeLists.txt:24 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
[mboisson@colosse1 squack-code]$


--

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] Multiple Installers in one project

2012-04-04 Thread Eric Noulard
2012/4/4 David Cole :
> No. It's easy to build a single installer that contains multiple components.

You are speaking of NSIS or Package Maker since archive generators
like ZIP can produce multiple file on a per-component basis.

I may suggest a possibly "easy" solution if you do accept extra building.

You can make your current project "configurable with options", like:

OPTION(BUILD_PACK1 "Used to build package1" OFF)
OPTION(BUILD_PACK2 "Used to build package2" OFF)
OPTION(BUILD_PACK3 "Used to build package3" OFF)

then you make your install rule conditionnal on the option value
(you can make the build rule conditionnal as well if you want
 to save compilation time)

if (BUILD_PACK1)
   INSTALL(TARGET Bin1 RUNTIME DESTINATION .)
endif()

if (BUILD_PACK2 OR BUILD_PACK3)
   INSTALL(TARGET Lib3 RUNTIME DESTINATION .)
endif()

etcI think you get it.
use BundleUtilities if you want.

mkdir build1; cd build1; cmake -DBUILD_PACK1=ON /path/to/source; make
; make package
mkdir build2; cd build2; cmake -DBUILD_PACK2=ON /path/to/source; make
; make package
mkdir build3; cd build3; cmake -DBUILD_PACK3=ON /path/to/source; make
; make package

you will build things far too much times but
  - you'll keep a single project
  - you'll get your wanted package

You should off course setup some BUILD_PACKx specific values
for CPACK_PACKAGE_NAME so that you'll get package specific name.

You could tune other CPack time parameters/Variables by using a CPack project
config file such that you can change the name, license file, etc... if a
"build specific way".
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29

I think you could even be able to play with component
and CPACK_COMPONENTS_ALL at CPack time  in order to avoid
CMake time option, but I shall try before giving such advice.
-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.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] Forcing project to be included in a solution?

2012-04-04 Thread David Cole
Your original message said you didn't want to make it a dependency.
So, why then use "add_dependencies" ...?


On Wed, Apr 4, 2012 at 3:00 PM, David Cole  wrote:
> Well, add_dependencies means that the custom target will be built
> *before* the target that needs it. So it becomes part of "ALL" if the
> other target is part of "ALL".
>
> I thought nothing depended on it, that's why I offered the leave out
> "ALL" advice. If something depends on it, then it's going to be
> executed before the thing that depends on it...
>
>
>
> On Wed, Apr 4, 2012 at 2:35 PM, Robert Dailey  
> wrote:
>> I add the custom targets as a dependency with add_dependencies(), and I
>> create the targets with add_custom_target(), I don't specify "ALL".
>>
>> In my test with Visual Studio 2008, building the parent project results in
>> these custom targets being built as well. According to your instruction,
>> this should not happen, correct?
>>
>> On Wed, Apr 4, 2012 at 12:10 PM, David Cole  wrote:
>>>
>>> Sure, just use add_custom_target without the "ALL" argument. If you
>>> don't use "ALL", then the project is completely disconnected from
>>> ALL_BUILD and everything else, and will only be triggered when you
>>> explicitly build that target/project.
>>>
>>>
>>> HTH,
>>> David
>>>
>>>
>>> On Wed, Apr 4, 2012 at 12:53 PM, Robert Dailey 
>>> wrote:
>>> > Hi,
>>> >
>>> > I have a custom target that just runs some commands that have nothing to
>>> > do
>>> > with building source. For convenience, when generating visual studio
>>> > projects, I'd like for that target to be included in the SLN generated
>>> > by
>>> > project() but I don't want to make it a dependency, since that would
>>> > force
>>> > it to build when I build any other project in the solution (I think).
>>> >
>>> > Is there a way to make a vcproj be included in a sln without it building
>>> > as
>>> > part of the dependency chain?
>>> >
>>> > Thanks in advance.
>>> >
>>> > --
>>> >
>>> > 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] Forcing project to be included in a solution?

2012-04-04 Thread David Cole
Well, add_dependencies means that the custom target will be built
*before* the target that needs it. So it becomes part of "ALL" if the
other target is part of "ALL".

I thought nothing depended on it, that's why I offered the leave out
"ALL" advice. If something depends on it, then it's going to be
executed before the thing that depends on it...



On Wed, Apr 4, 2012 at 2:35 PM, Robert Dailey  wrote:
> I add the custom targets as a dependency with add_dependencies(), and I
> create the targets with add_custom_target(), I don't specify "ALL".
>
> In my test with Visual Studio 2008, building the parent project results in
> these custom targets being built as well. According to your instruction,
> this should not happen, correct?
>
> On Wed, Apr 4, 2012 at 12:10 PM, David Cole  wrote:
>>
>> Sure, just use add_custom_target without the "ALL" argument. If you
>> don't use "ALL", then the project is completely disconnected from
>> ALL_BUILD and everything else, and will only be triggered when you
>> explicitly build that target/project.
>>
>>
>> HTH,
>> David
>>
>>
>> On Wed, Apr 4, 2012 at 12:53 PM, Robert Dailey 
>> wrote:
>> > Hi,
>> >
>> > I have a custom target that just runs some commands that have nothing to
>> > do
>> > with building source. For convenience, when generating visual studio
>> > projects, I'd like for that target to be included in the SLN generated
>> > by
>> > project() but I don't want to make it a dependency, since that would
>> > force
>> > it to build when I build any other project in the solution (I think).
>> >
>> > Is there a way to make a vcproj be included in a sln without it building
>> > as
>> > part of the dependency chain?
>> >
>> > Thanks in advance.
>> >
>> > --
>> >
>> > 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] Forcing project to be included in a solution?

2012-04-04 Thread Robert Dailey
I add the custom targets as a dependency with add_dependencies(), and I
create the targets with add_custom_target(), I don't specify "ALL".

In my test with Visual Studio 2008, building the parent project results in
these custom targets being built as well. According to your instruction,
this should not happen, correct?

On Wed, Apr 4, 2012 at 12:10 PM, David Cole  wrote:

> Sure, just use add_custom_target without the "ALL" argument. If you
> don't use "ALL", then the project is completely disconnected from
> ALL_BUILD and everything else, and will only be triggered when you
> explicitly build that target/project.
>
>
> HTH,
> David
>
>
> On Wed, Apr 4, 2012 at 12:53 PM, Robert Dailey 
> wrote:
> > Hi,
> >
> > I have a custom target that just runs some commands that have nothing to
> do
> > with building source. For convenience, when generating visual studio
> > projects, I'd like for that target to be included in the SLN generated by
> > project() but I don't want to make it a dependency, since that would
> force
> > it to build when I build any other project in the solution (I think).
> >
> > Is there a way to make a vcproj be included in a sln without it building
> as
> > part of the dependency chain?
> >
> > Thanks in advance.
> >
> > --
> >
> > 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] Multiple Installers in one project

2012-04-04 Thread norulez
Ok, but this is not possible because of licensing.

Am 04.04.2012 um 19:46 schrieb David Cole :

> No. It's easy to build a single installer that contains multiple components.
> 
> On Wed, Apr 4, 2012 at 1:22 PM,   wrote:
>> And if I don't use libs/dll's twice and use components? Is it that easier to 
>> build installers per component?
>> 
>> Am 04.04.2012 um 19:15 schrieb David Cole :
>> 
>>> The answer to the question "is this possible?" is almost nearly always
>>> "yes, of course."
>>> 
>>> But in this case, it may be more work than you'd like. It should be
>>> quite possible to use BundleUtilities on 3 separate apps in 3 separate
>>> install tree sub-directories. Then creating separate installers for
>>> them might be quite a challenge with CPack. A single installer, or a
>>> component-aware installer is quite easy. Three separate ones usually
>>> come from three separate projects.
>>> 
>>> It begins to sound as though it might be easier to deal with your
>>> three exes if they were in 3 separate projects...
>>> 
>>> Nothing that I'm aware of will help you make what you want to do
>>> "quick+easy". It shouldn't be hard or difficult really, but if you
>>> want to keep your current structure, then writing scripts to do the
>>> installing and packaging is do-able, although likely more
>>> time-consuming than you're hoping for.
>>> 
>>> 
>>> HTH,
>>> David
>>> 
>>> 
>>> On Wed, Apr 4, 2012 at 12:55 PM,   wrote:
 Hello,
 
 I want to create multiple installers within a project.
 
 So, for example if the following files are created:
 Bin1.exe
 Bin2.exe
 Bin3.exe
 Lib1.dll
 Lib2.dll
 Lib3.dll
 
 Now I would like to have 3 Installers:
 1.) contains:
 Bin1.exe
 Lib1.dll
 Lib2.dll
 
 2.) contains:
 Bin2.exe
 Lib2.dll
 Lib3.dll
 
 3.) contains:
 Bin3.exe
 Lib1.dll
 Lib2.dll
 Lib3.dll
 
 I have each binary/library in the install command as followed:
 INSTALL(TARGET Bin1 RUNTIME DESTINATION .)
 
 After that I also want to run BundleUtilities for each binary/library to 
 get the dependencies.
 
 Is this possible?
 
 Thanks in advance
 
 Best Regards
 NoRulez
 --
 
 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] Multiple Installers in one project

2012-04-04 Thread David Cole
No. It's easy to build a single installer that contains multiple components.

On Wed, Apr 4, 2012 at 1:22 PM,   wrote:
> And if I don't use libs/dll's twice and use components? Is it that easier to 
> build installers per component?
>
> Am 04.04.2012 um 19:15 schrieb David Cole :
>
>> The answer to the question "is this possible?" is almost nearly always
>> "yes, of course."
>>
>> But in this case, it may be more work than you'd like. It should be
>> quite possible to use BundleUtilities on 3 separate apps in 3 separate
>> install tree sub-directories. Then creating separate installers for
>> them might be quite a challenge with CPack. A single installer, or a
>> component-aware installer is quite easy. Three separate ones usually
>> come from three separate projects.
>>
>> It begins to sound as though it might be easier to deal with your
>> three exes if they were in 3 separate projects...
>>
>> Nothing that I'm aware of will help you make what you want to do
>> "quick+easy". It shouldn't be hard or difficult really, but if you
>> want to keep your current structure, then writing scripts to do the
>> installing and packaging is do-able, although likely more
>> time-consuming than you're hoping for.
>>
>>
>> HTH,
>> David
>>
>>
>> On Wed, Apr 4, 2012 at 12:55 PM,   wrote:
>>> Hello,
>>>
>>> I want to create multiple installers within a project.
>>>
>>> So, for example if the following files are created:
>>> Bin1.exe
>>> Bin2.exe
>>> Bin3.exe
>>> Lib1.dll
>>> Lib2.dll
>>> Lib3.dll
>>>
>>> Now I would like to have 3 Installers:
>>> 1.) contains:
>>> Bin1.exe
>>> Lib1.dll
>>> Lib2.dll
>>>
>>> 2.) contains:
>>> Bin2.exe
>>> Lib2.dll
>>> Lib3.dll
>>>
>>> 3.) contains:
>>> Bin3.exe
>>> Lib1.dll
>>> Lib2.dll
>>> Lib3.dll
>>>
>>> I have each binary/library in the install command as followed:
>>> INSTALL(TARGET Bin1 RUNTIME DESTINATION .)
>>>
>>> After that I also want to run BundleUtilities for each binary/library to 
>>> get the dependencies.
>>>
>>> Is this possible?
>>>
>>> Thanks in advance
>>>
>>> Best Regards
>>> NoRulez
>>> --
>>>
>>> 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] Multiple Installers in one project

2012-04-04 Thread norulez
And if I don't use libs/dll's twice and use components? Is it that easier to 
build installers per component?

Am 04.04.2012 um 19:15 schrieb David Cole :

> The answer to the question "is this possible?" is almost nearly always
> "yes, of course."
> 
> But in this case, it may be more work than you'd like. It should be
> quite possible to use BundleUtilities on 3 separate apps in 3 separate
> install tree sub-directories. Then creating separate installers for
> them might be quite a challenge with CPack. A single installer, or a
> component-aware installer is quite easy. Three separate ones usually
> come from three separate projects.
> 
> It begins to sound as though it might be easier to deal with your
> three exes if they were in 3 separate projects...
> 
> Nothing that I'm aware of will help you make what you want to do
> "quick+easy". It shouldn't be hard or difficult really, but if you
> want to keep your current structure, then writing scripts to do the
> installing and packaging is do-able, although likely more
> time-consuming than you're hoping for.
> 
> 
> HTH,
> David
> 
> 
> On Wed, Apr 4, 2012 at 12:55 PM,   wrote:
>> Hello,
>> 
>> I want to create multiple installers within a project.
>> 
>> So, for example if the following files are created:
>> Bin1.exe
>> Bin2.exe
>> Bin3.exe
>> Lib1.dll
>> Lib2.dll
>> Lib3.dll
>> 
>> Now I would like to have 3 Installers:
>> 1.) contains:
>> Bin1.exe
>> Lib1.dll
>> Lib2.dll
>> 
>> 2.) contains:
>> Bin2.exe
>> Lib2.dll
>> Lib3.dll
>> 
>> 3.) contains:
>> Bin3.exe
>> Lib1.dll
>> Lib2.dll
>> Lib3.dll
>> 
>> I have each binary/library in the install command as followed:
>> INSTALL(TARGET Bin1 RUNTIME DESTINATION .)
>> 
>> After that I also want to run BundleUtilities for each binary/library to get 
>> the dependencies.
>> 
>> Is this possible?
>> 
>> Thanks in advance
>> 
>> Best Regards
>> NoRulez
>> --
>> 
>> 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] Multiple Installers in one project

2012-04-04 Thread David Cole
The answer to the question "is this possible?" is almost nearly always
"yes, of course."

But in this case, it may be more work than you'd like. It should be
quite possible to use BundleUtilities on 3 separate apps in 3 separate
install tree sub-directories. Then creating separate installers for
them might be quite a challenge with CPack. A single installer, or a
component-aware installer is quite easy. Three separate ones usually
come from three separate projects.

It begins to sound as though it might be easier to deal with your
three exes if they were in 3 separate projects...

Nothing that I'm aware of will help you make what you want to do
"quick+easy". It shouldn't be hard or difficult really, but if you
want to keep your current structure, then writing scripts to do the
installing and packaging is do-able, although likely more
time-consuming than you're hoping for.


HTH,
David


On Wed, Apr 4, 2012 at 12:55 PM,   wrote:
> Hello,
>
> I want to create multiple installers within a project.
>
> So, for example if the following files are created:
> Bin1.exe
> Bin2.exe
> Bin3.exe
> Lib1.dll
> Lib2.dll
> Lib3.dll
>
> Now I would like to have 3 Installers:
> 1.) contains:
> Bin1.exe
> Lib1.dll
> Lib2.dll
>
> 2.) contains:
> Bin2.exe
> Lib2.dll
> Lib3.dll
>
> 3.) contains:
> Bin3.exe
> Lib1.dll
> Lib2.dll
> Lib3.dll
>
> I have each binary/library in the install command as followed:
> INSTALL(TARGET Bin1 RUNTIME DESTINATION .)
>
> After that I also want to run BundleUtilities for each binary/library to get 
> the dependencies.
>
> Is this possible?
>
> Thanks in advance
>
> Best Regards
> NoRulez
> --
>
> 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] Forcing project to be included in a solution?

2012-04-04 Thread David Cole
Sure, just use add_custom_target without the "ALL" argument. If you
don't use "ALL", then the project is completely disconnected from
ALL_BUILD and everything else, and will only be triggered when you
explicitly build that target/project.


HTH,
David


On Wed, Apr 4, 2012 at 12:53 PM, Robert Dailey  wrote:
> Hi,
>
> I have a custom target that just runs some commands that have nothing to do
> with building source. For convenience, when generating visual studio
> projects, I'd like for that target to be included in the SLN generated by
> project() but I don't want to make it a dependency, since that would force
> it to build when I build any other project in the solution (I think).
>
> Is there a way to make a vcproj be included in a sln without it building as
> part of the dependency chain?
>
> Thanks in advance.
>
> --
>
> 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] Multiple Installers in one project

2012-04-04 Thread norulez
Hello,

I want to create multiple installers within a project.

So, for example if the following files are created:
Bin1.exe
Bin2.exe
Bin3.exe
Lib1.dll
Lib2.dll
Lib3.dll

Now I would like to have 3 Installers:
1.) contains:
Bin1.exe
Lib1.dll
Lib2.dll

2.) contains:
Bin2.exe
Lib2.dll
Lib3.dll

3.) contains:
Bin3.exe
Lib1.dll
Lib2.dll
Lib3.dll

I have each binary/library in the install command as followed:
INSTALL(TARGET Bin1 RUNTIME DESTINATION .)

After that I also want to run BundleUtilities for each binary/library to get 
the dependencies.

Is this possible?

Thanks in advance

Best Regards
NoRulez
--

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] Forcing project to be included in a solution?

2012-04-04 Thread Robert Dailey
Hi,

I have a custom target that just runs some commands that have nothing to do
with building source. For convenience, when generating visual studio
projects, I'd like for that target to be included in the SLN generated by
project() but I don't want to make it a dependency, since that would force
it to build when I build any other project in the solution (I think).

Is there a way to make a vcproj be included in a sln without it building as
part of the dependency chain?

Thanks in advance.
--

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] granular preprocessor defiitions

2012-04-04 Thread Brad King

On 4/3/2012 9:33 PM, Christoph Anton Mitterer wrote:

Actually what I'd prefer most if add_definitions (and perhaps even
include_directories) could be set in a per file context[0].


add_definitions is the original interface and uses -D in its syntax for
historical reasons.  The earliest quick-and-dirty implementation allowed
arbitrary flags so people started abusing it.  Then we had to support
such projects for compatibility.

These days you can set the COMPILE_DEFINITIONS property on a per-directory,
per-target, and per-source basis (and even per-configuration):

 
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_dir:COMPILE_DEFINITIONS
 
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:COMPILE_DEFINITIONS
 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_sf:COMPILE_DEFINITIONS

CMake 2.8.8 adds support for per-target INCLUDE_DIRECTORIES.

-Brad
--

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] NSIS, CPACK_PACKAGE_EXECUTABLES and parameters

2012-04-04 Thread David Cole
On Wed, Apr 4, 2012 at 6:27 AM, Jonatan Wallmander  wrote:
> On 04/03/2012 06:32 PM, Eric Noulard wrote:
>>
>> 2012/4/3 David Cole:
>>>
>>> On Tue, Apr 3, 2012 at 11:45 AM, Eric Noulard
>>>  wrote:

 2012/4/3 Jonatan Wallmander:
>
> Hi,
>
> I'm on cmake version 2.8.5
>
> I looked in the changelog and couldn't find this, so here goes:
>
>
>  From what I can tell, NSIS with CPACK_PACKAGE_EXECUTABLES and giving
> parameters to the executable isn't supported.
>
> CMakeLists.txt:
> set(CPACK_PACKAGE_EXECUTABLES "my_executable -f;My Executable")
>
> Resulting row in the cpack NSIS cache file:
>
> CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\My Executable.lnk"
> "$INSTDIR\.\my_executable -f.exe"
>
> I propose 2 possible solutions:
>
> 1. (best option IMO)
>
> Add support for a 3rd parameter for flags, like so:
> set(CPACK_PACKAGE_EXECUTABLES "my_executable;My Executable;-f")
>
> Since executables actually CAN have spaces in them, this would be best.

 The trouble is the "S" of CPACK_PACKAGE_EXECUTABLES means you can
 currently give something like:

 set(CPACK_PACKAGE_EXECUTABLES "my_exe1;My Exe1;my_exe2;My Exe2")

 so that it will be hard to maintain backward compatibility with option1.

> 2. (secondary option)
> Add support for parsing the executable on spaces, everything after the
> first
> space goes last in the call.
>
> I.e. set(CPACK_PACKAGE_EXECUTABLES "my_executable -f;My Executable")

 Then I may suggest a 3rd option

 set(CPACK_PACKAGE_EXECUTABLES "my_executable;my_executable_ARGS -f;My
 Executable")

 that way we can check from the value right after "executable" that
 ARGS are provided for
 the preceding executable, so that the new pattern would be:

 set(CPACK_PACKAGE_EXECUTABLES
 ";[_ARGS;]")

 Beware of the fact that currently NSIS generator is not the only CPack
 generator that uses
 CPACK_PACKAGE_EXECUTABLES OSXX11 uses it as well.

 Moreover the (in-source) code comment seems outdated or partially
 wrong since ones can read:

 cmCPackLogger(cmCPackLog::LOG_ERROR,
        "CPACK_PACKAGE_EXECUTABLES should contain pairs of
  and "
        "."<<  std::endl);

 AFAIK, there is no "icon" here just the name of the menu entry?

 --
 Erk
 Le gouvernement représentatif n'est pas la démocratie --
 http://www.le-message.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
>>>
>>>
>>> Correct: "" should be">> menu>"
>>
>> Hopefully the builtin doc is better than the code comment and error
>> message:
>>
>> CPACK_PACKAGE_EXECUTABLES
>>        Lists each of the executables and associated text label to be used
>> to
>>        create Start Menu shortcuts.
>>
>>        For example, setting this to the list ccmake;CMake will create a
>>        shortcut named "CMake" that will execute the installed executable
>>        ccmake.  Not all CPack generators use it (at least NSIS and OSXX11
>>        do).
>>
>>> But we cannot easily change the meaning of CPACK_PACKAGE_EXECUTABLES.
>>
>> Yes right, this one seems ill-named.
>>
>> The best we can do here may be to create a new meaningfull one
>> and flag this one as "deprecated" but keep it for backward-compatibility
>> reason.
>>
>> There is no urgency here, but if we were to "extend" this feature may
>> be beginning
>> to use a new var would be better.
>>
>
> Yes, it's a "would nice to have".
>
> For now I'm using the kind of ugly (copy&paste from project code)
>
> set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
>    CreateShortCut \\\"$SMPROGRAMS$STARTMENU_FOLDERVSXu Player
> Fullscreen.lnk\\\" \\\"$INSTDIR.vsxu_player.exe \\\" -f
> ")
> set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
>    Delete \\\"$SMPROGRAMS$STARTMENU_FOLDERVSXu Player
> Fullscreen.lnk\\\"
>
> ")

It may be ugly... but it's exactly the right way to do it unless you
want to provide your own override of the input file for the NSIS
installer generator.

Glad you got it working.


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] NSIS, CPACK_PACKAGE_EXECUTABLES and parameters

2012-04-04 Thread Jonatan Wallmander

On 04/03/2012 06:32 PM, Eric Noulard wrote:

2012/4/3 David Cole:

On Tue, Apr 3, 2012 at 11:45 AM, Eric Noulard  wrote:

2012/4/3 Jonatan Wallmander:

Hi,

I'm on cmake version 2.8.5

I looked in the changelog and couldn't find this, so here goes:


 From what I can tell, NSIS with CPACK_PACKAGE_EXECUTABLES and giving
parameters to the executable isn't supported.

CMakeLists.txt:
set(CPACK_PACKAGE_EXECUTABLES "my_executable -f;My Executable")

Resulting row in the cpack NSIS cache file:

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\My Executable.lnk"
"$INSTDIR\.\my_executable -f.exe"

I propose 2 possible solutions:

1. (best option IMO)

Add support for a 3rd parameter for flags, like so:
set(CPACK_PACKAGE_EXECUTABLES "my_executable;My Executable;-f")

Since executables actually CAN have spaces in them, this would be best.

The trouble is the "S" of CPACK_PACKAGE_EXECUTABLES means you can
currently give something like:

set(CPACK_PACKAGE_EXECUTABLES "my_exe1;My Exe1;my_exe2;My Exe2")

so that it will be hard to maintain backward compatibility with option1.


2. (secondary option)
Add support for parsing the executable on spaces, everything after the first
space goes last in the call.

I.e. set(CPACK_PACKAGE_EXECUTABLES "my_executable -f;My Executable")

Then I may suggest a 3rd option

set(CPACK_PACKAGE_EXECUTABLES "my_executable;my_executable_ARGS -f;My
Executable")

that way we can check from the value right after "executable" that
ARGS are provided for
the preceding executable, so that the new pattern would be:

set(CPACK_PACKAGE_EXECUTABLES
";[_ARGS;]")

Beware of the fact that currently NSIS generator is not the only CPack
generator that uses
CPACK_PACKAGE_EXECUTABLES OSXX11 uses it as well.

Moreover the (in-source) code comment seems outdated or partially
wrong since ones can read:

cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_PACKAGE_EXECUTABLES should contain pairs of  and "
"."<<  std::endl);

AFAIK, there is no "icon" here just the name of the menu entry?

--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.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


Correct: "" should be""

Hopefully the builtin doc is better than the code comment and error message:

CPACK_PACKAGE_EXECUTABLES
Lists each of the executables and associated text label to be used to
create Start Menu shortcuts.

For example, setting this to the list ccmake;CMake will create a
shortcut named "CMake" that will execute the installed executable
ccmake.  Not all CPack generators use it (at least NSIS and OSXX11
do).


But we cannot easily change the meaning of CPACK_PACKAGE_EXECUTABLES.

Yes right, this one seems ill-named.

The best we can do here may be to create a new meaningfull one
and flag this one as "deprecated" but keep it for backward-compatibility reason.

There is no urgency here, but if we were to "extend" this feature may
be beginning
to use a new var would be better.



Yes, it's a "would nice to have".

For now I'm using the kind of ugly (copy&paste from project code)

set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
CreateShortCut \\\"$SMPROGRAMS$STARTMENU_FOLDERVSXu Player 
Fullscreen.lnk\\\" \\\"$INSTDIR.vsxu_player.exe \\\" -f

")
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
Delete \\\"$SMPROGRAMS$STARTMENU_FOLDERVSXu Player 
Fullscreen.lnk\\\"

")


--

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] CustomTargets in separate VS folders?

2012-04-04 Thread Petr Kmoch
Hi NoRulez.

Yes, it's possible. It's a two-step process.

First, you need to set the global cmake property USE_FOLDERS to true;
this enables support for Visual Studio Solution Filters (project
grouping). Then, you can set a target's FOLDER property to put it into
a specific (sub-)folder.

Best,

Petr

On Wed, Apr 4, 2012 at 9:26 AM,   wrote:
> Hello,
>
> is it possible to move custom targets (add_custom_target) in subfolders in 
> visual studio, like source_group's?
>
> Thanks in advance
>
> Best Regards
> NoRulez
--

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] CustomTargets in separate VS folders?

2012-04-04 Thread norulez
Hello,

is it possible to move custom targets (add_custom_target) in subfolders in 
visual studio, like source_group's?

Thanks in advance

Best Regards
NoRulez
--

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