[CMake] Change project name based on architecture

2016-11-03 Thread B. Scott Harper
I have a project where I manage multiple architectures and switch back and
forth frequently for testing. Full disclosure, I'm using Visual Studio. And
since I cannot generate a single solution with multiple architectures (per
everything I've found searching Google and the mailing list), I have two
separate solution files (one each for x86 and x64). I often open a solution
using the recent solutions menu, and it would be a lot easier if I could
name the solution (cmake's "project()" command) differently for each
architecture I use.

I tried simply

if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(PLATFORM_TARGET "x64")
else()
set(PLATFORM_TARGET "x86")
endif()

project(My_Project_${PLATFORM_TARGER})

...however it seems that CMAKE_SIZEOF_VOID_P isn't filled out until AFTER
the project command, so I can't use that variable as part of my
project/solution name.

Is there another way to accomplish this? Google only returns documentation
on the project command in general and the above method seems to be the
preferred means of detecting build architecture.

Cheers,
-- Scott
-- 

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] Find correct boost among peers

2016-02-07 Thread B. Scott Harper
I have several versions of boost downloaded on my machine inside a
"thirdparty" directory. Different projects rely on various versions.

I am trying to find a later version than the first version in that
collection. I have gotten the closest by using a file(GLOB ...) as follows:

file(GLOB BOOST_ROOT ${THIRD_PARTY_DIR}/boost_*)
find_package(Boost
  1.60.0
  REQUIRED)

...but if I have any versions of Boost earlier than 1.60.0 in this case, it
will find only the first directory, recognize that it's too early, and bail
out without trying any other directories.

When I print out the results of the GLOB action using message(STATUS "Boost
root: " ${BOOST_ROOT}), I don't see any delimiters in the string, and I
wonder if this it causing the problem? Is this expected beahiour or am I
using this incorrectly?

Cheers,
-- Scott
-- 

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