PageRenderTime 25ms CodeModel.GetById 15ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/src/contrib/geom-6.3.1.8/CMakeLists.txt

https://gitlab.com/tylerluo/pythonocc
CMake | 199 lines | 129 code | 19 blank | 51 comment | 1 complexity | 74a099e230cd0ec27c4f754a8a551a4c MD5 | raw file
  1# GEOM cmake build file
  2
  3PROJECT(GEOM)
  4
  5SET(GEOM_VERSION_MAJOR 6)
  6SET(GEOM_VERSION_MINOR 3)
  7SET(GEOM_VERSION_PATCH 1)
  8#SET(GEOM_VERSION_TWEAK 8)
  9CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 10
 11######################
 12# Set ABI SOVERSION  #
 13######################
 14SET(GEOM_ABI_SOVERSION 1)
 15SET(GEOM_ABI_VERSION ${GEOM_ABI_SOVERSION}.0.0)
 16
 17SET(CMAKE_BUILD_TYPE "Release") # By default, build in release mode
 18SET(BUILD_SHARED_LIBS ON)
 19INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 20INCLUDE_DIRECTORIES(inc)
 21
 22################################################################
 23# OpenCASCADE Community Edition (OCE) include and lib location #
 24################################################################
 25SET( OCE_INCLUDE_PATH /usr/local/include/oce CACHE
 26  PATH "OCE headers location" )
 27SET( OCE_LIB_PATH /usr/local/lib CACHE
 28  PATH "OCE libraries location" )
 29
 30# Tells CMake where are the required headers
 31INCLUDE_DIRECTORIES(${OCE_INCLUDE_PATH})
 32LINK_DIRECTORIES(${OCE_LIB_PATH})
 33
 34############################
 35# Check 32/64 bit platform #
 36############################
 37IF (${CMAKE_SIZEOF_VOID_P} MATCHES "8") # It is 64bit, 32 bit systems returns 4
 38    ADD_DEFINITIONS(-D_OCC64)
 39    SET(BIT 64)
 40ELSE (${CMAKE_SIZEOF_VOID_P} MATCHES "8")
 41    SET(BIT 32)
 42ENDIF(${CMAKE_SIZEOF_VOID_P} MATCHES "8")
 43MESSAGE(STATUS "Build ${BIT}bit")
 44
 45#################
 46# Release build #
 47#################
 48IF (NOT MSVC)
 49  IF( NOT DEFINED ${PROJECT_NAME}_BUILD_TYPE )
 50    SET( ${PROJECT_NAME}_BUILD_TYPE "Release" CACHE STRING "Build type" ) # By default set release build
 51  ENDIF( NOT DEFINED ${PROJECT_NAME}_BUILD_TYPE )
 52  SET( CMAKE_BUILD_TYPE ${${PROJECT_NAME}_BUILD_TYPE} CACHE INTERNAL "Build type,
 53    immutable" FORCE )
 54ENDIF(NOT MSVC)
 55
 56######################################################
 57# Configure Build settings according to the platform #
 58######################################################
 59IF(UNIX)
 60    IF(APPLE)
 61    ######### MacOSX ###########
 62    MESSAGE(STATUS "MacOSX platform detected")
 63    SET(PLATFORM Darwin)
 64  ELSE(APPLE)
 65    ######### Unix/Linux ###########
 66    MESSAGE(STATUS "Unix/Linux platform detected")
 67    SET(PLATFORM Unix)
 68  ENDIF(APPLE)# Same settings are used for both MacOSX and Unix/Linux
 69  ADD_DEFINITIONS(-DHAVE_CONFIG_H -DCSFDB -DOCC_CONVERT_SIGNALS)
 70ELSE(UNIX)
 71  IF(WIN32)
 72    ######### Windows ###########
 73    MESSAGE("-- Windows system detected")
 74    ADD_DEFINITIONS(-DWNT -DWIN32 -D_WINDOWS -DCSFDB -DHAVE_CONFIG_H)
 75  ELSE(WIN32)
 76    MESSAGE("Unknown platform")
 77  ENDIF(WIN32)
 78ENDIF(UNIX)
 79
 80################################################
 81# Define output path for generated libraries:  #
 82# platform/compiler-build_type-bits            #
 83# for instance:                                #
 84#     ./win32/bin/vc7.1-release-64             #
 85#     ./win32/bin/vc9-debug-32                 #
 86#     ./Unix/i386-debug-64                     #
 87################################################
 88IF(WIN32)
 89  IF(MSVC) # The compiler used is MSVC
 90    MESSAGE(STATUS "Found MSVC compiler: ${MSVC} ${MSVC_VERSION}")
 91    SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/)
 92  ELSEIF (BORLAND) # The compiler used is BORLAND
 93    SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/win${BIT}/bin/${CMAKE_BUILD_TYPE})
 94  ELSE()
 95    SET(LIBRARY_OUTPUT_PATH win${BIT}/bin/${CMAKE_BUILD_TYPE})
 96  ENDIF()
 97  SET(EXECUTABLE_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH})
 98ELSE(WIN32)
 99  SET(LIBRARY_OUTPUT_PATH ${PLATFORM}/${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_BUILD_TYPE}-${BIT})
100ENDIF(WIN32)
101MESSAGE(STATUS "output_path: ${LIBRARY_OUTPUT_PATH}")
102
103#####################
104# Add include paths #
105#####################
106INCLUDE_DIRECTORIES(src/NMTDS)
107INCLUDE_DIRECTORIES(src/NMTTools)
108INCLUDE_DIRECTORIES(src/GEOMAlgo/ src/BlockFix)
109INCLUDE_DIRECTORIES(src/GEOM/)
110INCLUDE_DIRECTORIES(src/Partition)
111
112#######################
113# Define source files #
114#######################
115FILE(GLOB libGEOM_source_files src/NMTDS/NMTDS_*.cpp
116                               src/NMTTools/NMTTools_*.cpp
117                               src/GEOMAlgo/GEOMAlgo_*.cpp
118                               src/GEOM/GEOM_*.cpp
119                               src/Archimede/Archimede_VolumeSection.cpp
120                               src/BlockFix/BlockFix*.cpp
121                               src/ExchangeBREP/ExchangeBREP_Export.cpp src/ExchangeBREP/ExchangeBREP_Import.cpp
122                               src/ExchangeCSFDB/ExchangeCSFDB_Export.cpp src/ExchangeCSFDB/ExchangeCSFDB_Import.cpp
123                               src/ExchangeIGES/ExchangeIGES_Export.cpp src/ExchangeIGES/ExchangeIGES_Import.cpp
124                               src/ExchangeSTEP/ExchangeSTEP_Export.cpp src/ExchangeSTEP/ExchangeSTEP_Import.cpp
125                               src/ExchangeSTL/ExchangeSTL_Export.cpp
126                               src/ExchangeVRML/ExchangeVRML_Export.cpp
127                               src/ShHealOper/ShHealOper_*.cpp
128                               src/Sketcher/Sketcher*.cpp
129                               src/GEOMImpl/GEOMImpl_*.cpp
130                               src/Partition/Partition_*.cpp
131                               )
132
133##################################
134# Build a single dynamic library #
135##################################
136ADD_LIBRARY(GEOM SHARED ${libGEOM_source_files})
137TARGET_LINK_LIBRARIES(GEOM TKernel TKBRep TKBO TKMath
138                           TKG3d TKG2d TKGeomAlgo TKGeomBase TKTopAlgo
139                           TKService TKBool TKMesh TKShHealing
140                           TKLCAF TKCAF TKCDF TKAdvTools TKXSBase
141                           TKPShape PTKernel TKShapeSchema
142                           TKIGES TKSTEPBase TKSTEP TKSTL TKVRML
143                           TKPrim TKFillet TKOffset TKFeat
144                           TKV3d ${CMAKE_DL_LIBS}
145                           )
146SET_TARGET_PROPERTIES(GEOM PROPERTIES
147      SOVERSION ${${PROJECT_NAME}_ABI_SOVERSION}
148      VERSION ${${PROJECT_NAME}_ABI_VERSION})
149
150####################
151# Install location #
152####################
153IF( NOT DEFINED ${PROJECT_NAME}_INSTALL_PREFIX )
154  IF( WIN32 )
155    SET(${PROJECT_NAME}_INSTALL_PREFIX
156      "c:/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}")
157  ELSE( WIN32 )
158    SET(${PROJECT_NAME}_INSTALL_PREFIX
159      "/usr/local")
160  ENDIF( WIN32 )
161ENDIF( NOT DEFINED ${PROJECT_NAME}_INSTALL_PREFIX )
162
163SET( ${PROJECT_NAME}_INSTALL_PREFIX ${${PROJECT_NAME}_INSTALL_PREFIX} CACHE
164  PATH "Install prefix prepended to target to create install location" )
165SET( CMAKE_INSTALL_PREFIX "${${PROJECT_NAME}_INSTALL_PREFIX}" CACHE INTERNAL "Prefix
166  prepended to install directories if target destination is not absolute,
167  immutable" FORCE )
168
169################
170# Install GEOM #
171################
172IF (UNIX)
173    # Install lib (by default to /usr/local/lib)
174    INSTALL(TARGETS GEOM DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
175    # Install headers (by default to /usr/local/include/geom)
176    INSTALL(DIRECTORY inc/
177            DESTINATION ${CMAKE_INSTALL_PREFIX}/include/geom
178            FILES_MATCHING PATTERN "*.*"
179            )
180ENDIF(UNIX)
181
182########################
183# Packaging with CPack #
184# $ make package       #
185########################
186SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GEOM library")
187SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.LINUX")
188SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENCE.lgpl.txt")
189SET(CPACK_SET_DESTDIR "ON")
190
191# Define version
192SET(CPACK_PACKAGE_VERSION_MAJOR ${GEOM_VERSION_MAJOR})
193SET(CPACK_PACKAGE_VERSION_MINOR ${GEOM_VERSION_MINOR})
194SET(CPACK_PACKAGE_VERSION_PATCH ${GEOM_VERSION_PATCH})
195SET(CPACK_PACKAGE_NAME ${PROJECT_NAME} )
196SET(CPACK_PACKAGE_CONTACT "pythonocc mailing list <pythonocc-users@gna.org>")
197INCLUDE(InstallRequiredSystemLibraries)
198 
199INCLUDE(CPack)