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.

This commit is contained in:
Stinkfist0
2015-11-09 15:36:57 +02:00
parent 318779196b
commit 0a8791e04e
3 changed files with 12 additions and 17 deletions
+1 -2
View File
@@ -35,11 +35,10 @@ the cmake/ folder.
The preferred way to fetch and build this project's dependencies is to use the build scripts
in win/ folder. See win/readme.txt for more information. Instructions in a nutshell
(assuming Visual Studio x64 environment variables set):
> git clone https://github.com/Tridify/IfcOpenShell.git
> git clone https://github.com/IfcOpenShell/IfcOpenShell.git
> cd oce\win
> build-deps.cmd (defaults to using VS 2015 x64 RelWithDebInfo build)
> run-cmake.bat (defaults to using VS 2015 x64)
> copy-runtime-deps.bat (defaults to using RelWithDebInfo)
> ..\build-vs2015-x64\IfcOpenShell.sln
You can now build the solution using the RelWithDebInfo configuration
You can also build the INSTALL project if wanted
+7 -8
View File
@@ -54,6 +54,11 @@ ELSE()
MESSAGE(FATAL_ERROR "Unable to find header files, aborting")
ENDIF()
SET(OCE_LIBRARIES
TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO
TKFillet TKSTEP TKSTEPBase TKSTEPAttr TKXSBase TKSTEP209 TKIGES TKOffset
)
IF("$ENV{OCC_LIBRARY_DIR}" STREQUAL "")
SET(OCC_LIBRARY_DIR "/usr/lib/" CACHE FILEPATH "Open CASCADE library files")
MESSAGE(STATUS "Looking for opencascade library files in: ${OCC_LIBRARY_DIR}")
@@ -246,10 +251,7 @@ file(GLOB H_FILES ../src/ifcconvert/*.h)
set(SOURCE_FILES ${CPP_FILES} ${H_FILES})
ADD_EXECUTABLE(IfcConvert ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(IfcConvert IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing
TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKSTEP TKSTEPBase TKSTEPAttr TKXSBase TKSTEP209 TKIGES TKOffset
${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES}
)
TARGET_LINK_LIBRARIES(IfcConvert IfcParse IfcGeom ${OCE_LIBRARIES} ${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES})
# IfcGeomServer
file(GLOB CPP_FILES ../src/ifcgeomserver/*.cpp)
@@ -257,10 +259,7 @@ file(GLOB H_FILES ../src/ifcgeomserver/*.h)
set(SOURCE_FILES ${CPP_FILES} ${H_FILES})
ADD_EXECUTABLE(IfcGeomServer ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(IfcGeomServer IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing
TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKSTEP TKSTEPBase TKSTEPAttr TKXSBase TKSTEP209 TKIGES TKOffset
${Boost_LIBRARIES}
)
TARGET_LINK_LIBRARIES(IfcGeomServer IfcParse IfcGeom ${OCE_LIBRARIES} ${Boost_LIBRARIES})
IF(BUILD_IFCPYTHON)
ADD_SUBDIRECTORY(../src/ifcwrap ifcwrap)
+4 -7
View File
@@ -21,13 +21,13 @@ FIND_PACKAGE(SWIG)
IF(SWIG_FOUND)
INCLUDE(${SWIG_USE_FILE})
INCLUDE(${SWIG_USE_FILE})
IF(NOT "$ENV{OCC_LIBRARY_DIR}" STREQUAL "")
IF(NOT "$ENV{PYTHON_INCLUDE_DIR}" STREQUAL "")
SET(PYTHON_INCLUDE_DIR $ENV{PYTHON_INCLUDE_DIR} CACHE FILEPATH "Python header files")
MESSAGE(STATUS "Looking for Python header files in: ${PYTHON_INCLUDE_DIR}")
ENDIF()
IF(NOT "$ENV{OCC_LIBRARY_DIR}" STREQUAL "")
IF(NOT "$ENV{PYTHON_LIBRARY}" STREQUAL "")
SET(PYTHON_LIBRARY $ENV{PYTHON_LIBRARY} CACHE FILEPATH "Python library file")
MESSAGE(STATUS "Looking for Python library file in: ${PYTHON_LIBRARY}")
ENDIF()
@@ -50,10 +50,7 @@ ENDIF()
SET_SOURCE_FILES_PROPERTIES(IfcPython.i PROPERTIES CPLUSPLUS ON)
SWIG_ADD_MODULE(ifcopenshell_wrapper python IfcPython.i)
SWIG_LINK_LIBRARIES(ifcopenshell_wrapper
${PYTHON_LIBRARIES} IfcParse IfcGeom TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing
TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKOffset ${ICU_LIBRARIES}
)
SWIG_LINK_LIBRARIES(ifcopenshell_wrapper IfcParse IfcGeom ${PYTHON_LIBRARIES} ${OCE_LIBRARIES} ${ICU_LIBRARIES})
# To install IfcPython let's get the site-packages dir from python
EXECUTE_PROCESS(COMMAND