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

CMake: enable building and installing as a library #311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rouault
Copy link

@rouault rouault commented Jun 30, 2022

This is far less ambitious than #13, but I hope it can be merged more easily as it doesn't reorganize files.

It also generate CMake export files, and a basisu::basisu_lib CMake target, which makes it easy to use basis_universal from other CMake projects

The build can use the ZSTD from the library when available, otherwise fallbacks to the embeded copy.

Tested on Linux (ubuntu 20.04) and Windows (MSVC 2019)

@richgel999
Copy link
Contributor

Thank you. It's still a lot of changes, so I'll need to review it. It's queued up.

@hjaekel
Copy link

hjaekel commented Jan 6, 2023

I would also suggest to add VERSION and SOVERSION properties to the library properties.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -153,7 +153,7 @@
 
 set(BASISU_LIB_TARGET "basisu_lib")
 add_library(${BASISU_LIB_TARGET} ${BASISU_SRC_LIST})
-set_target_properties(${BASISU_LIB_TARGET} PROPERTIES OUTPUT_NAME "basisu")
+set_target_properties(${BASISU_LIB_TARGET} PROPERTIES OUTPUT_NAME "basisu" VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION}")
 target_include_directories(${BASISU_LIB_TARGET} PUBLIC
                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/transcoder>
                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/encoder>

@dbs4261
Copy link

dbs4261 commented Jul 24, 2023

Any movement on this PR? It would significantly help with integrating the library in other tools.

Choose a reason for hiding this comment

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

Redundant, facebook/zstd installs the exported targets

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.

5 participants