[CMake] Set project to target Win32 in an x64 Solution

2013-09-19 Thread Zamir Khan
I have a solution which contains multiple projects. All of these projects
typically target an x64 platform. However, recently I have had to introduce
another project which will target Win32/x86. Essentially, this project
results in a process that runs on its own and communicates with the rest of
the software (x64) through IPC. In fact, the x64 process launches the x86
process (and therefore needs access to it's exe file). 

So this is a bit of a special case in that I need my solution to produce a
mixed build and that these mixed modules are still very much part of the
same piece of software.

Ideally, I would like to be able to build what I need using a single CMake
(targetting x64, and making a special exception to change the build
configuration in Visual Studio for the Win32 project). For obvious reasons,
I would like to avoid having to do two separate CMake steps, just for this
one Win32 project. Is this possible?



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Set-project-to-target-Win32-in-an-x64-Solution-tp7585557.html
Sent from the CMake mailing list archive at Nabble.com.
--

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake with Team Foundation Server?

2013-08-30 Thread Zamir Khan
Thank you both, Fabian and Petr, for your responses. I haven't had time to
experiment with your suggestions yet, but at first glance this is extremely
valuable information.



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/CMake-with-Team-Foundation-Server-tp7585293p7585310.html
Sent from the CMake mailing list archive at Nabble.com.
--

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://www.cmake.org/mailman/listinfo/cmake


[CMake] Multiple versions of ITK in one build?

2013-05-28 Thread Zamir Khan
We have a project where multiple modules rely on ITK. Most modules have been
upgraded to ITK 4.31, but one still relies on ITK 3.20 and it would take a
significant effort to upgrade it. In the meantime, is there a way for us to
keep these modules under a single top-level CMake and have them use their
respective versions of ITK?

We thought we could just try to overwrite the ITK_DIR variable in the
appropriate place, but our first naive implementation of this did not work.

Just wondering if someone has done this and whether it is possible (before
we dive deeper).

Thanks!



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Multiple-versions-of-ITK-in-one-build-tp7584547.html
Sent from the CMake mailing list archive at Nabble.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] Multiple versions of ITK in one build?

2013-05-28 Thread Zamir Khan
I should probably clarify the situation (I'm not sure I provided enough
info up front). The larger dependencies like ITK are pre-built (I guess one
would assume this; we don't rebuild ITK or VTK with every build of our
project). So I thought it would be a simple problem of overwrite and then
restoring the ITK_DIR value at the right time (e.g. at the point of
find_package(ITK ...) for the modules in question). I feel like we've
almost got this working. There are some lingering issues that we're still
solving, but the respective modules seem to reference the correct versions
of ITK now. I guess I'm wondering whether this approach is doomed to fail
for a reason we haven't anticipated.

I'm doing the replacement as follows:

# This module uses an older version of ITK (3.2) than the rest of
# the project (4.31), so here we overwrite the ITK_DIR variable
# so that the correct version is found.
MESSAGE( STATUS ITK_DIR_SECONDARY value:${ITK_DIR_SECONDARY})

MESSAGE( STATUS ITK_DIR value (before overwrite):${ITK_DIR})
# Store the primary ITK directory in a temporary variable
set(ITK_DIR_PRIMARY ${ITK_DIR})
# Overwrite the ITK_DIR cache variable
set(ITK_DIR ${ITK_DIR_SECONDARY} CACHE STRING The directory containing a
CMake configuration file for ITK FORCE)
MESSAGE( STATUS ITK_DIR value (after overwrite):${ITK_DIR})

FIND_PACKAGE(ITK 3.2)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
MESSAGE(FATAL_ERROR ITK not found. Please set ITK_DIR.)
ENDIF(ITK_FOUND)

# Restore the original (primary) ITK_DIR value
SET(ITK_DIR ${ITK_DIR_PRIMARY} CACHE STRING The directory containing a
CMake configuration file for ITK FORCE)
MESSAGE( STATUS ITK_DIR value (after restore):${ITK_DIR})



