ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/CMakeLists.txt
Revision: 295
Committed: Tue Nov 8 21:46:30 2011 UTC (13 years, 6 months ago) by francois
Content type: text/plain
File size: 3386 byte(s)
Log Message:
Mise a jour des CMakeListe pour rendre les choix possible

File Contents

# Content
1 # The name of our project is "GNURBS". CMakeLists files in this project can
2 # refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
3 # to the root binary directory of the project as ${HELLO_BINARY_DIR}.
4 cmake_minimum_required (VERSION 2.6 FATAL_ERROR)
5
6 if(DEFINED CMAKE_BUILD_TYPE)
7 set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type")
8 else(DEFINED CMAKE_BUILD_TYPE)
9 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose build type")
10 endif(DEFINED CMAKE_BUILD_TYPE)
11
12 project(MAGIC)
13
14 option(ENABLE_OCC "Magic Enable Occ" ON)
15 option(ENABLE_SAT "Magic Enable Sat" ON)
16 option(ENABLE_STEP "Magic Enable Step" ON)
17 option(ENABLE_IBREP "Magic Enable IBREP" OFF)
18 option(ENABLE_TEST "Magic Enable test" OFF)
19 option(OPTION_SHARED "Magic Compilation avec Shared" ON)
20
21 if(ENABLE_OCC)
22 if(WIN32)
23 set(OCC_SYS_NAME win32)
24 else(WIN32)
25 set(OCC_SYS_NAME ${CMAKE_SYSTEM_NAME})
26 endif(WIN32)
27 set(OCC_LIBS_REQUIRED
28 # subset of DataExchange
29 TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase
30 # ModelingAlgorithms
31 TKOffset TKFeat TKFillet TKBool TKShHealing TKMesh TKHLR TKBO TKPrim
32 TKTopAlgo TKGeomAlgo
33 # ModelingData
34 TKBRep TKGeomBase TKG3d TKG2d
35 # FoundationClasses
36 TKAdvTools TKMath TKernel)
37 list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS_REQUIRED)
38 set(OCC_LIBS)
39 foreach(OCC ${OCC_LIBS_REQUIRED})
40 find_library(OCC_LIB ${OCC} PATHS ENV CASROOT PATH_SUFFIXES lib
41 ${OCC_SYS_NAME}/lib)
42 if(OCC_LIB)
43 list(APPEND OCC_LIBS ${OCC_LIB})
44 endif(OCC_LIB)
45 set(OCC_LIB OCC_LIB-NOTFOUND CACHE INTERNAL "")
46 # unset(OCC_LIB CACHE) # cleaner, but only available in cmake >= 2.6.4
47 endforeach(OCC)
48 list(LENGTH OCC_LIBS NUM_OCC_LIBS)
49 if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
50 find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc
51 include opencascade)
52 if(OCC_INC)
53 add_definitions(-DBREP_OCC)
54 list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS})
55 list(APPEND EXTERNAL_INCLUDES ${OCC_INC})
56 if(HAVE_64BIT_SIZE_T)
57 add_definitions(-D_OCC64)
58 endif(HAVE_64BIT_SIZE_T)
59 if(CYGWIN)
60 list(APPEND EXTERNAL_LIBRARIES "winspool")
61 elseif(MSVC)
62 add_definitions(-DWNT)
63 endif(CYGWIN)
64 find_path(OCC_CONFIG_H "config.h" PATHS ${OCC_INC} ${OCC_CONFIG_H_PATH}
65 NO_DEFAULT_PATH)
66 if(NOT OCC_CONFIG_H)
67 add_definitions(-DHAVE_NO_OCC_CONFIG_H)
68 endif(NOT OCC_CONFIG_H)
69 endif(OCC_INC)
70 endif(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
71 endif(ENABLE_OCC)
72
73 if(ENABLE_SAT)
74 add_definitions(-DBREP_SAT)
75 endif(ENABLE_SAT)
76
77 if(ENABLE_STEP)
78 add_definitions(-DBREP_STEP)
79 endif(ENABLE_STEP)
80
81 set(INTERNAL_LIBRARIES fichier carte geometrie outil parseur materiau optimisation mailleur vectorisation diamesh)
82 if (ENABLE_SAT)
83 list (APPEND INTERNAL_LIBRARIES sat)
84 endif (ENABLE_SAT)
85 if (ENABLE_STEP)
86 list (APPEND INTERNAL_LIBRARIES step)
87 endif (ENABLE_STEP)
88 if (ENABLE_OCC)
89 list (APPEND INTERNAL_LIBRARIES reconstruction)
90 endif (ENABLE_OCC)
91
92
93 if(ENABLE_IBREP)
94 add_subdirectory(IBrep)
95 if (OPTION_SHARED)
96 list (APPEND INTERNAL_LIBRARIES ibrep-dynamic)
97 else (OPTION_SHARED)
98 list (APPEND INTERNAL_LIBRARIES ibrep-static)
99 endif(OPTION_SHARED)
100 list (APPEND INTERNAL_LIBRARIES toIbrep)
101 endif(ENABLE_IBREP)
102
103
104 add_subdirectory(lib)
105 add_subdirectory(app)
106
107
108