AW: [Insight-users] building insight applications for release

Luis Ibanez luis . ibanez at kitware . com
Tue, 10 Jun 2003 21:04:03 -0400


Hi Zein

The configuration type (Debug/Release) in windows
cannot be selected from CMake.  You have to do this
from VC++.

Your problem is probably originated from FLTK.

The reason is the following: for ITK and VTK
(and most other packages, VC++ will generate code
in independent directories (/Debug, /Release).

Thanks to these independent directories, CMake can
figure out how to build your application and link
the appropriate version (debug/release) of the
VTK and ITK libraries.

For FLTK however, this is not possible because the
filenames of the libraries have been hand-selected
with this non-standard "d" suffix.

    fltk.lib    ==   Release
    fltkd.lib   ==   Debug

With this naming convention CMake cannot switch
from Debug to Release versions of FLTK. It is stuck
with the filenames you provided during your configuration.
Those filenames got hardcoded in the CMakeCache.txt file
and do not change when you switch from Debug to Release.



We will throw a party at Kitware the day FLTK starts
using CMake for their build process instead of using
their non-standard hand-crafted VC++ project and
hand-crafted Makefiles.

It is unfortunate that such a nice toolkit (FLTK)
results in so many colateral configuration problems
for the final applications. Too many bytes of the
ITK-users list have been spent on FLTK related issues.

-----

BTW, the solution to your problem is to build
your application in two different binary directories.
One will be dedicated to the Release version, the
other to the Debug version. When you run CMake to
configure each one, make sure that you provide the
non-"d" FLTK library names for the Release binary
directory, and that you provide the "d" FLTK library
names for your Debug application binary directory.
This will take as much disk space as the natural
VC++ mechanism of creating Debug/Release subdirectories
in the final leaves of the directory structures.


If you have any complains about this,...
Please send them to the FLTK users-list
and tell them about CMake,  http://www . cmake . org   :-)



    Regards,


       Luis


-------------------
salah wrote:
> Thanks Luis,
> 
> 
>>1) Yes, in order to build InsightApplications for "Release"
>>   you must build Insight for "Release",... and not only
>>   Insight, any other library used by the applications
>>   must also be built for "Release, for example FLTK and VTK.
>>
>>   Any attempt to mix "Debug" and "Release" libraries will
>>   result in linkage problems and runtime instability.
> 
> 
> I have built itk for all Built options as follows:
> VC++6.0 ==> Build ==> Batch Build ==> Rebuild All
> There is a long list all the projects in ITK, with their
> check boxes turned ON.
> Is this procedure correct?? Any other way I tried did
> ONLY build for Debug!! 
> I have built fltk the same way.
> 
> 
>>2) The option for building "Release" on Windows is not
>>   selected from CMake. You simply go to your VC++
>>   build menu option and select the build configuration.>
>>
>>   ( FYI In Unix it is possible to select the build mode>
>>     from CMake).
> 
> 
> I am glad to know this, since I could not till now "fall 
> in LOVE" with CMake!!! 
> But what is then the role of the CMAKE_CONFIGURATION_TYPES in 
> CMake? 
> 
> 
> 
>>4) Yes, you must rebuild FLTK and VTK
>>   for "Release".
>>
>>   It looks like you will have some time for
>>   reading papers and having coffee while your
>>   compiler works hard   :-)
>>
>>
>>NOTE that the FLTK installation gives different
>>names to the libraries dependingon whether they
>>are build for debug or release. The add a "d"
>>at the end of the library filename. Due to this,
>>after you build FLTK for release you must rerun
>>CMake in InsightApplications and update the
>>names to the four FLTK libraries in order to
>>use the newly created files without "d".
> 
> 
> I am really missing something in this context!
> 
> 1. When I rebuild something (VTK, FLKT, ITK,..) for
> Release, does it mean that I could not use then for 
> building for Debug??
> I mean: I need to build my application sometimes for
> Debug, sometimes for Release. Can I easily do this 
> switching?? or I should each time re-run CMake?
> 
> 2. My VTK and ITK are build for Debug. When I want to
> build then for release, Should I do anything with CMake 
> before running VC++?? I ran CMake on a clean itk 1.2 
> directory, it did not show any option related to the
> build type/configuration, even in the advanced options!
> 
> 
> Many thanks, Luis, and sorry for my frequent disturbance!
> 
> Zein
> 
> 
> 
> 
> -----------------------
> salah wrote:
> 
>>Hi all,
>>
>>I would like to build InsightApplications for "Release" 
>>and "Debug". I have some questions:
>>
>>1. Should ITK also be rebuild for "Release" ?? It is 
>>already build for "Debug".
>>
>>2. I tried However to build InsightApplication 1.2 for
>>"Release". Cmake did not show the option to choose
>>this mode. I did not see the CMAKE_CONFIGURATION_TYPES!!!
>>
>>3. What value should I give for the USE_FLTK and USE_VTK
>>fields? 
>>
>>4. Should the fltk and vtk be also rebuild ? I mean for "Release"?
>>
>>
>>Thanks,
>>Zein
>>
>>
>>
>>
>>
>>->8<------------->8<------------->8<------------->8<------------->8<------------->8<-
>>Zein I. Salah 
>>University of Tübingen, WSI-GRIS, Sand 14, 72076 Tübingen 
>>Email: salah at gris . uni-tuebingen . de
>>Tel.: (07071) 29 75465 (GRIS),           Fax: (07071) 29 54 66
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at public . kitware . com
>>http://public . kitware . com/mailman/listinfo/insight-users
>>
> 
> 
> 
> 
>