Browse Source

Make SONAME equal to the PROJECT_VERSION

* If the ABI is unstable, making the SONAME equal
  to the PROJECT_VERSION at least allows packagers
  to notice when potential breakage is about to occur.
David Seifert 7 years ago
parent
commit
b8e1c488b9
1 changed files with 20 additions and 21 deletions
  1. 20
    21
      CMakeLists.txt

+ 20
- 21
CMakeLists.txt View File

@@ -10,6 +10,8 @@ endif()
10 10
 
11 11
 include(GNUInstallDirs)
12 12
 
13
+set( BUILD_SHARED_LIBS ON CACHE BOOL "Build all libraries as shared" )
14
+
13 15
 # This should really never be disabled. The pure-X mode of slop is very expensive and buggy.
14 16
 # It also doesn't work on Wayland. Though if a system is never running a compositor, or
15 17
 # doesn't have OpenGL, this could remove some linking dependencies I suppose.
@@ -28,29 +30,26 @@ add_definitions(-DSLOP_VERSION="v${PROJECT_VERSION}")
28 30
 set(EXECUTABLE_NAME "slop")
29 31
 set(LIBRARY_NAME "slopy")
30 32
 
33
+add_library(${LIBRARY_NAME}
34
+  src/mouse.cpp
35
+  src/keyboard.cpp
36
+  src/x.cpp
37
+  src/slopstates.cpp
38
+  src/resource.cpp
39
+  src/slop.cpp
40
+  src/rectangle.cpp
41
+  src/xshaperectangle.cpp)
42
+set_target_properties(${LIBRARY_NAME}
43
+  PROPERTIES
44
+  VERSION ${PROJECT_VERSION}
45
+  SOVERSION ${PROJECT_VERSION})
31 46
 
32 47
 if ( SLOP_OPENGL )
33
-  add_library(${LIBRARY_NAME} SHARED  src/mouse.cpp
34
-                                      src/keyboard.cpp
35
-                                      src/x.cpp
36
-                                      src/slopstates.cpp
37
-                                      src/resource.cpp
38
-                                      src/slop.cpp
39
-                                      src/rectangle.cpp
40
-                                      src/xshaperectangle.cpp
41
-                                      src/shader.cpp
42
-                                      src/window.cpp
43
-                                      src/framebuffer.cpp
44
-                                      src/glrectangle.cpp)
45
-else()
46
-  add_library(${LIBRARY_NAME} SHARED  src/mouse.cpp
47
-                                      src/keyboard.cpp
48
-                                      src/x.cpp
49
-                                      src/slopstates.cpp
50
-                                      src/resource.cpp
51
-                                      src/slop.cpp
52
-                                      src/rectangle.cpp
53
-                                      src/xshaperectangle.cpp)
48
+  target_sources(${LIBRARY_NAME} PRIVATE
49
+    src/shader.cpp
50
+    src/window.cpp
51
+    src/framebuffer.cpp
52
+    src/glrectangle.cpp)
54 53
 endif()
55 54
 
56 55
 set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)