Re: [CMake] Question regarding source tree structure and how to find libraries easily within that structure

2012-02-28 Thread m.hergarden

On 02/26/2012 09:18 AM, Andreas Guther wrote:

Hello,

I'm justing starting to learn/use CMake and I have a question regarding the 
usage of it in regards of source tree structure and library usage.

I have the following folder structure:

Root
Bin
Win32X86Debug
Win32X86Release
...
Lib
Win32X86Debug
Win32X86Release
...
Source
ace
Application_1
Application_2
boost
Library_1
Library_2
Library_3
...
Tools
…

I'd like to point out the structure within "Source". In the source directory there are libraries that may be used by one or more 
applications. That means for example that "Application_1" may use "Library_1" and "Library_3" and 
"Application_2" may use "Library_1" and "Library_2".

I have currently no idea how I should solve this without creating a find module 
for every library in the tree. Is there any other solution than creating find 
modules I can use?
If there is really no other (good) solution than creating find modules, is it 
possible to place the find modules (Library_n.cmake files, right?) within the 
library folders? I ask this, because I think it would make it much more easy to 
maintain them.

Kind regards,
Andreas
--

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
Is there a reason you can't use the 'include_directories' and 
'link_directories' commands to add the correct linkpaths?


Micha

--

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] Start Menu folders and CPACK_NSIS_MENU_LINKS

2012-02-28 Thread Kyle Shannon
I am trying to install two sub folders in my start menu links.  I know that
(I think) CPACK_NSIS_MENU_LINKS doesn't support creating folders.  I tried
using CPACK_NSIS_EXTRA_INSTALL, and that worked great, but my uninstaller
won't remove anything created in that SET call.  Here is my code:

SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
CreateDirectory \\\"$SMPROGRAMS$STARTMENU_FOLDERTutorials\\\"
CreateDirectory \\\"$SMPROGRAMS$STARTMENU_FOLDERDocuments\\\"
CreateShortCut
\\\"$SMPROGRAMS$STARTMENU_FOLDERTutorialsTutorial 1.lnk\\\"
\\\"$INSTDIRsharewindninjadoctutorialsWindNinja_Tutorial1.pdf\\\"
CreateShortCut
\\\"$SMPROGRAMS$STARTMENU_FOLDERTutorialsTutorial 2.lnk\\\"
\\\"$INSTDIRsharewindninjadoctutorialsWindNinja_Tutorial2.pdf\\\"
CreateShortCut
\\\"$SMPROGRAMS$STARTMENU_FOLDERTutorialsTutorial 3.lnk\\\"
\\\"$INSTDIRsharewindninjadoctutorialsWindNinja_Tutorial3.pdf\\\"
CreateShortCut
\\\"$SMPROGRAMS$STARTMENU_FOLDERTutorialsTutorial 4.lnk\\\"
\\\"$INSTDIRsharewindninjadoctutorialsWindNinja_Tutorial4.pdf\\\"

CreateShortCut \\\"$SMPROGRAMS$STARTMENU_FOLDERDocumentsCLI
Instructions.lnk\\\"
\\\"$INSTDIRsharewindninjadocCLI_instructions.pdf\\\"
CreateShortCut \\\"$SMPROGRAMS$STARTMENU_FOLDERDocumentsArcMap
Instructions.lnk\\\"
\\\"$INSTDIRsharewindninjadocDisplaying_wind_vectors_in_ArcMap.pdf\\\"
CreateShortCut \\\"$SMPROGRAMS$STARTMENU_FOLDERDocumentsArcView
Instructions.lnk\\\"
\\\"$INSTDIRsharewindninjadocDisplaying_wind_vectors_in_ArcView.pdf\\\"
CreateShortCut \\\"$SMPROGRAMS$STARTMENU_FOLDERDocumentsDEM
Download Instructions.lnk\\\"
\\\"$INSTDIRsharewindninjadocRDDS_DEM_download_instructions.pdf\\\"
CreateShortCut \\\"$SMPROGRAMS$STARTMENU_FOLDERExample
Files.lnk\\\" \\\"$INSTDIRsharewindninjaexample-files\\\" ")


SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
Delete \\\"$SMPROGRAMS$MUI_TEMPTutorialsTutorial 1.lnk\\\"
Delete \\\"$SMPROGRAMS$MUI_TEMPTutorialsTutorial 2.lnk\\\"
Delete \\\"$SMPROGRAMS$MUI_TEMPTutorialsTutorial 3.lnk\\\"
Delete \\\"$SMPROGRAMS$MUI_TEMPTutorialsTutorial 4.lnk\\\"
Delete \\\"$SMPROGRAMS$MUI_TEMPDocumentsCLI Instructions.lnk\\\"
Delete \\\"$SMPROGRAMS$MUI_TEMPDocumentsArcMap
Instructions.lnk\\\"
Delete \\\"$SMPROGRAMS$MUI_TEMPDocumentsArcView
Instructions.lnk\\\"
Delete \\\"$SMPROGRAMS$MUI_TEMPDocumentsDEM Download
Instructions.lnk\\\"
Delete \\\" $SMPROGRAMS$MUI_TEMPExample Files.lnk\\\"
RMDir \\\"$SMPROGRAMS$MUI_TEMPTutorials\\\"
RMDir \\\"$SMPROGRAMS$MUI_TEMPDocuments\\\" ")

Like I said, it creates all of the shortcuts fine, but none are removed.  I
am probably missing some silly typo, but I also looked at the nsis script
and it looked pretty good to me.  Any help would be appreciated.

kss

/**
 *
 * Kyle Shannon
 * ksshan...@gmail.com
 *
 */
--

Powered by www.kitware.com

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

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

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

Re: [CMake] Can't generate Release build in Visual Studio 9

2012-02-28 Thread Mauricio Klein
Hello everybody!

Sorry for the late in reply. I had a 'miss configured' filter dropping all
my mails.

Thanks for all replies sent. All of them have great hints on how to solve
this problem.
But, after the Thielemans reply, i decided that the build type must be
selected from inside the Visual Studio, giving the liberty to decide the
proper way in face the problem.

Thanks again for all the replies!

On Fri, Feb 24, 2012 at 4:39 PM, John Drescher  wrote:

> > 2. Do batch building. I do this option. Look at the cmake --build command
> >
>
> Here is an example of this for one of my current projects (not exactly
> what I do but close enough):
>
> rem configure
> pushd .
> cd X:\64Bit\VC.100\Qt\StudyManager
> cmake X:/CMakeBased/Qt/StudyManager
> popd
>
> rem build the nsis package.
> cmake --build X:/64Bit/VC.100/Qt/StudyManager --config Release --target
> PACKAGE
>
> X:/64Bit/VC.100/Qt/StudyManager is the build folder containing the
> .sln CMakeCache.txt ...
>
>
> John
>



-- 
Best regards,

Maurício Souza Klein.
--

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 Nsis not installing libraries

2012-02-28 Thread Mauricio Klein
Hello Mr.Noulard!

Sorry for the late in reply. I had a 'miss configured' filter in my e-mail
dropping all mails.

1) Thanks for the explanation! I will take a look at the "BundleUtilities",
once this is exactly what i need: a autonomous application.

2) I'm using CMake version '2.8.7'.

In Linux, i don't have problems with dependencies, once i'm generating
'Deb' and 'RPM' packages with CPack, and the dependencies are solved by the
package manager of the OS.

But in Windows i'm having troubles, specially because i'm using
'Pthreads-Win32' instead the Threads implemented by the Windows API, and,
once there isn't a proper installer to 'Pthreads-Win32' (OpenSSL has!), i
can't rely in a library installed elsewhere then the Installation directory.

Thanks in advance for your attention!

On Mon, Feb 27, 2012 at 7:47 PM, Eric Noulard wrote:

> 2012/2/27 Mauricio Klein :
> > Hello everybody!
> >
> > I'm creating a NSIS package using CPack to install my software.
> >
> > The code is compilled using Visual Studio 9, and the compilation +
> packing
> > is working well.
> >
> > But, once i install the software using the generated NSIS package, the
> > program doesn't start because NSIS did't installed the required
> libraries.
> >
> > The strange is that in my CMakeLists.txt, i tell that my binary requires
> > these libraries.
> >
> > The libraries are:
> > * OpenSSL
> > * Pthreads
> > (both found using find macros)
> >
> >
> > The piece of configuration that defines these relashionship is showed
> > bellow:
> >
> -
> > find_package(Pthreads REQUIRED)
> > find_package(OpenSSL REQUIRED)
> >
> > include_directories(${OPENSSL_INCLUDE_DIR})
> > include_directories(${PTHREADS_INCLUDE_DIR})
> >
> > install(TARGETS MyBin DESTINATION "MyBin1-0/bin")
>
>
> > install(TARGETS ${PTHREADS} DESTINATION "MyBin1-0/bin")
> > install(TARGETS ${OPENSSL} DESTINATION "MyBin1-0/bin")
>
> ${PTHREADS} and ${OPENSSL} seems wrong
> usually those are:
> ${PTHREADS_LIBRARIES}
> ${OPENSSL_LIBRARIES}
>
> moreover you cannot use install(TARGETS ) for those
> because they are not TARGET unless you somehow define
> them as IMPORTED library.
>
> Usually "third party" libs (those which are not built in your project)
> are not installed because they may be found on the host where
> your software is installed already.
>
> If you are interested in creating "autonomous" bundle
> have a look at the BundleUtilities module.
>
> > The "MyBin" binary is installed well, but the libraries of Pthreads and
> > OpenSSL not!
> >
> > Any hint??
> >
> > Thanks in advance for your attention, and any help is very welcome!
>
> May be you can tell us which version of CMake you are using
> and which system you are targeting (Windows, Linux, MacOS Xetc...)
> --
> Erk
> Le gouvernement représentatif n'est pas la démocratie --
> http://www.le-message.org
>



-- 
Best regards,

Maurício Souza Klein.
--

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] Code and API review request for Qt5 CMake files

2012-02-28 Thread Alexander Neundorf
...will reply later in detail.

Could you please go through the existing find-modules shipped with cmake which 
support COMPONENTS and make a summary of how they handle them ?

At least FindQt4.cmake be default searches all components.

Thanks
Alex
--

Powered by www.kitware.com

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

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

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


[CMake] Debug vs. Release Build Types and Configurations

2012-02-28 Thread Carlton Henderson
For a couple days now, I've been looking high and low at documentation about single-config CMAKE_BUILD_TYPE (e.g. Makefile) and multi-config CMAKE_CONFIGURATION_TYPES but I still have some questions.It seems that those variables are mutually exclusive, (depending on whether you're using single- or multi-config generator). This wasn't clear from the documentation. I had to find it in this useful mailing list thread: http://www.cmake.org/pipermail/cmake/2011-June/044836.html Am I missing some document someplace? I've read the html help, the wikiIn the case of single-config generators, does CMAKE_BUILD_TYPE the variable which fills in '' in the various property names? This is confusing, given 'CMAKE_BUILD_TYPE' and 'CMAKE_CONFIGURATION_TYPES' are mutually exclusive.Can you recommend a stellar example of a cross platform project that utilizes different built types (or multi configurations)?-Carl
--

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] CMake setting file attribute to the binary file on linux

2012-02-28 Thread vivek goel
I want to set extra file attribute to cmake binary file
Like user.comment .
Is there any module  in cmake linux version which I can to set these types
of properties ?
regards
Vivek Goel
--

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] #include and fortran dependencies

2012-02-28 Thread Brad King

On 2/28/2012 11:06 AM, Dirk vanMeeuwen wrote:

#include "fpp-Windows-definition.inc"
MODULE MSG
...
END MODULE

However, when this module MSG is used, the project build order

> generated by CMake is not correct (see attached small example).

Fortran dependencies are supported, and the Intel Fortran 12 compiler
is expected to work with the NMake Makefiles generator.

I was able to reproduce the problem.  If I remove the #if logic from
the .inc file then it works.  I think this may be a bug in the
Source/cmDependsFortran* files of CMake.  It is not handling the #if
logic correctly and tricks itself into thinking that all the code
after the #include line is being preprocessed out as if in "#if 0".
That's why the order of the lines affects the results.

I don't have time to investigate this myself but if anyone is
interested then take a look at Source/cmDependsFortranParser.y
and Source/cmDependsFortran.cxx for use of the _RuleIf, _RuleElse,
and similar functions.

-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] smarter shortcuts with NSIS

2012-02-28 Thread Eric Noulard
2012/2/28 Andrea Crotti :
> On 02/28/2012 03:42 PM, Eric Noulard wrote:
>>
>>
>>> At worst is there a way to just create my own .nsi file and use it
>>> directly?
>>> I need to create a page which simply asks for a directory to the user,
>>> and
>>> then use that to create a shortcut..
>>>
>>> Any idea (also other solutions might be fine).
>>
>> 1) Copy the current NSIS.template.in in your project.
>>     and update it the way you like.
>>
>> 2) update CMAKE_MODULE_PATH
>>     list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/packaging)
>>
>>     in order to make your NSIS.template.in in the CMAKE_MODULE_PATH
>>     (you can even use CPACK_MODULE_PATH)
>>
>> 3) run-rerun packaging an dmake sure that cpack is using your projevtc
>> specific
>>     NSIS.template.in
>>
>
> Ok thanks that's probably the best solution.
> So if I understand correctly this is more or less the same as writing my own
> nsi file,
> run configure_file on it and then add a create_custom_target for packaging,
> is that right?

Yes more or less beside the fact is CPack is doing more work than that:
  1) CPack handles CPack-private install location for you
  (including the installation of the component selected to be put
in the installer
   taken from CPACK_COMPONENTS_ALL)

  2) It prepares componentization of the installer.
 (including possible COMPONENT dependencies, display name etc...

  3) Finally if you use configure_file + add_custom_command you won't get
 all the CPACK_xxx vars CPack has :-( Because some of them my be computed
 dynamically by CPack which then does the configure_file in this context.

I forgot to mention that "NSIS.template.in" is including an auxiliary file:
"NSIS.InstallOptions.ini.in" which is configured as well.

All this is doable by hand but may not be as easy as it seems in the
general case.

> I will then probably write the file from scratch, trying to understand whaqt
> it does, because the template is quite mysterious at the moment..

Off course you'll have to learn NSIS nsi file syntax
(I may not help you for that since I have no knowledge in this area)
and I think you should have a look at the template as well
for seeking the @CPACK_XXX@ in it
Those are possibly important placeholder CPack will pre-compute for you.
(if you go with CPack and not using add_custom_command).

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


[CMake] #include and fortran dependencies

2012-02-28 Thread Dirk vanMeeuwen
Dear all,

I am quite new to cmake and just started to setup cmake for a large 
project, consisting of mainly fortran code. We use the Intel compiler, 
version 12, for windows. This compiler supports the following code:

#include "fpp-Windows-definition.inc"
MODULE MSG
...
END MODULE

However, when this module MSG is used, the project build order generated 
by CMake is not correct (see attached small example). This problem does 
not occur when the #include is placed within the module. 
Can anyone tell me if I missed some documentation on supported code blocks 
or supported compiler definitions? This problem was easily solved by 
placing all the includes within the module, which did not make any 
difference for me. But before I go on I would like to see if I will 
succeed in the end, or if the compiler is not supported yet. In that case 
it will save me a lot of trouble.

Kind regards,

Dirk van Meeuwen,

 
 
This email and any attached files ("Message") may contain confidential and/or 
privileged information. It is intended solely for the addressee(s). If you 
receive this Message in error, inform the sender by reply email, delete the 
Message and destroy any printed copy.
Any unauthorized use, distribution, or copying of this Message or any part 
thereof is prohibited. Emails are susceptible to alteration. Neither Technip 
nor any of its affiliates shall be liable for the Message if altered or 
falsified nor shall they be liable for any damage caused by any virus that 
might be transmitted with this Message.



CMAKETest.tgz
Description: Binary data
--

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] smarter shortcuts with NSIS

2012-02-28 Thread Andrea Crotti

On 02/28/2012 03:42 PM, Eric Noulard wrote:



At worst is there a way to just create my own .nsi file and use it directly?
I need to create a page which simply asks for a directory to the user, and
then use that to create a shortcut..

Any idea (also other solutions might be fine).

1) Copy the current NSIS.template.in in your project.
 and update it the way you like.

2) update CMAKE_MODULE_PATH
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/packaging)

 in order to make your NSIS.template.in in the CMAKE_MODULE_PATH
 (you can even use CPACK_MODULE_PATH)

3) run-rerun packaging an dmake sure that cpack is using your projevtc specific
 NSIS.template.in





Ok thanks that's probably the best solution.
So if I understand correctly this is more or less the same as writing my 
own nsi file,
run configure_file on it and then add a create_custom_target for 
packaging, is that right?


I will then probably write the file from scratch, trying to understand 
what it does, because

the template is quite mysterious at the moment..
--

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] smarter shortcuts with NSIS

2012-02-28 Thread Eric Noulard
2012/2/28 Andrea Crotti :
> Alright moving the include after did the trick, I get my code in the final
> nsi file, as below:
>
>
> set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
>    PageEx directory
>      DirVar PythonDir
>    PageExEnd
>
>    CreateShortCut \\\"$DESKTOP${PROJECT_NAME}.lnk\\\"
> \\\"$INSTDIRbuilt_eggrun.exe\\\" \"$PythonDirpythonw.exe\" \"\"
> \"\" \".$INSTDIR\" \"Run project ${PROJECT_NAME}\"
> ")
>
>
> The problem is that it fails for this reason:
> Error: command PageEx not valid in Section
>
> which makes sense, but is there a way to avoid that PageEx to end up in a
> section at all?
> Is that the only way to inject NSIS code?

Yes currently that's the case if you use the CMake-provided "NSIS.template.in"
but...

