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