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

@rolandlo @bhennion, we should add something like this to the CMake scripts, to ensure that everyone uses the installation: #5658

Open
Febbe opened this issue May 3, 2024 · 3 comments

Comments

@Febbe
Copy link
Collaborator

Febbe commented May 3, 2024

          @rolandlo @bhennion, we should add something like this to the CMake scripts, to ensure that everyone uses the installation:
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
    set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Default install path." FORCE)
    set_target_properties(xournalpp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/install/bin")
endif()

add_custom_command(
    TARGET xournalpp POST_BUILD
    COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --config $<CONFIG>
)

This will automatically install Xournal++ into <build>/install/bin.
It also integrates with build tools, since the RUNTIME_OUTPUT_DIRECTORY is the same as the installation's RUNTIME DESTINATION directory

Originally posted by @Febbe in #5620 (comment)

@bhennion
Copy link
Contributor

bhennion commented May 4, 2024

I wouldn't do that:

  • it removes flexibility, e.g. forces building the translations (dependency of the install target) even if we just want to build the test-units
  • it doesn't really help: it doesn't stop the user/dev from running ./xournalpp instead of ./install/bin/xournalpp

@Febbe
Copy link
Collaborator Author

Febbe commented May 4, 2024

* it removes flexibility, e.g. forces building the translations (dependency of the install target) even if we just want to build the test-units

It only adds the installation to the xournalpp target, you still can build tests without it and without translations.
You can disble it, by specifying a custom installation dir.

* it doesn't really help: it doesn't stop the user/dev from running ./xournalpp instead of ./install/bin/xournalpp

Currently, it would, since ./xournalpp is not even created.

@bhennion
Copy link
Contributor

bhennion commented May 4, 2024

I see. Then yes, something like that woud be nice!

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