[Insight-developers] ITK with free VC++ compiler
William A. Hoffman
billlist at nycap.rr.com
Tue Aug 10 07:52:32 EDT 2004
For now, you will have to do something like this.
Create a file that presets the flags to something different.
Create a file like this:
(change all the flags to what they need to be,
and save this in a file called InitialCacheVCFreeTools.cmake)
SET (CMAKE_CXX_FLAGS "/W3 /Zm1000 /GX /GR" CACHE STRING
"Flags used by the compiler during all build types.")
SET (CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Od /GZ" CACHE STRING
"Flags used by the compiler during debug builds.")
SET (CMAKE_CXX_FLAGS_MINSIZEREL "/MD /O1 /D NDEBUG" CACHE STRING
"Flags used by the compiler during release minsize builds.")
SET (CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /D NDEBUG" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /O2 /D NDEBUG" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.")
SET (CMAKE_C_FLAGS "/W3 /Zm1000")
SET (CMAKE_C_FLAGS_DEBUG "/MDd /Zi /Od /GZ" STRING
"Flags used by the compiler during debug builds.")
SET (CMAKE_C_FLAGS_MINSIZEREL "/MD /O1 /D NDEBUG" CACHE STRING
"Flags used by the compiler during release minsize builds.")
SET (CMAKE_C_FLAGS_RELEASE "/MD /O2 /D NDEBUG" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Zi /O2 /D NDEBUG" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.")
CMakeSetup -C InitialCacheVCFreeTools.cmake
Let me know if this works for you.
I will look into a patch for CMake to support this setup in a cleaner way.
-Bill
At 05:06 PM 8/9/2004, Julien Jomier wrote:
>Hello,
>
>I successfully compiled ITK with the free VC++ compiler. However I had to
>manually modify the CMakeCache.txt because all the TRY_COMPILE are failing
>the first time I run CMake.
>
>Here's the full story. The free vc compiler doesn't work with the
>Multithreaded DLL run-time library because msvcprt.lib (and the debug
>version msvcprtd.lib) are not included with the free compiler. On the other
>hand, the multithreaded libraries (msvcrt.lib and msvcrtd.lib) are included.
>By default CMake sets the CMAKE_CXX_FLAGS (and CMAKE_C_FLAGS) to /MD
>(Multithreaded DLL) and therefore all TRY_COMPILE fail because the
>msvcprt.lib is not found. Then when changing the CXX_FLAGS to /MT
>(Mutithreaded), this doesn't cause CMake to redo the TRY_COMPILE because the
>values are cached.
>
>Is there any easy way to fix this?
>
>I'll setup a dashboard for this compiler.
>
>Thanks,
>
>Julien
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers
More information about the Insight-developers
mailing list