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

Building static libraries only applies to IL and not to ILU nor ILUT #95

Open
GabrieleGiuseppini opened this issue May 23, 2021 · 0 comments

Comments

@GabrieleGiuseppini
Copy link

Specifying BUILD_SHARED_LIBS only makes the IL library static, it has no effect on ILU nor ILUT.

Fix is quite simple, e.g. in the ILU CMakeLists.txt:

diff --git a/DevIL/src-ILU/CMakeLists.txt b/DevIL/src-ILU/CMakeLists.txt
index 17a3afe7..5816dada 100644
--- a/DevIL/src-ILU/CMakeLists.txt
+++ b/DevIL/src-ILU/CMakeLists.txt
@@ -42,9 +42,12 @@ source_group("Source Files" FILES src/*.cpp)
 source_group("Header Files" FILES ${ILU_INC} )
 source_group("Resource Files" FILES ${ILU_RSRC} )
 
-# Remove SHARED to create a static library
-add_library(ILU SHARED ${ILU_SRCS} ${ILU_INC} ${ILU_RSRC})
-
+if(BUILD_SHARED_LIBS)
+    add_library(ILU SHARED ${ILU_SRCS} ${ILU_INC} ${ILU_RSRC})
+    set_target_properties(ILU PROPERTIES SOVERSION 1)
+else(BUILD_SHARED_LIBS)
+    add_library(ILU ${ILU_SRCS} ${ILU_INC} ${ILU_RSRC})
+endif(BUILD_SHARED_LIBS)
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

1 participant