Browse Source

Merge pull request #94 from SoapGentoo/soname

Make SONAME equal to the PROJECT_VERSION
Dalton Nell 6 years ago
parent
commit
a28a1da876
No account linked to committer's email
1 changed files with 20 additions and 21 deletions
  1. 20
    21
      CMakeLists.txt

+ 20
- 21
CMakeLists.txt View File

10
 
10
 
11
 include(GNUInstallDirs)
11
 include(GNUInstallDirs)
12
 
12
 
13
+set( BUILD_SHARED_LIBS ON CACHE BOOL "Build all libraries as shared" )
14
+
13
 # This should really never be disabled. The pure-X mode of slop is very expensive and buggy.
15
 # This should really never be disabled. The pure-X mode of slop is very expensive and buggy.
14
 # It also doesn't work on Wayland. Though if a system is never running a compositor, or
16
 # It also doesn't work on Wayland. Though if a system is never running a compositor, or
15
 # doesn't have OpenGL, this could remove some linking dependencies I suppose.
17
 # doesn't have OpenGL, this could remove some linking dependencies I suppose.
28
 set(EXECUTABLE_NAME "slop")
30
 set(EXECUTABLE_NAME "slop")
29
 set(LIBRARY_NAME "slopy")
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
 if ( SLOP_OPENGL )
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
 endif()
53
 endif()
55
 
54
 
56
 set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
55
 set_property(TARGET ${LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)