Re: [CMake] Finding Boost (1.69.0)?

2018-12-15 Thread Simon Richter
Hi,

On 15.12.18 18:48, Osman Zakir wrote:

> Would the way for finding Boost that I saw before when I asked about
> doing it for version 1.68.0 also work for version 1.69.0?

Some versions of FindBoost.cmake only check a fixed list of versions.
You can extend this list by passing in e.g.

-DBoost_ADDITIONAL_VERSIONS=1.66;1.67;1.68;1.69

   Simon



signature.asc
Description: OpenPGP digital signature
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Finding Boost (1.69.0)?

2018-12-15 Thread Osman Zakir
Would the way for finding Boost that I saw before when I asked about doing it 
for version 1.68.0 also work for version 1.69.0?  If so, I could just try to 
find the archive of older threads and search for that message.  If not, please 
tell me here how to do it.  Either way, any help would be appreciated.

I'm currently trying to generate project files for Jinja2Cpp with CMake, using 
Boost version 1.69.0 this time, while using the -DBOOST_ROOT flag.  But it 
keeps saying that one or more Boost modules wasn't found and that it's using 
the submodule that comes with the Jinja2Cpp source code.
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Finding Boost in versioned layout on Linux

2018-10-24 Thread Mateusz Loskot
On Wed, 24 Oct 2018 at 22:17, Brad King  wrote:
> On 10/24/2018 01:22 PM, Mateusz Loskot wrote:
> > So, I had to bend CMake this way to find Boost for me:
> >
> > cmake -DBoost_COMPILER=-gcc5 -DCMAKE_CXX_COMPILER_ARCHITECTURE_ID=x64 ..
>
> See these issues:
>
> https://gitlab.kitware.com/cmake/cmake/issues/17701
> https://gitlab.kitware.com/cmake/cmake/issues/17702

Yes, I'm aware [1] of these, but thank you for reminder.
I meant this post as a work around related to #17701

[1] https://gitlab.kitware.com/cmake/cmake/issues/17701#note_398070

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Finding Boost in versioned layout on Linux

2018-10-24 Thread Brad King
On 10/24/2018 01:22 PM, Mateusz Loskot wrote:
> So, I had to bend CMake this way to find Boost for me:
> 
> cmake -DBoost_COMPILER=-gcc5 -DCMAKE_CXX_COMPILER_ARCHITECTURE_ID=x64 ..

See these issues:

https://gitlab.kitware.com/cmake/cmake/issues/17701
https://gitlab.kitware.com/cmake/cmake/issues/17702

-Brad
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Finding Boost in versioned layout on Linux

2018-10-24 Thread Mateusz Loskot
Hi,

I know the version layout of Boost build is preferred or
even specific to Windows, but I like it in general, ie. on Linux.
It lazily allows me to get everything built with single command:

b2 variant=debug,release address-model=32,64 --layout=versioned stage

The versioned layout impose some challenges while find_package-ing
at least I've experienced it using FindBoost.cmake from latest CMake 3.12.

For example, running CMake in Linux environment with GCC 5.5.0 for

find_package(Boost 1.65.0 REQUIRED COMPONENTS system)

will attempt to search for

...
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1420 ]
guessed _boost_COMPILER = -gcc55
...
-- [ /usr/local/share/cmake-3.12/Modules/FindBoost.cmake:1760 ]
Searching for SYSTEM_LIBRARY_RELEASE:
boost_system-gcc55-mt-1_69;boost_system-gcc55-mt;boost_system-mt-1_69;boost_system-mt;boost_system
...

The issue is that b2  generated names like

libboost_system-gcc5-mt-d-x64-1_69.a

So, I had to bend CMake this way to find Boost for me:

cmake -DBoost_COMPILER=-gcc5 -DCMAKE_CXX_COMPILER_ARCHITECTURE_ID=x64 ..

I'm not asking any specific questions here.
I just thought that might be helpful to other users of FindBoost.cmake.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] finding boost

2015-03-03 Thread Raymond Wan
Hi Dave,


