Skip to content

Commit 0a8791e

Browse files
committed
Clean up CMake biz by using OCE_LIBRARIES variable for defining OCE libs + fix setting of PYTHON_INCLUDE_DIR + PYTHON_LIBRARY vars + small README.md cleanup.
1 parent 3187791 commit 0a8791e

3 files changed

Lines changed: 12 additions & 17 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ the cmake/ folder.
3535
The preferred way to fetch and build this project's dependencies is to use the build scripts
3636
in win/ folder. See win/readme.txt for more information. Instructions in a nutshell
3737
(assuming Visual Studio x64 environment variables set):
38-
> git clone https://github.com/Tridify/IfcOpenShell.git
38+
> git clone https://github.com/IfcOpenShell/IfcOpenShell.git
3939
> cd oce\win
4040
> build-deps.cmd (defaults to using VS 2015 x64 RelWithDebInfo build)
4141
> run-cmake.bat (defaults to using VS 2015 x64)
42-
> copy-runtime-deps.bat (defaults to using RelWithDebInfo)
4342
> ..\build-vs2015-x64\IfcOpenShell.sln
4443
You can now build the solution using the RelWithDebInfo configuration
4544
You can also build the INSTALL project if wanted

cmake/CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ ELSE()
5454
MESSAGE(FATAL_ERROR "Unable to find header files, aborting")
5555
ENDIF()
5656

57+
SET(OCE_LIBRARIES
58+
TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO
59+
TKFillet TKSTEP TKSTEPBase TKSTEPAttr TKXSBase TKSTEP209 TKIGES TKOffset
60+
)
61+
5762
IF("$ENV{OCC_LIBRARY_DIR}" STREQUAL "")
5863
SET(OCC_LIBRARY_DIR "/usr/lib/" CACHE FILEPATH "Open CASCADE library files")
5964
MESSAGE(STATUS "Looking for opencascade library files in: ${OCC_LIBRARY_DIR}")
@@ -246,21 +251,15 @@ file(GLOB H_FILES ../src/ifcconvert/*.h)
246251
set(SOURCE_FILES ${CPP_FILES} ${H_FILES})
247252
ADD_EXECUTABLE(IfcConvert ${SOURCE_FILES})
248253

249-
TARGET_LINK_LIBRARIES(IfcConvert IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing
250-
TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKSTEP TKSTEPBase TKSTEPAttr TKXSBase TKSTEP209 TKIGES TKOffset
251-
${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES}
252-
)
254+
TARGET_LINK_LIBRARIES(IfcConvert IfcParse IfcGeom ${OCE_LIBRARIES} ${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES})
253255

254256
# IfcGeomServer
255257
file(GLOB CPP_FILES ../src/ifcgeomserver/*.cpp)
256258
file(GLOB H_FILES ../src/ifcgeomserver/*.h)
257259
set(SOURCE_FILES ${CPP_FILES} ${H_FILES})
258260
ADD_EXECUTABLE(IfcGeomServer ${SOURCE_FILES})
259261

260-
TARGET_LINK_LIBRARIES(IfcGeomServer IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing
261-
TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKSTEP TKSTEPBase TKSTEPAttr TKXSBase TKSTEP209 TKIGES TKOffset
262-
${Boost_LIBRARIES}
263-
)
262+
TARGET_LINK_LIBRARIES(IfcGeomServer IfcParse IfcGeom ${OCE_LIBRARIES} ${Boost_LIBRARIES})
264263

265264
IF(BUILD_IFCPYTHON)
266265
ADD_SUBDIRECTORY(../src/ifcwrap ifcwrap)

src/ifcwrap/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ FIND_PACKAGE(SWIG)
2121

2222
IF(SWIG_FOUND)
2323

24-
INCLUDE(${SWIG_USE_FILE})
24+
INCLUDE(${SWIG_USE_FILE})
2525

26-
IF(NOT "$ENV{OCC_LIBRARY_DIR}" STREQUAL "")
26+
IF(NOT "$ENV{PYTHON_INCLUDE_DIR}" STREQUAL "")
2727
SET(PYTHON_INCLUDE_DIR $ENV{PYTHON_INCLUDE_DIR} CACHE FILEPATH "Python header files")
2828
MESSAGE(STATUS "Looking for Python header files in: ${PYTHON_INCLUDE_DIR}")
2929
ENDIF()
30-
IF(NOT "$ENV{OCC_LIBRARY_DIR}" STREQUAL "")
30+
IF(NOT "$ENV{PYTHON_LIBRARY}" STREQUAL "")
3131
SET(PYTHON_LIBRARY $ENV{PYTHON_LIBRARY} CACHE FILEPATH "Python library file")
3232
MESSAGE(STATUS "Looking for Python library file in: ${PYTHON_LIBRARY}")
3333
ENDIF()
@@ -50,10 +50,7 @@ ENDIF()
5050

5151
SET_SOURCE_FILES_PROPERTIES(IfcPython.i PROPERTIES CPLUSPLUS ON)
5252
SWIG_ADD_MODULE(ifcopenshell_wrapper python IfcPython.i)
53-
SWIG_LINK_LIBRARIES(ifcopenshell_wrapper
54-
${PYTHON_LIBRARIES} IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing
55-
TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKOffset ${ICU_LIBRARIES}
56-
)
53+
SWIG_LINK_LIBRARIES(ifcopenshell_wrapper IfcParse IfcGeom ${PYTHON_LIBRARIES} ${OCE_LIBRARIES} ${ICU_LIBRARIES})
5754

5855
# To install IfcPython let's get the site-packages dir from python
5956
EXECUTE_PROCESS(COMMAND

0 commit comments

Comments
 (0)