Skip to content
Browse files

Now creates both static and shared libraries

  • Loading branch information...
1 parent bbec36c commit e8f3e6622b5ee434ed239461bd31acc0f8ec178e @nova77 nova77 committed Jul 12, 2010
Showing with 22 additions and 10 deletions.
  1. +22 −10 fplib/CMakeLists.txt
View
32 fplib/CMakeLists.txt
@@ -5,6 +5,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
# uncomment if you wanna see some verbose action
#SET(CMAKE_VERBOSE_MAKEFILE ON)
+SET (LASTFM_FP_MAJOR 1)
+SET (LASTFM_FP_MINOR 6)
+SET (LASTFM_FP_PATCH 0)
+
# binaries get installed here
SET(CMAKE_INSTALL_PREFIX "/usr/")
@@ -17,20 +21,28 @@ IF(APPLE)
INCLUDE_DIRECTORIES(/opt/local/include/)
ENDIF(APPLE)
-ADD_LIBRARY(lastfmfp STATIC
- src/Filter
- src/FingerprintExtractor
- src/OptFFT
- )
-
-INSTALL(TARGETS lastfmfp ARCHIVE DESTINATION lib)
+SET( LASTFM_FP_SOURCES
+ src/Filter
+ src/FingerprintExtractor
+ src/OptFFT
+ )
+
+ADD_LIBRARY(lastfmfp_static STATIC ${LASTFM_FP_SOURCES})
+ADD_LIBRARY(lastfmfp_shared SHARED ${LASTFM_FP_SOURCES})
+
+SET_TARGET_PROPERTIES( lastfmfp_static PROPERTIES OUTPUT_NAME lastfmfp_static)
+SET_TARGET_PROPERTIES( lastfmfp_shared PROPERTIES OUTPUT_NAME lastfmfp)
+SET_TARGET_PROPERTIES( lastfmfp_shared PROPERTIES VERSION ${LASTFM_FP_MAJOR}.${LASTFM_FP_MINOR}.${LASTFM_FP_PATCH} SOVERSION ${LASTFM_FP_MINOR})
+
+INSTALL(TARGETS lastfmfp_static ARCHIVE DESTINATION lib)
+INSTALL(TARGETS lastfmfp_shared LIBRARY DESTINATION lib)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
SET(CPACK_SET_DESTDIR TRUE)
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Norman Casagrande <norman@last.fm>")
-SET(CPACK_PACKAGE_VERSION_MAJOR "1")
-SET(CPACK_PACKAGE_VERSION_MINOR "6")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_VERSION_MAJOR ${LASTFM_FP_MAJOR})
+SET(CPACK_PACKAGE_VERSION_MINOR ${LASTFM_FP_MINOR})
+SET(CPACK_PACKAGE_VERSION_PATCH ${LASTFM_FP_PATCH})
INCLUDE(CPack)

0 comments on commit e8f3e66

Please sign in to comment.
Something went wrong with that request. Please try again.