On Tue, Mar 3, 2015 at 6:20 PM, Dave Yost d...@yost.com wrote:
 I’m having trouble with the find_package documentation w.r.t. boost.

 I can’t divine how to get find_package to look for boost in various places it 
 might be on the various systems where we do builds. I know boost looks in 
 several places, but I need to add to that list.

 Boost might be in any of these places
  /usr/local/include/boost
  /usr/local/boost/1.57.0/include
  /usr/local/boost/1.56.0/include   etc.
  /opt/local/include/boost
  
 /opt/local/var/macports/build/_private_tmp_boost149_boost/boost/work/boost_1_49_0/boost/

 I tried modifying this in various ways according to the docs to no avail.

 find_package(Boost ${BOOST_VERSION} EXACT
 COMPONENTS filesystem program_options serialization system
 REQUIRED)


If I'm not mistaken, the user can give hints to FindBoost via the
BOOST_ROOT environment variable.  Regardless of whether a user is
using CMake or not, s/he should be setting this environment variable
anyways.  Take a look at this:

http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html

In particular, the third green-background section on that page.

Ray
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] finding boost

2015-03-03 Thread Dave Yost

Hi.

I’m having trouble with the find_package documentation w.r.t. boost.

I can’t divine how to get find_package to look for boost in various places it 
might be on the various systems where we do builds. I know boost looks in 
several places, but I need to add to that list.

Boost might be in any of these places
 /usr/local/include/boost
 /usr/local/boost/1.57.0/include
 /usr/local/boost/1.56.0/include   etc.
 /opt/local/include/boost
 
/opt/local/var/macports/build/_private_tmp_boost149_boost/boost/work/boost_1_49_0/boost/

I tried modifying this in various ways according to the docs to no avail.

find_package(Boost ${BOOST_VERSION} EXACT 
COMPONENTS filesystem program_options serialization system
REQUIRED)

Thanks
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] Finding Boost 1.37 with Cmake 2.6.2 on windows

2008-11-21 Thread Gerrick Bivins
Hello,

I'm trying to use CMake to build one of my utilities and I'm having
problems finding Boost (1.37).

I have a top-level CMakeList.txt file as follows:

=

##Top level build for myUtilTest

cmake_minimum_required(VERSION 2.6)

project (myUtilTest CXX)

set(CMAKE_VERBOSE_MAKEFILE TRUE CACHE BOOL Verbose output FORCE)

 

add_subdirectory( ${PROJECT_SOURCE_DIR}/src )

#add_subdirectory( ${PROJECT_SOURCE_DIR}/include )

 

#local include directory

include_directories(${PROJECT_SOURCE_DIR})

 

 

In my src directory I have the following CMakeList.txt file:

 

#

-

# Find Boost - it is a required package

#

-

#include(FindBoost)

find_package(Boost COMPONENTS iostreams filesystem regex system
date_time REQUIRED) 

IF (Boost_FOUND)

message(FOUND Boost : ${Boost_LIBRARIES})

INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})

LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})

ADD_DEFINITIONS(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})

ENDIF (Boost_FOUND)

 

#

-

# Find VTK - it is a required package

#

-

find_package(VTK REQUIRED)

include(${VTK_USE_FILE})

include_directories(${VTK_INCLUDE_DIR})

 

#local include directory

include_directories(${PROJECT_SOURCE_DIR})

 

file( GLOB SRCS relative . *.cxx )

 

#create a program executable

add_executable(myUtilTest ${SRCS})

#link

target_link_libraries(myUtilTest vtkCommon vtkRendering vtkGraphics
vtkWidgets vtkParallel vtkIO ${Boost_LIBRARIES})

#install

install (TARGETS myUtilTest

 RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )

 

My problem is that boost libraries are never found. When I search for
them on disk via the CMake GUI, after loading them all in and hitting
configure, they are still not found and CMake resets the values to
NOT_FOUND.I'm a noob so this is definitely an issue of user error but
I haven't been able to find an example that works. I also googled and
found that there were some issues with FindBoost but it looked like they
may have been resolved.

Any suggestions on how to fix this would be greatly appreciated!

Thanks

Gerrick

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Finding Boost 1.37 with Cmake 2.6.2 on windows

2008-11-21 Thread Andreas Pakulat
On 21.11.08 14:16:04, Gerrick Bivins wrote:
 I'm trying to use CMake to build one of my utilities and I'm having
 problems finding Boost (1.37).


 #include(FindBoost)

This is wrong.
 
 find_package(Boost COMPONENTS iostreams filesystem regex system
 date_time REQUIRED) 

This one needs a 

set(Boost_ADDITIONAL_VERSION 1.37)

before it as is documented in the cmake manpage (which I don't know how to
access on windows unfortunately) and the top of the FindBoost.cmake file.