On Tue, May 28, 2013 at 11:30 AM, Bill Lorensen bill.loren...@gmail.comwrote:

 I just re-read your question. Superbuild won't help.



 On Tue, May 28, 2013 at 11:29 AM, Bill Lorensen 
 bill.loren...@gmail.comwrote:

 You could use cmake's superbuild facility to build both itk3 and itk4 in
 a superbuild tree.



 On Tue, May 28, 2013 at 11:02 AM, John Drescher dresche...@gmail.comwrote:

 On Tue, May 28, 2013 at 10:16 AM, Zamir Khan zamir.k...@gmail.com
 wrote:
  We have a project where multiple modules rely on ITK. Most modules
 have been
  upgraded to ITK 4.31, but one still relies on ITK 3.20 and it would
 take a
  significant effort to upgrade it. In the meantime, is there a way for
 us to
  keep these modules under a single top-level CMake and have them use
 their
  respective versions of ITK?
 
  We thought we could just try to overwrite the ITK_DIR variable in the
  appropriate place, but our first naive implementation of this did not
 work.
 
  Just wondering if someone has done this and whether it is possible
 (before
  we dive deeper).
 

 On windows I have several completely separate build trees with their
 own environment. This way I can build for different compiler versions,
 32/64 bit and different versions of libraries like this. Inside the
 root of each build tree there is a link to the appropriate Visual
 Studio command prompt that has its default folder set to the build
 tree root. Also in the root there is a batch file that sets quite a
 few _DIR environment variables to help cmake find the correct compiled
 libraries. This has worked well for the 5 or so years that I have done
 it this way. I do not use INSTALL targets so none of the binaries end
 up in Program Files.

 John
 --

 Powered by www.kitware.com

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

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

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




 --
 Unpaid intern in BillsBasement at noware dot com




 --
 Unpaid intern in BillsBasement at noware dot 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] Conversion Wizard for VS 2010?

2013-03-28 Thread Zamir Khan
I re-did this just to confirm and yes, I start with a new, empty directory
and choose Visual Studio 10 Win64 as the generator and Use default native
compilers. If I choose Visual Studio 9 Win64, I can open the solution in
VS2008 without issues.



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Conversion-Wizard-for-VS-2010-tp7583820p7583822.html
Sent from the CMake mailing list archive at Nabble.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] Conversion Wizard for VS 2010?

2013-03-28 Thread Zamir Khan
Yes, with all due respect, that is pretty basic (although I understand that
there could easily be something basic going wrong here). To open the
solution file, I open Visual Studio 2010 from the windows start menu and
then use the File  Open  Project / Solution option to select the
generated sln file. I can tell by the icons used that the .sln associations
are correct anyway.

On Thu, Mar 28, 2013 at 10:31 AM, Jean-Christophe Fillion-Robin 
jchris.filli...@kitware.com wrote:

 Hi,

 By default solution files are probably associated with VS2008, did you
 make sure you were starting VS2010, then doing File - Open and selecting
 the generated solution files ?

 Hth
 Jc


 On Thu, Mar 28, 2013 at 10:18 AM, Zamir Khan zamir.k...@gmail.com wrote:

 I re-did this just to confirm and yes, I start with a new, empty directory
 and choose Visual Studio 10 Win64 as the generator and Use default
 native
 compilers. If I choose Visual Studio 9 Win64, I can open the solution
 in
 VS2008 without issues.



 --
 View this message in context:
 http://cmake.3232098.n2.nabble.com/Conversion-Wizard-for-VS-2010-tp7583820p7583822.html

 Sent from the CMake mailing list archive at Nabble.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




 --
 +1 919 869 8849

--

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] Conversion Wizard for VS 2010?

2013-03-28 Thread Zamir Khan
Good idea, but unfortunately the same results with the 32-bit version. And
yes, it is VS 2010 Professional. CMake is version 2.8.10.2.



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Conversion-Wizard-for-VS-2010-tp7583820p7583826.html
Sent from the CMake mailing list archive at Nabble.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] Conversion Wizard for VS 2010?

2013-03-28 Thread Zamir Khan
I upgraded, but no luck. Fortunately, I figured it out and it was fairly
simple (I really should have thought of this before posting to the mailing
list!).

I decided to go through with the conversion to see what VS 2010 was having
problems with. It turns out that only one of the projects required
conversion. This project is actually a .csproj file that is dynamically
generated from a custom template during the CMake step (using all sorts of
variable inputs) to have it use the correct dependencies (x64/x86) at build
time.

There were a few tags in the .csproj that needed to be set to different
values depending on the version of Visual Studio, mostly to do with the move
from .NET/msbuild 3.5 to 4.0.

For anyone else that runs into this, the tags I had to change were (where
CMAKE_TOOLS_VERSION is 3.5 for VS2008 and 4.0 for VS2010):
Project ToolsVersion=quot;${CMAKE_TOOLS_VERSION}quot; ...
.
.
lt;TargetFrameworkVersionv${CMAKE_TOOLS_VERSION}/TargetFrameworkVersion
.
.
.
Reference Include=System.Core
  RequiredTargetFramework${CMAKE_TOOLS_VERSION}/RequiredTargetFramework
/Reference

Hope this helps someone else!



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Conversion-Wizard-for-VS-2010-tp7583820p7583828.html
Sent from the CMake mailing list archive at Nabble.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