Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including elastix by another project failed #44

Closed
F462 opened this issue Jan 23, 2018 · 2 comments
Closed

Including elastix by another project failed #44

F462 opened this issue Jan 23, 2018 · 2 comments

Comments

@F462
Copy link

F462 commented Jan 23, 2018

When trying to include elastix by another project the following cmake error occurs:

-- Including Elastix settings.
CMake Error at src/elastix/build/UseElastix.cmake:25 (include):
include called with wrong number of arguments. include() only takes one
file.
Call Stack (most recent call first):
CMakeLists.txt:273 (INCLUDE)

with the following include by the other project:
SET(ELASTIX_BINARY_DIR [PATH TO ELASTIX]/build)
SET( ELASTIX_USE_FILE ${ELASTIX_BINARY_DIR}/UseElastix.cmake )
INCLUDE( ${ELASTIX_USE_FILE} )

Including the following line at the beginning of the file build/UseElastix.cmake solves the problem for me:
include( [PATH TO ELASTIX]/build/ElastixConfig.cmake )

Maybe you want to change UseElastix.cmake.in with appropriate cmake variables to keep it general?

@kaspermarstal
Copy link
Member

You should use find_package(Elastix) to find elastix. Your code should look like this:

SET(ELASTIX_BINARY_DIR [PATH TO ELASTIX]/build)
find_package(Elastix)

Try this and let me know how it goes.

@F462
Copy link
Author

F462 commented Jan 23, 2018

Hi kaspermarstal,

thank you for your quick response! Your advice did the trick.

Best regards,
Fabian

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

No branches or pull requests

2 participants