1 |
francois |
1189 |
cmake_minimum_required (VERSION 2.9 FATAL_ERROR) |
2 |
francois |
255 |
|
3 |
francois |
547 |
|
4 |
francois |
255 |
if(DEFINED CMAKE_BUILD_TYPE) |
5 |
|
|
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type") |
6 |
|
|
else(DEFINED CMAKE_BUILD_TYPE) |
7 |
francois |
1061 |
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose build type") |
8 |
francois |
255 |
endif(DEFINED CMAKE_BUILD_TYPE) |
9 |
|
|
|
10 |
|
|
project(MAGIC) |
11 |
|
|
|
12 |
francois |
1189 |
option(ENABLE_ALGLIB "ALGLIB Enabled" OFF) |
13 |
francois |
294 |
option(ENABLE_OCC "Magic Enable Occ" ON) |
14 |
couturad |
906 |
option(ENABLE_OCC_COMPLET "Magic Enable Occ BREP+Operation" ON) |
15 |
francois |
294 |
option(ENABLE_SAT "Magic Enable Sat" ON) |
16 |
|
|
option(ENABLE_STEP "Magic Enable Step" ON) |
17 |
francois |
660 |
option(ENABLE_CAD4FE "Magic Enable CAD4FE" ON) |
18 |
francois |
1061 |
#option(ENABLE_IBREP "Magic Enable IBREP" OFF) |
19 |
francois |
490 |
option(ENABLE_TOIBREP "Magic Enable TOIBREP" ON) |
20 |
francois |
1061 |
option(ENABLE_VTKDISPLAY "Magic Enable VTKDISPLAY (pour la visu)" ON) |
21 |
francois |
294 |
option(ENABLE_TEST "Magic Enable test" OFF) |
22 |
francois |
366 |
option(ENABLE_ENGLISH "Magic Use English" OFF) |
23 |
cuillier |
415 |
option(ENABLE_TUTORIEL "Magic turorial" OFF) |
24 |
francois |
726 |
option(ENABLE_CHOIX_TERMINAL_ASTER "Magic Choix d'un terminal pour executer Code Aster" ON) |
25 |
couturad |
951 |
option(ENABLE_PROJECT_CHRONO "Magic Enable Project_chrono" OFF) |
26 |
francois |
987 |
option(ENABLE_PROJECT_POLYCRISTAUX "Magic Enable Project_polycristaux" OFF) |
27 |
francois |
255 |
|
28 |
francois |
757 |
message(STATUS "The compiler is ${CMAKE_CXX_COMPILER}.") |
29 |
|
|
|
30 |
francois |
1189 |
set(MAGIC_MAJOR_VERSION 5) |
31 |
|
|
set(MAGIC_MINOR_VERSION 0) |
32 |
francois |
1171 |
set(MAGIC_MAJOR_VERSION_FICHIER 2) |
33 |
francois |
1181 |
set(MAGIC_MINOR_VERSION_FICHIER 4) |
34 |
francois |
1171 |
|
35 |
francois |
757 |
include(CheckCXXCompilerFlag) |
36 |
|
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) |
37 |
|
|
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) |
38 |
|
|
if(COMPILER_SUPPORTS_CXX11) |
39 |
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
40 |
|
|
elseif(COMPILER_SUPPORTS_CXX0X) |
41 |
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") |
42 |
|
|
else() |
43 |
|
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") |
44 |
|
|
endif() |
45 |
|
|
|
46 |
francois |
1061 |
#set(CADXFEM_PATH "../cadxfem" CACHE STRING "CADXFEM Path") |
47 |
francois |
1171 |
set(ASTER_VERSION_FLAG "15.6" CACHE STRING "Version par défaut de Code ASTER dans la compilation") |
48 |
|
|
#add_definitions(-DASTER_VERSION_DEFAUT="${ASTER_VERSION_FLAG}") |
49 |
couturad |
906 |
if(ENABLE_OCC_COMPLET) |
50 |
|
|
set (ENABLE_OCC ON) |
51 |
|
|
endif(ENABLE_OCC_COMPLET) |
52 |
francois |
1171 |
|
53 |
francois |
255 |
if(ENABLE_OCC) |
54 |
francois |
547 |
set(OCC_SYS_NAME ${CMAKE_SYSTEM_NAME}) |
55 |
francois |
255 |
set(OCC_LIBS_REQUIRED |
56 |
|
|
# subset of DataExchange |
57 |
couturad |
687 |
TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase TKXCAF TKXDESTEP |
58 |
couturad |
906 |
|
59 |
|
|
TKBinXCAF TKSTL TKVRML TKXDEIGES TKXmlXCAF |
60 |
|
|
|
61 |
francois |
255 |
# ModelingAlgorithms |
62 |
|
|
TKOffset TKFeat TKFillet TKBool TKShHealing TKMesh TKHLR TKBO TKPrim |
63 |
|
|
TKTopAlgo TKGeomAlgo |
64 |
|
|
# ModelingData |
65 |
|
|
TKBRep TKGeomBase TKG3d TKG2d |
66 |
|
|
# FoundationClasses |
67 |
francois |
865 |
#TKAdvTools |
68 |
|
|
TKMath TKernel) |
69 |
francois |
255 |
list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS_REQUIRED) |
70 |
|
|
set(OCC_LIBS) |
71 |
|
|
foreach(OCC ${OCC_LIBS_REQUIRED}) |
72 |
francois |
547 |
find_library(OCC_LIB ${OCC} PATHS HINTS ENV CASROOT PATH_SUFFIXES lib |
73 |
|
|
${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib ) |
74 |
francois |
255 |
if(OCC_LIB) |
75 |
|
|
list(APPEND OCC_LIBS ${OCC_LIB}) |
76 |
|
|
endif(OCC_LIB) |
77 |
francois |
547 |
#set(OCC_LIB OCC_LIB-NOTFOUND CACHE INTERNAL "") |
78 |
|
|
unset(OCC_LIB CACHE) # cleaner, but only available in cmake >= 2.6.4 |
79 |
francois |
255 |
endforeach(OCC) |
80 |
|
|
list(LENGTH OCC_LIBS NUM_OCC_LIBS) |
81 |
|
|
if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED) |
82 |
francois |
547 |
unset(OCC_INC CACHE) |
83 |
francois |
255 |
find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc |
84 |
francois |
547 |
include opencascade include/oce) |
85 |
|
|
|
86 |
francois |
255 |
if(OCC_INC) |
87 |
francois |
1171 |
|
88 |
|
|
file(STRINGS ${OCC_INC}/Standard_Version.hxx |
89 |
|
|
OCC_MAJOR REGEX "#define OCC_VERSION_MAJOR.*") |
90 |
|
|
file(STRINGS ${OCC_INC}/Standard_Version.hxx |
91 |
|
|
OCC_MINOR REGEX "#define OCC_VERSION_MINOR.*") |
92 |
|
|
file(STRINGS ${OCC_INC}/Standard_Version.hxx |
93 |
|
|
OCC_MAINT REGEX "#define OCC_VERSION_MAINTENANCE.*") |
94 |
|
|
if(OCC_MAJOR AND OCC_MINOR AND OCC_MAINT) |
95 |
|
|
string(REGEX MATCH "[0-9]+" OCC_MAJOR "${OCC_MAJOR}") |
96 |
|
|
string(REGEX MATCH "[0-9]+" OCC_MINOR "${OCC_MINOR}") |
97 |
|
|
string(REGEX MATCH "[0-9]+" OCC_MAINT "${OCC_MAINT}") |
98 |
|
|
set(OCC_VERSION "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}") |
99 |
|
|
message(STATUS "Found OpenCASCADE version ${OCC_VERSION} in ${OCC_INC}") |
100 |
|
|
endif() |
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
francois |
255 |
add_definitions(-DBREP_OCC) |
106 |
couturad |
906 |
if(ENABLE_OCC_COMPLET) |
107 |
|
|
add_definitions(-DALL_OCC) |
108 |
|
|
endif(ENABLE_OCC_COMPLET) |
109 |
francois |
255 |
list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS}) |
110 |
|
|
list(APPEND EXTERNAL_INCLUDES ${OCC_INC}) |
111 |
|
|
if(HAVE_64BIT_SIZE_T) |
112 |
|
|
add_definitions(-D_OCC64) |
113 |
|
|
endif(HAVE_64BIT_SIZE_T) |
114 |
|
|
if(CYGWIN) |
115 |
|
|
list(APPEND EXTERNAL_LIBRARIES "winspool") |
116 |
|
|
elseif(MSVC) |
117 |
|
|
add_definitions(-DWNT) |
118 |
|
|
endif(CYGWIN) |
119 |
|
|
find_path(OCC_CONFIG_H "config.h" PATHS ${OCC_INC} ${OCC_CONFIG_H_PATH} |
120 |
|
|
NO_DEFAULT_PATH) |
121 |
|
|
if(NOT OCC_CONFIG_H) |
122 |
|
|
add_definitions(-DHAVE_NO_OCC_CONFIG_H) |
123 |
|
|
endif(NOT OCC_CONFIG_H) |
124 |
|
|
endif(OCC_INC) |
125 |
|
|
endif(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED) |
126 |
|
|
endif(ENABLE_OCC) |
127 |
|
|
|
128 |
couturad |
951 |
if(ENABLE_PROJECT_CHRONO) |
129 |
|
|
find_package(Chrono REQUIRED |
130 |
|
|
COMPONENTS Irrlicht |
131 |
|
|
CONFIG |
132 |
francois |
957 |
HINTS /usr/local/lib64 |
133 |
|
|
) |
134 |
couturad |
951 |
add_definitions(-DPROJECT_CHRONO) |
135 |
|
|
endif(ENABLE_PROJECT_CHRONO) |
136 |
|
|
|
137 |
francois |
381 |
execute_process(COMMAND "date" "+%Y" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE annee) |
138 |
|
|
execute_process(COMMAND "date" "+%Y" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE dateannee) |
139 |
|
|
|
140 |
|
|
|
141 |
francois |
255 |
if(ENABLE_SAT) |
142 |
|
|
add_definitions(-DBREP_SAT) |
143 |
|
|
endif(ENABLE_SAT) |
144 |
|
|
|
145 |
francois |
314 |
if(ENABLE_OCC) |
146 |
|
|
add_definitions(-DBREP_OCC) |
147 |
francois |
686 |
add_definitions(-DCSG_OCC) |
148 |
francois |
314 |
endif(ENABLE_OCC) |
149 |
francois |
255 |
if(ENABLE_STEP) |
150 |
|
|
add_definitions(-DBREP_STEP) |
151 |
|
|
endif(ENABLE_STEP) |
152 |
|
|
|
153 |
francois |
366 |
if (ENABLE_ENGLISH) |
154 |
|
|
add_definitions(-DUSE_ENGLISH) |
155 |
|
|
endif(ENABLE_ENGLISH) |
156 |
francois |
295 |
|
157 |
francois |
1061 |
#if(ENABLE_NUTIL) |
158 |
|
|
#add_subdirectory(${CADXFEM_PATH}/nutil "${CMAKE_CURRENT_BINARY_DIR}/nutil") |
159 |
|
|
#add_definitions(-DVTK_INTERFACE) |
160 |
|
|
#endif(ENABLE_NUTIL) |
161 |
francois |
255 |
|
162 |
francois |
1061 |
#if(ENABLE_IBREP) |
163 |
|
|
#add_subdirectory(${CADXFEM_PATH}/IBrep "${CMAKE_CURRENT_BINARY_DIR}/IBrep") |
164 |
|
|
#add_definitions(-DIBREP) |
165 |
|
|
#endif(ENABLE_IBREP) |
166 |
francois |
989 |
|
167 |
francois |
984 |
if (ENABLE_PROJECT_POLYCRISTAUX) |
168 |
francois |
987 |
add_definitions(-DPROJECT_POLYCRISTAUX) |
169 |
francois |
984 |
endif (ENABLE_PROJECT_POLYCRISTAUX) |
170 |
|
|
|
171 |
|
|
|
172 |
|
|
|
173 |
francois |
660 |
if (ENABLE_CAD4FE) |
174 |
|
|
add_definitions(-DUSECAD4FE) |
175 |
|
|
endif(ENABLE_CAD4FE) |
176 |
|
|
|
177 |
francois |
726 |
if (ENABLE_CHOIX_TERMINAL_ASTER) |
178 |
|
|
add_definitions(-DCHOIXTERMASTER) |
179 |
sattarpa |
728 |
endif(ENABLE_CHOIX_TERMINAL_ASTER) |
180 |
francois |
660 |
|
181 |
francois |
726 |
|
182 |
francois |
381 |
message(STATUS "Configuration de MAGiC${annee}:1999-${dateannee}") |
183 |
francois |
867 |
message(STATUS "Version de code ASTER integree ${ASTER_VERSION_FLAG}") |
184 |
francois |
1171 |
message(STATUS "Version de OCC ${OCC_VERSION}") |
185 |
francois |
381 |
|
186 |
francois |
1061 |
|
187 |
|
|
|
188 |
|
|
|
189 |
francois |
1171 |
configure_file (version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/lib/constante/src/version.h @ONLY) |
190 |
|
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/documentation/docmagic.in ${CMAKE_CURRENT_SOURCE_DIR}/documentation/docmagic @ONLY) |
191 |
francois |
1061 |
|
192 |
|
|
|
193 |
|
|
|
194 |
|
|
|
195 |
|
|
|
196 |
|
|
|
197 |
|
|
|
198 |
|
|
add_subdirectory(addin) |
199 |
francois |
258 |
add_subdirectory(lib) |
200 |
|
|
add_subdirectory(app) |
201 |
francois |
255 |
|
202 |
francois |
258 |
|
203 |
|
|
|