ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/CMakeLists.txt
Revision: 294
Committed: Tue Nov 8 04:27:56 2011 UTC (13 years, 6 months ago) by francois
Content type: text/plain
File size: 2844 byte(s)
Log Message:
Librairies statiques ou dynamiques au choix a la compilation 

File Contents

# User Rev Content
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     if(DEFINED CMAKE_BUILD_TYPE)
7     set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type")
8     else(DEFINED CMAKE_BUILD_TYPE)
9     set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose build type")
10     endif(DEFINED CMAKE_BUILD_TYPE)
11    
12     project(MAGIC)
13    
14 francois 294 option(ENABLE_OCC "Magic Enable Occ" ON)
15     option(ENABLE_SAT "Magic Enable Sat" ON)
16     option(ENABLE_STEP "Magic Enable Step" ON)
17     option(ENABLE_IBREP "Magic Enable IBREP" OFF)
18     option(ENABLE_TEST "Magic Enable test" OFF)
19     option(OPTION_SHARED "Magic Compilation avec Shared" ON)
20 francois 255
21 francois 294
22 francois 255 if(ENABLE_OCC)
23     if(WIN32)
24     set(OCC_SYS_NAME win32)
25     else(WIN32)
26     set(OCC_SYS_NAME ${CMAKE_SYSTEM_NAME})
27     endif(WIN32)
28     set(OCC_LIBS_REQUIRED
29     # subset of DataExchange
30     TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase
31     # ModelingAlgorithms
32     TKOffset TKFeat TKFillet TKBool TKShHealing TKMesh TKHLR TKBO TKPrim
33     TKTopAlgo TKGeomAlgo
34     # ModelingData
35     TKBRep TKGeomBase TKG3d TKG2d
36     # FoundationClasses
37     TKAdvTools TKMath TKernel)
38     list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS_REQUIRED)
39     set(OCC_LIBS)
40     foreach(OCC ${OCC_LIBS_REQUIRED})
41     find_library(OCC_LIB ${OCC} PATHS ENV CASROOT PATH_SUFFIXES lib
42     ${OCC_SYS_NAME}/lib)
43     if(OCC_LIB)
44     list(APPEND OCC_LIBS ${OCC_LIB})
45     endif(OCC_LIB)
46     set(OCC_LIB OCC_LIB-NOTFOUND CACHE INTERNAL "")
47     # unset(OCC_LIB CACHE) # cleaner, but only available in cmake >= 2.6.4
48     endforeach(OCC)
49     list(LENGTH OCC_LIBS NUM_OCC_LIBS)
50     if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
51     find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc
52     include opencascade)
53     if(OCC_INC)
54     add_definitions(-DBREP_OCC)
55     list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS})
56     list(APPEND EXTERNAL_INCLUDES ${OCC_INC})
57     if(HAVE_64BIT_SIZE_T)
58     add_definitions(-D_OCC64)
59     endif(HAVE_64BIT_SIZE_T)
60     if(CYGWIN)
61     list(APPEND EXTERNAL_LIBRARIES "winspool")
62     elseif(MSVC)
63     add_definitions(-DWNT)
64     endif(CYGWIN)
65     find_path(OCC_CONFIG_H "config.h" PATHS ${OCC_INC} ${OCC_CONFIG_H_PATH}
66     NO_DEFAULT_PATH)
67     if(NOT OCC_CONFIG_H)
68     add_definitions(-DHAVE_NO_OCC_CONFIG_H)
69     endif(NOT OCC_CONFIG_H)
70     endif(OCC_INC)
71     endif(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
72     endif(ENABLE_OCC)
73    
74     if(ENABLE_SAT)
75     add_definitions(-DBREP_SAT)
76     endif(ENABLE_SAT)
77    
78     if(ENABLE_STEP)
79     add_definitions(-DBREP_STEP)
80     endif(ENABLE_STEP)
81    
82     if(ENABLE_IBREP)
83     add_subdirectory(IBrep)
84     endif(ENABLE_IBREP)
85    
86    
87 francois 294
88 francois 258 add_subdirectory(lib)
89     add_subdirectory(app)
90 francois 255
91 francois 258
92