ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/CMakeLists.txt
Revision: 686
Committed: Tue Jul 7 14:45:11 2015 UTC (9 years, 10 months ago) by francois
Content type: text/plain
File size: 3955 byte(s)
Log Message:
ajout d'un arbre caracteristique dans MAGiC - Phase 1 - Uniquement la structure vide pour le moment.

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
7 if(DEFINED CMAKE_BUILD_TYPE)
8 set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type")
9 else(DEFINED CMAKE_BUILD_TYPE)
10 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose build type")
11 endif(DEFINED CMAKE_BUILD_TYPE)
12
13 project(MAGIC)
14
15 option(ENABLE_OCC "Magic Enable Occ" ON)
16 option(ENABLE_SAT "Magic Enable Sat" ON)
17 option(ENABLE_STEP "Magic Enable Step" ON)
18 option(ENABLE_CAD4FE "Magic Enable CAD4FE" ON)
19 option(ENABLE_IBREP "Magic Enable IBREP" OFF)
20 option(ENABLE_TOIBREP "Magic Enable TOIBREP" ON)
21 option(ENABLE_NUTIL "Magic Enable NUTIL (pour la visu VTK)" OFF)
22 option(ENABLE_TEST "Magic Enable test" OFF)
23 option(ENABLE_ENGLISH "Magic Use English" OFF)
24 option(ENABLE_TUTORIEL "Magic turorial" OFF)
25
26
27 set(CADXFEM_PATH "../cadxfem" CACHE STRING "CADXFEM Path")
28
29 if(ENABLE_OCC)
30 set(OCC_SYS_NAME ${CMAKE_SYSTEM_NAME})
31 set(OCC_LIBS_REQUIRED
32 # subset of DataExchange
33 TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase
34 # ModelingAlgorithms
35 TKOffset TKFeat TKFillet TKBool TKShHealing TKMesh TKHLR TKBO TKPrim
36 TKTopAlgo TKGeomAlgo
37 # ModelingData
38 TKBRep TKGeomBase TKG3d TKG2d
39 # FoundationClasses
40 TKAdvTools TKMath TKernel)
41 list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS_REQUIRED)
42 set(OCC_LIBS)
43 foreach(OCC ${OCC_LIBS_REQUIRED})
44 find_library(OCC_LIB ${OCC} PATHS HINTS ENV CASROOT PATH_SUFFIXES lib
45 ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib )
46 if(OCC_LIB)
47 list(APPEND OCC_LIBS ${OCC_LIB})
48 endif(OCC_LIB)
49 #set(OCC_LIB OCC_LIB-NOTFOUND CACHE INTERNAL "")
50 unset(OCC_LIB CACHE) # cleaner, but only available in cmake >= 2.6.4
51 endforeach(OCC)
52 list(LENGTH OCC_LIBS NUM_OCC_LIBS)
53 if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
54 unset(OCC_INC CACHE)
55 find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc
56 include opencascade include/oce)
57
58 if(OCC_INC)
59 add_definitions(-DBREP_OCC)
60 list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS})
61 list(APPEND EXTERNAL_INCLUDES ${OCC_INC})
62 if(HAVE_64BIT_SIZE_T)
63 add_definitions(-D_OCC64)
64 endif(HAVE_64BIT_SIZE_T)
65 if(CYGWIN)
66 list(APPEND EXTERNAL_LIBRARIES "winspool")
67 elseif(MSVC)
68 add_definitions(-DWNT)
69 endif(CYGWIN)
70 find_path(OCC_CONFIG_H "config.h" PATHS ${OCC_INC} ${OCC_CONFIG_H_PATH}
71 NO_DEFAULT_PATH)
72 if(NOT OCC_CONFIG_H)
73 add_definitions(-DHAVE_NO_OCC_CONFIG_H)
74 endif(NOT OCC_CONFIG_H)
75 endif(OCC_INC)
76 endif(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
77 endif(ENABLE_OCC)
78
79 execute_process(COMMAND "date" "+%Y" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE annee)
80 execute_process(COMMAND "date" "+%Y" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE dateannee)
81 SET(ANNEE -DVERSION=\"${annee}\")
82 SET(DATEANNEE -DDATEVERSION=\"1999-${dateannee}\")
83
84 add_definitions(${ANNEE})
85 add_definitions(${DATEANNEE})
86
87
88 if(ENABLE_SAT)
89 add_definitions(-DBREP_SAT)
90 endif(ENABLE_SAT)
91
92 if(ENABLE_OCC)
93 add_definitions(-DBREP_OCC)
94 add_definitions(-DCSG_OCC)
95 endif(ENABLE_OCC)
96 if(ENABLE_STEP)
97 add_definitions(-DBREP_STEP)
98 endif(ENABLE_STEP)
99
100 if (ENABLE_ENGLISH)
101 add_definitions(-DUSE_ENGLISH)
102 endif(ENABLE_ENGLISH)
103
104 if(ENABLE_IBREP)
105 add_subdirectory(${CADXFEM_PATH}/IBrep "${CMAKE_CURRENT_BINARY_DIR}/IBrep")
106 add_definitions(-DIBREP)
107 endif(ENABLE_IBREP)
108 if(ENABLE_NUTIL)
109 add_subdirectory(${CADXFEM_PATH}/nutil "${CMAKE_CURRENT_BINARY_DIR}/nutil")
110 add_definitions(-DVTK_INTERFACE)
111 endif(ENABLE_NUTIL)
112
113 if (ENABLE_CAD4FE)
114 add_definitions(-DUSECAD4FE)
115 endif(ENABLE_CAD4FE)
116
117
118 message(STATUS "Configuration de MAGiC${annee}:1999-${dateannee}")
119
120
121 add_subdirectory(lib)
122 add_subdirectory(app)
123
124
125