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