The module itself only knows about versions up to 1.36.1 as boost thinks
its funny to include the version number into the library names. The
variable allows to support later versions.

Andreas

-- 
You are fighting for survival in your own sweet and gentle way.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Finding Boost for Windows and Linux.

2006-06-19 Thread Andrew Maclean

Bill, If you think it is generally OK and useful to people, tell me what improvements are needed before it would beeligible for inclusion in the modules directory of CMake.
I have had a go at writing a FindBoost.cmake file (attached). It tries to find where the boost includes are using educated guesses and then tries to determine the path to the library files. The problem with windows is that there is no default library path.


Is there a better way of doing this for both windows and linux? I have searched the web but most examples are just for linux and only seem to do part of the job.

The rationalefor my solution is outlined below.

I think my solution is a bit rough around the edges butpointing in the right direction.For example:
If I have a path like /usr/local/include/boost-1_33_1/boost
How can I get the /usr/local part so I can append /lib to it?

The problem is that I could have a paths like:
/user/local/include/boost/user/include/boost-1_33_1/boost
/user/local/include/boostC:\boost\include\boostC:\boost\include\boost\boost-1_33_1\boost

My problem is that I want to set up a BOOST_INCLUDE_PATH (easy, just look for a file like config.hpp).
The hard part is determining the library path it is either:
${BOOST_INCLUDE_PATH}/../../../lib
or
${BOOST_INCLUDE_PATH}/../../lib
You can see from the attached code that I used a series of IF ( EXISTS ...
Is this the best way to do this?

If people have comments or can improve on it, I would welcomeany input!

Andrew
-- ___Andrew J. P. MacleanCentre for Autonomous SystemsThe Rose Street Building J04The University of Sydney2006NSWAUSTRALIAPh: +61 2 9351 3283 
Fax: +61 2 9351 7474URL: http://www.cas.edu.au/___
#-
# Find the Boost includes and libraries.
# The following variables are set if Boost is found.  If Boost is not
# found, BOOST_FOUND is set to false.
#  BOOST_FOUND - Set to true when Boost is found.
#  BOOST_INCLUDE_PATH  - the path to where the boost include files are.
#  BOOST_LIBRARY_PATH  - The path to where the boost library files are.
#
# Note:
#  1) If you are just using the boost headers, then you do not need to use
# BOOST_LIBRARY_PATH in your CMakeLists.txt file.
#  2) If you are using Linux, and the boost libraries are in the default
#  system library paths then you do not need to use BOOST_LIBRARY_PATH.
#
# Usage:
# In your CMakeLists.txt file do something like this:
# ...
# # Boost
# INCLUDE(FindBoost.cmake)
# ...
# INCLUDE_DIRECTORIES (${BOOST_INCLUDE_PATH})
# ...
# #-
# # Paths to library files.
# IF ( WIN32 )
#  LINK_DIRECTORIES (
#${BOOST_LIB_PATH}
#  )
#ELSE ( WIN32 )
# If your boost libraries are not in the system path, add them to a 
LINK_DIRECTORIES statement here:
#ENDIF ( WIN32 )
#
# Method:
# We are finding a particular boost include file and then assuming that
# the directory structure follows something like this:
# ${BOOST_PATH}/include/boost-x-y-z/boost
# ${BOOST_PATH}/lib
#or:
# ${BOOST_PATH}/include/boost-x-y-z/boost
# ${BOOST_PATH}/lib
# Where ${BOOST_PATH} is defined by ${BOOST_DIR_SEARCH1} below.

# Construct consistent error messages for use below.
SET(BOOST_INCLUDE_PATH_DESCRIPTION directory containing the boost include 
files was not found. This could mean that Boost is not installed.)

# Search these directories.
SET(BOOST_DIR_SEARCH1
   /usr;
   /usr/local;
)
IF ( WIN32 )
  # Assume this path exists.
  SET ( BOOST_DIR_SEARCH1
${BOOST_DIR_SEARCH1}
;C:/boost
  )
ENDIF ( WIN32 )
STRING(REGEX REPLACE /; ; BOOST_DIR_SEARCH2 ${BOOST_DIR_SEARCH1})

# Construct a set of paths relative to the system search path.
SET(BOOST_DIR_SEARCH )
FOREACH(dir ${BOOST_DIR_SEARCH2})
  SET(BOOST_DIR_SEARCH ${BOOST_DIR_SEARCH}
${dir}/include/boost-1_33_2/boost
${dir}/include/boost-1_33_1/boost
${dir}/include/boost-1_33/boost
${dir}/include/boost
  )
ENDFOREACH(dir)

#
# Look for an installation or build tree.
#
FIND_PATH(BOOST_INCLUDE_PATH config.hpp

  # Look in places relative to the system executable search path.
  ${BOOST_DIR_SEARCH}

  # Look in standard UNIX install locations.
  /usr/local/include/boost
  /usr/include/boost

  # Help the user find it if we cannot.
  DOC The ${BOOST_INCLUDE_PATH_DESCRIPTION}
  )

SET(BOOST_FOUND NOTFOUND)
IF ( BOOST_INCLUDE_PATH )
  # The user may not have installed any libraries.
  SET (BOOST_FOUND 1 )
  GET_FILENAME_COMPONENT(BOOST_LIBRARY_PATH ${BOOST_INCLUDE_PATH} PATH)
  GET_FILENAME_COMPONENT(BOOST_LIBRARY_PATH ${BOOST_LIBRARY_PATH} PATH)
  IF ( EXISTS ${BOOST_LIBRARY_PATH}/lib )
SET (  BOOST_LIBRARY_PATH ${BOOST_LIBRARY_PATH}/lib CACHE PATH The path to 
the Boost library files.  )
  ELSE ( EXISTS ${BOOST_LIBRARY_PATH}/lib )
GET_FILENAME_COMPONENT(BOOST_LIBRARY_PATH ${BOOST_LIBRARY_PATH} PATH)
 

Re: [CMake] Finding Boost for Windows and Linux.

2006-06-19 Thread Brad King

Andrew Maclean wrote:
Bill, If you think it is generally OK and useful to people, tell me what 
improvements are needed before it would be eligible for inclusion in the 
modules directory of CMake.


This will definately be a useful contribution.

I have had a go at writing a FindBoost.cmake file (attached). It tries 
to find where the boost includes are using educated guesses and then 
tries to determine the path to the library files. The problem with 
windows is that there is no default library path.
 
Is there a better way of doing this for both windows and linux? I have 
searched the web but most examples are just for linux and only seem to 
do part of the job.


Does Boost suggest that any environment variables be set for its 
location?  Does it set any registry entries on Windows?



The rationale for my solution is outlined below.
 
I think my solution is a bit rough around the edges but pointing in the 
right direction. For example:

If I have a path like /usr/local/include/boost-1_33_1/boost
How can I get the /usr/local part so I can append /lib to it?


Using GET_FILENAME_COMPONENT is fine, but you may not need to strip as 
much as you are now.



The problem is that I could have a paths like:
 /user/local/include/boost
 /user/include/boost-1_33_1/boost
 /user/local/include/boost
 C:\boost\include\boost
 C:\boost\include\boost\boost-1_33_1\boost
 
My problem is that I want to set up a BOOST_INCLUDE_PATH (easy, just 
look for a file like config.hpp).

The hard part is determining the library path it is either:
${BOOST_INCLUDE_PATH}/../../../lib
or
${BOOST_INCLUDE_PATH}/../../lib


What determines during boost installation which of these paths is used? 
 I'm guessing it is whether the version number was included in the 
install directory..



 You can see from the attached code that I used a series of IF ( EXISTS ...

Is this the best way to do this?
# Usage:
# In your CMakeLists.txt file do something like this:
# ...
# # Boost
# INCLUDE(FindBoost.cmake)


This should be

FIND_PACKAGE(Boost)

The module should also pay attention to the variable 
Boost_FIND_REQUIRED.  If it is set and boost is not found it should exit 
with a MESSAGE(FATAL_ERROR ...).  The variable is set by the 
FIND_PACKAGE command when it loads the module if it is called like this:


FIND_PACKAGE(Boost REQUIRED)

For finding the include path, look at the PATH_SUFFIXES option of the 
FIND_PATH command.  You should be able to find the headers like this:


FIND_PATH(BOOST_INCLUDE_DIR
  NAMES boost/config.hpp
  PATH_SUFFIXES boost-1_33_1 ...)

Then you will not need to strip the boost/ part of the path, and the 
sub-path boost-1_33_1 will be searched underneath every other search 
path specified.  Then you can use code like


IF(${BOOST_INCLUDE_DIR} MATCHES boost-[0-9]+_[0-9]+)

to test how many levels need to be stripped to find the PREFIX/lib 
directory.


-Brad
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake