Skip to content

Commit 456adce

Browse files
committed
Add install targets to makefile
1 parent 798397f commit 456adce

2 files changed

Lines changed: 65 additions & 6 deletions

File tree

cmake/CMakeLists.txt

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ELSE()
1111
MESSAGE(STATUS "Looking for opencascade include files in: ${OCC_INCLUDE_DIR}")
1212
ENDIF()
1313

14-
FIND_FILE(gp_Pnt_hxx "gp_Pnt.hxx" ${OCC_INCLUDE_DIR} /usr/inc /usr/local/inc)
14+
FIND_FILE(gp_Pnt_hxx "gp_Pnt.hxx" ${OCC_INCLUDE_DIR} /usr/inc /usr/local/inc /usr/local/include/oce)
1515
IF(gp_Pnt_hxx)
1616
MESSAGE(STATUS "Header files found")
1717
ELSE()
@@ -41,7 +41,7 @@ FIND_LIBRARY(icu "icuuc" /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
4141
IF(icu)
4242
MESSAGE(STATUS "ICU libraries found")
4343
ELSE()
44-
MESSAGE(STATUS "Unable to find ICU library files, aborting")
44+
MESSAGE(STATUS "Unable to find ICU library files, continuing")
4545
ADD_DEFINITIONS(-DHAVE_ICU)
4646
ENDIF()
4747

@@ -72,7 +72,7 @@ IF(NOT CMAKE_BUILD_TYPE)
7272
ENDIF(NOT CMAKE_BUILD_TYPE)
7373
ADD_DEFINITIONS(-fPIC -Wno-non-virtual-dtor)
7474

75-
INCLUDE_DIRECTORIES(${OCC_INCLUDE_DIR} /usr/inc /usr/local/inc)
75+
INCLUDE_DIRECTORIES(${OCC_INCLUDE_DIR} /usr/inc /usr/local/inc /usr/local/include/oce)
7676
ADD_LIBRARY(IfcParse STATIC
7777
../src/ifcparse/Ifc2x3.cpp
7878
../src/ifcparse/IfcUtil.cpp
@@ -91,7 +91,10 @@ ADD_LIBRARY(IfcGeom STATIC
9191
../src/ifcgeom/IfcRegister.cpp
9292
)
9393

94-
TARGET_LINK_LIBRARIES(IfcParse icuuc)
94+
IF(icu)
95+
TARGET_LINK_LIBRARIES(IfcParse icuuc)
96+
ENDIF()
97+
9598
TARGET_LINK_LIBRARIES(IfcGeom IfcParse)
9699

97100
LINK_DIRECTORIES (${IfcOpenShell_BINARY_DIR} /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
@@ -103,3 +106,36 @@ ADD_SUBDIRECTORY(../src/ifcwrap ifcwrap)
103106

104107
# Build IfcParseExamples using separate CMakeLists.txt
105108
ADD_SUBDIRECTORY(../src/examples examples)
109+
110+
# CMake installation targets
111+
SET(include_files_geom
112+
../src/ifcgeom/IfcGeom.h
113+
../src/ifcgeom/IfcGeomObjects.h
114+
../src/ifcgeom/IfcRegister.h
115+
../src/ifcgeom/IfcRegisterConvertCurve.h
116+
../src/ifcgeom/IfcRegisterConvertFace.h
117+
../src/ifcgeom/IfcRegisterConvertShape.h
118+
../src/ifcgeom/IfcRegisterConvertShapes.h
119+
../src/ifcgeom/IfcRegisterConvertWire.h
120+
../src/ifcgeom/IfcRegisterCreateCache.h
121+
../src/ifcgeom/IfcRegisterDef.h
122+
../src/ifcgeom/IfcRegisterGeomHeader.h
123+
../src/ifcgeom/IfcRegisterIsShapeCollection.h
124+
../src/ifcgeom/IfcRegisterPurgeCache.h
125+
../src/ifcgeom/IfcRegisterUndef.h
126+
../src/ifcgeom/IfcShapeList.h
127+
)
128+
SET(include_files_parse
129+
../src/ifcparse/Ifc2x3.h
130+
../src/ifcparse/Ifc2x3enum.h
131+
../src/ifcparse/IfcCharacterDecoder.h
132+
../src/ifcparse/IfcException.h
133+
../src/ifcparse/IfcFile.h
134+
../src/ifcparse/IfcParse.h
135+
../src/ifcparse/IfcUtil.h
136+
../src/ifcparse/SharedPointer.h
137+
)
138+
INSTALL(FILES ${include_files_geom} DESTINATION include/ifcgeom)
139+
INSTALL(FILES ${include_files_parse} DESTINATION include/ifcparse)
140+
INSTALL(TARGETS IfcObj DESTINATION bin)
141+
INSTALL(TARGETS IfcParse IfcGeom DESTINATION lib)

src/ifcwrap/CMakeLists.txt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
FIND_PACKAGE(SWIG REQUIRED)
1+
FIND_PACKAGE(SWIG)
2+
3+
IF(SWIG_FOUND)
4+
25
INCLUDE(${SWIG_USE_FILE})
36

4-
FIND_PACKAGE(PythonLibs REQUIRED)
7+
FIND_PACKAGE(PythonLibs)
8+
9+
IF(PYTHONLIBS_FOUND)
10+
511
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
612

713
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
@@ -11,3 +17,20 @@ SET(CMAKE_SWIG_FLAGS "")
1117
SET_SOURCE_FILES_PROPERTIES(IfcPython.i PROPERTIES CPLUSPLUS ON)
1218
SWIG_ADD_MODULE(IfcImport python IfcPython.i)
1319
SWIG_LINK_LIBRARIES(IfcImport ${PYTHON_LIBRARIES} IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet)
20+
21+
# To install IfcPython let's get the site-packackes dir from python
22+
EXECUTE_PROCESS(COMMAND python -c "from distutils.sysconfig import get_python_lib as x; print (x())"
23+
OUTPUT_VARIABLE python_package_dir)
24+
25+
# Strip trailing whitespace from python print
26+
STRING(REPLACE "\r" "" python_package_dir "${python_package_dir}")
27+
STRING(REPLACE "\n" "" python_package_dir "${python_package_dir}")
28+
29+
INSTALL(FILES
30+
"${CMAKE_BINARY_DIR}/ifcwrap/IfcImport.py"
31+
"${CMAKE_BINARY_DIR}/ifcwrap/_IfcImport.so"
32+
DESTINATION "${python_package_dir}")
33+
34+
ENDIF(PYTHONLIBS_FOUND)
35+
36+
ENDIF(SWIG_FOUND)

0 commit comments

Comments
 (0)