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