Skip to content

Cmake improvements: LINK_DIRECTORIES and OCCT 7#114

Merged
aothms merged 2 commits into
IfcOpenShell:masterfrom
aothms:cmake_improvements
Aug 8, 2016
Merged

Cmake improvements: LINK_DIRECTORIES and OCCT 7#114
aothms merged 2 commits into
IfcOpenShell:masterfrom
aothms:cmake_improvements

Conversation

@aothms

@aothms aothms commented Aug 7, 2016

Copy link
Copy Markdown
Member

Link directories

e9bd18f

Fixes #111. There are issues with LINK_DIRECTORIES and multiple installations of Open Cascade. This is brittle as linker is invoked with -Lpath_1 ... -Lpath_n -llib_1 ... -llib_n and nothing is known on which is lib is to be located from which path. By using absolute paths in cmake the linker is invoked with path_1/lib_1 ... path_n/lib_n.

From https://cmake.org/cmake/help/v3.0/command/link_directories.html

Note that this command is rarely necessary. Library locations returned by find_package() and find_library() are absolute paths. Pass these absolute library file paths directly to the target_link_libraries() command. CMake will ensure the linker finds them.

OCCT 7

1def5db

It appears IfcOpenShell runs and compiles fine with OCCT 7. OCCT 7 comes with a relatively complete cmake script including the options for building static libs on Windows (no static runtime though), contrary to 6.9.1 and therefore is a now a suitable candidate for linking with IfcOpenShell. OCCT 7 requires -std=c++11, so the version number is determined in CMake.

At first sight it seems that http://git.dev.opencascade.org/gitweb/?p=occt.git;a=tree;h=V7_0_0 is not completely identical to https://www.opencascade.com/sites/default/files/private/occt/OCC_7.0.0_release/opencascade-7.0.0.tgz

@aothms aothms merged commit 59035e7 into IfcOpenShell:master Aug 8, 2016
Comment thread cmake/CMakeLists.txt
)
IF(NOT "${PCRE_LIBRARY_DIR}" STREQUAL "")

# Use the found libTKernel as a template for all other OCC libraries

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo referring to the wrong library here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks fixed.

@Stinkfist0

Stinkfist0 commented Aug 24, 2016

Copy link
Copy Markdown
Contributor

BTW this broke MSVC debug build (trying to link to library_d_.lib_d_ instead of library_d_.lib), but I'll fix it in my OCCT 7.0.0 pull request.

@Stinkfist0

Stinkfist0 commented Aug 24, 2016

Copy link
Copy Markdown
Contributor

But I don't mind if you find a fix soon ;) I'm currently working getting RelWithDebInfo IfcOpenShell to build against the latest OCCT (need to link to some new libraries at least on MSVC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants