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

View of /oldtrunk/UseSlicer3.cmake.in

Parent Directory Parent Directory Revision Log Revision Log


Revision 15040  Download Blame
File size: 3294 byte(s)
ENH: implementing changes described in the email linked below.
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 # DevStudio 9.0 - Disable warning C4996: [...] This function or variable may be unsafe. [...]
56 # To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details
57 if(MSVC90)
58 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
59 endif(MSVC90)
60
61 if(NOT DEFINED BUILD_SHARED_LIBS)
62 set(BUILD_SHARED_LIBS ${Slicer3_BUILD_SHARED})
63 endif(NOT DEFINED BUILD_SHARED_LIBS)
64
65 # Add include directories needed to use Slicer3.
66 include_directories(BEFORE
67 ${Slicer3_Libs_INCLUDE_DIRS}
68 ${Slicer3_Base_INCLUDE_DIRS}
69 )
70
71 # Add link directories needed to use Slicer3.
72 link_directories(
73 ${Slicer3_Libs_LIBRARY_DIRS}
74 ${Slicer3_Base_LIBRARY_DIRS}
75 )
76
77 # Some people use Mesa instead of the default system OpenGL.
78 # Try to help them a little.
79 if(NOT WIN32)
80 foreach(dependency ${vtkftgl_LIB_DEPENDS})
81 get_filename_component(dependency_lib "${dependency}" NAME_WE)
82 if(dependency_lib STREQUAL "libGL")
83 get_filename_component(OPENGL_gl_LIBRARY_PATH "${dependency}" PATH)
84 link_directories("${OPENGL_gl_LIBRARY_PATH}")
85 endif(dependency_lib STREQUAL "libGL")
86 endforeach(dependency)
87 endif(NOT WIN32)
88
89 # Add cmake module path.
90 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Slicer3_CMAKE_DIR}")
91 include("${Slicer3_CMAKE_DIR}/Slicer3Macros.cmake")
92 include("${Slicer3_CMAKE_DIR}/Slicer3PersistenceMacros.cmake")
93 include("${Slicer3_CMAKE_DIR}/Slicer3ModulesMacros.cmake")
94 include("${Slicer3_CMAKE_DIR}/Slicer3PluginsMacros.cmake")

  Subversion  TortoiseSVN  ViewVC