> At worst is there a way to just create my own .nsi file and use it directly?
> I need to create a page which simply asks for a directory to the user, and
> then use that to create a shortcut..
>
> Any idea (also other solutions might be fine).

1) Copy the current NSIS.template.in in your project.
and update it the way you like.

2) update CMAKE_MODULE_PATH
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/packaging)

in order to make your NSIS.template.in in the CMAKE_MODULE_PATH
(you can even use CPACK_MODULE_PATH)

3) run-rerun packaging an dmake sure that cpack is using your projevtc specific
NSIS.template.in



-- 
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] smarter shortcuts with NSIS

2012-02-28 Thread Andrea Crotti
Alright moving the include after did the trick, I get my code in the 
final nsi file, as below:


set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
PageEx directory
  DirVar PythonDir
PageExEnd

CreateShortCut \\\"$DESKTOP${PROJECT_NAME}.lnk\\\" 
\\\"$INSTDIRbuilt_eggrun.exe\\\" \"$PythonDirpythonw.exe\" 
\"\" \"\" \".$INSTDIR\" \"Run project ${PROJECT_NAME}\"

")


The problem is that it fails for this reason:
Error: command PageEx not valid in Section

which makes sense, but is there a way to avoid that PageEx to end up in 
a section at all?

Is that the only way to inject NSIS code?

At worst is there a way to just create my own .nsi file and use it directly?
I need to create a page which simply asks for a directory to the user, 
and then use that to create

a shortcut..

Any idea (also other solutions might be fine).
--

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] figuring out exact name of boost-regex lib to use

2012-02-28 Thread Michael Wild
Hi Bart

Please keep answers on the list, so others can also profit from the
discussion.

On 02/28/2012 01:59 PM, Bart Vandewoestyne wrote:
> On 02/28/2012 10:28 AM, Michael Wild wrote:
>> Don't do it this way. Use this:
>>
>> find_package(Boost REQUIRED COMPONENTS regex)
>> include_directories(${Boost_INCLUDE_DIRS})
>>
>> # add_executable etc...
>>
>> target_link_libraries(airspace ${Boost_LIBRARIES})
> 
> Michael,
> 
> Thanks for pointing me to the find_package command!  One more
> detail-question however: in the docs online at
> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package
> is the syntax written as:
> 
>   find_package( [version] [EXACT] [QUIET]
>[[REQUIRED|COMPONENTS] [components...]]
>[NO_POLICY_SCOPE])
> 
> Notice the [REQUIRED|COMPONENTS] from which i deduce that the
> find_package command should probably be written as
> 
>   find_package(Boost REQUIRED regex)
> 
> I tried it, and it seems to work...
> 
> Kind regards,
> Bart

You are absolutely right, I wrote my reply from memory, and got it
obviously wrong ;-)

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] figuring out exact name of boost-regex lib to use

2012-02-28 Thread Michael Wild
On 02/28/2012 10:00 AM, Bart Vandewoestyne wrote:
> Hello list,
> 
> I'm quite new to CMake, still learning my way around...  I currently
> have the following in a CMakeList.txt file:
> 
>   set(BOOST_LIBNAME "boost_regex")
>   #set(BOOST_LIBNAME "boost_regex-mt")
>   target_link_libraries(airspace ${BOOST_LIBNAME})
> 
> On some platforms, it only works if I set the Boost RegEx library name
> to "boost_regex", on others it only works with "boost_regex-mt".
> 
> Up until now, I always uncomment the correct form, depending on what
> platform I am (Linux, Cygwin,...) but this is quite annoying.  How can I
> figure out automatically the name of the Boost RegEx library to use?
> 
> Thanks!
> Bart

Don't do it this way. Use this:

find_package(Boost REQUIRED COMPONENTS regex)
include_directories(${Boost_INCLUDE_DIRS})

# add_executable etc...

target_link_libraries(airspace ${Boost_LIBRARIES})


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] figuring out exact name of boost-regex lib to use

2012-02-28 Thread Bart Vandewoestyne

Hello list,

I'm quite new to CMake, still learning my way around...  I currently 
have the following in a CMakeList.txt file:


  set(BOOST_LIBNAME "boost_regex")
  #set(BOOST_LIBNAME "boost_regex-mt")
  target_link_libraries(airspace ${BOOST_LIBNAME})

On some platforms, it only works if I set the Boost RegEx library name 
to "boost_regex", on others it only works with "boost_regex-mt".


Up until now, I always uncomment the correct form, depending on what 
platform I am (Linux, Cygwin,...) but this is quite annoying.  How can I 
figure out automatically the name of the Boost RegEx library to use?


Thanks!
Bart
--

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