ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/CMakeLists.txt
Revision: 617
Committed: Tue Dec 2 03:11:05 2014 UTC (10 years, 5 months ago) by francois
Content type: text/plain
File size: 3811 byte(s)
Log Message:
Mise a jour compatible avec nouveauté de nutil (attention faire un svn up aussi dans cadxfem/nutil)

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