[Repository Listing] / [Slicer3] / trunk / UseSlicer3.cmake.in
 

View of /trunk/UseSlicer3.cmake.in

Parent Directory Parent Directory Revision Log Revision Log


Revision 15041  Download Blame
File size: 3046 byte(s)
ENH: make Slicer3/trunk be a copy of Slicer-3-6 branch.  New slicer4 development has moved to http://svn.slicer.org/Slicer4/trunk.  Use the Slicer3 trunk only for slicer3 maint purposes.

See this desription for details:

http://massmail.spl.harvard.edu/public-archives/slicer-devel/2010/005338.html
1 #
2 # This file sets up the include directories, link directories and compiler
3 # settings for a project to use Slicer3. Such projects could provide new
4 # Slicer3 modules built against a Slicer3 build tree or a Slicer3 installation.
5 #
6
7 # Relax some constraints related to the build settings file. This was
8 # preventing people from using the same compiler but with a different generator,
9 # or just the same compiler installed in a non-standard location.
10
11 set(SKIP_KWWidgets_BUILD_SETTINGS_FILE 1)
12 set(SKIP_VTK_BUILD_SETTINGS_FILE 1)
13 set(SKIP_ITK_BUILD_SETTINGS_FILE 1)
14 set(SKIP_Teem_BUILD_SETTINGS_FILE 1)
15
16 find_package(GenerateCLP REQUIRED)
17 if(GenerateCLP_FOUND)
18 include(${GenerateCLP_USE_FILE})
19 endif(GenerateCLP_FOUND)
20
21 find_package(GenerateLM REQUIRED)
22 if(GenerateLM_FOUND)
23 include(${GenerateLM_USE_FILE})
24 endif(GenerateLM_FOUND)
25
26 find_package(KWWidgets REQUIRED)
27 if(KWWidgets_FOUND)
28 include(${KWWidgets_USE_FILE})
29 endif(KWWidgets_FOUND)
30
31 find_package(Teem REQUIRED)
32 if(Teem_FOUND)
33 include(${Teem_USE_FILE})
34 endif(Teem_FOUND)
35
36 if(Slicer3_USE_BatchMake)
37 find_package(BatchMake)
38 if(BatchMake_FOUND)
39 include(${BatchMake_USE_FILE})
40 endif(BatchMake_FOUND)
41 endif(Slicer3_USE_BatchMake)
42
43 # Add compiler flags needed to use Slicer3.
44 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Slicer3_REQUIRED_C_FLAGS}")
45 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Slicer3_REQUIRED_CXX_FLAGS}")
46 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${Slicer3_REQUIRED_LINK_FLAGS}")
47 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${Slicer3_REQUIRED_LINK_FLAGS}")
48 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${Slicer3_REQUIRED_LINK_FLAGS}")
49
50 # Disable the warnings that DevStudio 2005 emits wrt to sprintf, strcpu, etc.
51 if(CMAKE_COMPILER_2005)
52 add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
53 endif(CMAKE_COMPILER_2005)
54
55 if(NOT DEFINED BUILD_SHARED_LIBS)
56 set(BUILD_SHARED_LIBS ${Slicer3_BUILD_SHARED})
57 endif(NOT DEFINED BUILD_SHARED_LIBS)
58
59 # Add include directories needed to use Slicer3.
60 include_directories(BEFORE
61 ${Slicer3_Libs_INCLUDE_DIRS}
62 ${Slicer3_Base_INCLUDE_DIRS}
63 )
64
65 # Add link directories needed to use Slicer3.
66 link_directories(
67 ${Slicer3_Libs_LIBRARY_DIRS}
68 ${Slicer3_Base_LIBRARY_DIRS}
69 )
70
71 # Some people use Mesa instead of the default system OpenGL.
72 # Try to help them a little.
73 if(NOT WIN32)
74 foreach(dependency ${vtkftgl_LIB_DEPENDS})
75 get_filename_component(dependency_lib "${dependency}" NAME_WE)
76 if(dependency_lib STREQUAL "libGL")
77 get_filename_component(OPENGL_gl_LIBRARY_PATH "${dependency}" PATH)
78 link_directories("${OPENGL_gl_LIBRARY_PATH}")
79 endif(dependency_lib STREQUAL "libGL")
80 endforeach(dependency)
81 endif(NOT WIN32)
82
83 # Add cmake module path.
84 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Slicer3_CMAKE_DIR}")
85 include("${Slicer3_CMAKE_DIR}/Slicer3Macros.cmake")
86 include("${Slicer3_CMAKE_DIR}/Slicer3PersistenceMacros.cmake")
87 include("${Slicer3_CMAKE_DIR}/Slicer3ModulesMacros.cmake")
88 include("${Slicer3_CMAKE_DIR}/Slicer3PluginsMacros.cmake")

  Subversion  TortoiseSVN  ViewVC