summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-01-31 19:39:48 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-01-31 19:39:48 +0100
commit516bc854369243b2f1ba4f1c019aca06cbbd736e (patch)
tree82cbc27a8975af41b694090172421e8dd83c9d92 /src
parent9312c14b47a2d6e58238902d1424ae8d45d73ac5 (diff)
downloadpianobar-516bc854369243b2f1ba4f1c019aca06cbbd736e.tar.gz
pianobar-516bc854369243b2f1ba4f1c019aca06cbbd736e.tar.bz2
pianobar-516bc854369243b2f1ba4f1c019aca06cbbd736e.zip
Whoops, forgot to add new files to last commit...
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt34
-rw-r--r--src/FindFaad.cmake35
-rw-r--r--src/FindLibAo.cmake37
-rw-r--r--src/FindReadline.cmake37
-rw-r--r--src/config.h.in1
5 files changed, 144 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..0274af0
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,34 @@
+set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+find_package (LibXml2 REQUIRED)
+find_package (CURL REQUIRED)
+find_package (Faad REQUIRED)
+find_package (Readline REQUIRED)
+find_package (LibAo REQUIRED)
+find_package (Threads REQUIRED)
+find_library (LIBM m)
+
+if (NOT CMAKE_USE_PTHREADS_INIT)
+ message (FATAL_ERROR "pthread is currently required")
+endif (NOT CMAKE_USE_PTHREADS_INIT)
+
+if (NOT LIBM)
+ message (FATAL_ERROR "libm is required")
+endif (NOT LIBM)
+
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+
+include_directories (
+ ${pianobar_SOURCE_DIR}/libpiano/src
+ ${pianobar_SOURCE_DIR}/libwardrobe/src
+ ${LIBXML2_INCLUDE_DIR}
+ ${CURL_INCLUDE_DIRS} ${READLINE_INCLUDE_DIR} ${FAAD_INCLUDE_DIRS}
+ ${LIBAO_INCLUDE_DIRS})
+
+add_executable (pianobar main.c terminal.c settings.c player.c ui.c ui_act.c)
+target_link_libraries (pianobar piano wardrobe ${CURL_LIBRARIES}
+ ${LIBXML2_LIBRARIES} ${READLINE_LIBRARY} ${FAAD_LIBRARY} ${LIBAO_LIBRARY}
+ ${CMAKE_THREAD_LIBS_INIT} ${LIBM})
+
+install (TARGETS pianobar RUNTIME DESTINATION bin)
+install (FILES pianobar.1 DESTINATION share/man/man1)
diff --git a/src/FindFaad.cmake b/src/FindFaad.cmake
new file mode 100644
index 0000000..9a8fc57
--- /dev/null
+++ b/src/FindFaad.cmake
@@ -0,0 +1,35 @@
+# FAAD_INCLUDE_DIRS - where to find curl/curl.h, etc.
+# FAAD_LIBRARIES - List of libraries when using curl.
+# FAAD_FOUND - True if curl found.
+
+# Look for the header file.
+FIND_PATH(FAAD_INCLUDE_DIR NAMES faad.h)
+MARK_AS_ADVANCED(FAAD_INCLUDE_DIR)
+
+# Look for the library.
+FIND_LIBRARY(FAAD_LIBRARY NAMES faad)
+MARK_AS_ADVANCED(FAAD_LIBRARY)
+
+# Copy the results to the output variables.
+IF(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
+ SET(FAAD_FOUND 1)
+ SET(FAAD_LIBRARIES ${FAAD_LIBRARY})
+ SET(FAAD_INCLUDE_DIRS ${FAAD_INCLUDE_DIR})
+ELSE(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
+ SET(FAAD_FOUND 0)
+ SET(FAAD_LIBRARIES)
+ SET(FAAD_INCLUDE_DIRS)
+ENDIF(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
+
+# Report the results.
+IF(NOT FAAD_FOUND)
+ SET(FAAD_DIR_MESSAGE
+ "FAAD was not found. Make sure FAAD_LIBRARY and FAAD_INCLUDE_DIR are set.")
+ IF(NOT FAAD_FIND_QUIETLY)
+ MESSAGE(STATUS "${FAAD_DIR_MESSAGE}")
+ ELSE(NOT FAAD_FIND_QUIETLY)
+ IF(FAAD_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${FAAD_DIR_MESSAGE}")
+ ENDIF(FAAD_FIND_REQUIRED)
+ ENDIF(NOT FAAD_FIND_QUIETLY)
+ENDIF(NOT FAAD_FOUND)
diff --git a/src/FindLibAo.cmake b/src/FindLibAo.cmake
new file mode 100644
index 0000000..be15975
--- /dev/null
+++ b/src/FindLibAo.cmake
@@ -0,0 +1,37 @@
+# - Find readline
+#
+# LIBAO_INCLUDE_DIRS - where to find curl/curl.h, etc.
+# LIBAO_LIBRARIES - List of libraries when using curl.
+# LIBAO_FOUND - True if curl found.
+
+# Look for the header file.
+FIND_PATH(LIBAO_INCLUDE_DIR NAMES ao/ao.h)
+MARK_AS_ADVANCED(LIBAO_INCLUDE_DIR)
+
+# Look for the library.
+FIND_LIBRARY(LIBAO_LIBRARY NAMES ao)
+MARK_AS_ADVANCED(LIBAO_LIBRARY)
+
+# Copy the results to the output variables.
+IF(LIBAO_INCLUDE_DIR AND LIBAO_LIBRARY)
+ SET(LIBAO_FOUND 1)
+ SET(LIBAO_LIBRARIES ${LIBAO_LIBRARY})
+ SET(LIBAO_INCLUDE_DIRS ${LIBAO_INCLUDE_DIR})
+ELSE(LIBAO_INCLUDE_DIR AND LIBAO_LIBRARY)
+ SET(LIBAO_FOUND 0)
+ SET(LIBAO_LIBRARIES)
+ SET(LIBAO_INCLUDE_DIRS)
+ENDIF(LIBAO_INCLUDE_DIR AND LIBAO_LIBRARY)
+
+# Report the results.
+IF(NOT LIBAO_FOUND)
+ SET(LIBAO_DIR_MESSAGE
+ "LIBAO was not found. Make sure LIBAO_LIBRARY and LIBAO_INCLUDE_DIR are set.")
+ IF(NOT LIBAO_FIND_QUIETLY)
+ MESSAGE(STATUS "${LIBAO_DIR_MESSAGE}")
+ ELSE(NOT LIBAO_FIND_QUIETLY)
+ IF(LIBAO_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${LIBAO_DIR_MESSAGE}")
+ ENDIF(LIBAO_FIND_REQUIRED)
+ ENDIF(NOT LIBAO_FIND_QUIETLY)
+ENDIF(NOT LIBAO_FOUND)
diff --git a/src/FindReadline.cmake b/src/FindReadline.cmake
new file mode 100644
index 0000000..67ea232
--- /dev/null
+++ b/src/FindReadline.cmake
@@ -0,0 +1,37 @@
+# - Find readline
+#
+# READLINE_INCLUDE_DIRS - where to find curl/curl.h, etc.
+# READLINE_LIBRARIES - List of libraries when using curl.
+# READLINE_FOUND - True if curl found.
+
+# Look for the header file.
+FIND_PATH(READLINE_INCLUDE_DIR NAMES readline/readline.h)
+MARK_AS_ADVANCED(READLINE_INCLUDE_DIR)
+
+# Look for the library.
+FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
+MARK_AS_ADVANCED(READLINE_LIBRARY)
+
+# Copy the results to the output variables.
+IF(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+ SET(READLINE_FOUND 1)
+ SET(READLINE_LIBRARIES ${READLINE_LIBRARY})
+ SET(READLINE_INCLUDE_DIRS ${READLINE_INCLUDE_DIR})
+ELSE(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+ SET(READLINE_FOUND 0)
+ SET(READLINE_LIBRARIES)
+ SET(READLINE_INCLUDE_DIRS)
+ENDIF(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+
+# Report the results.
+IF(NOT READLINE_FOUND)
+ SET(READLINE_DIR_MESSAGE
+ "READLINE was not found. Make sure READLINE_LIBRARY and READLINE_INCLUDE_DIR are set.")
+ IF(NOT READLINE_FIND_QUIETLY)
+ MESSAGE(STATUS "${READLINE_DIR_MESSAGE}")
+ ELSE(NOT READLINE_FIND_QUIETLY)
+ IF(READLINE_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${READLINE_DIR_MESSAGE}")
+ ENDIF(READLINE_FIND_REQUIRED)
+ ENDIF(NOT READLINE_FIND_QUIETLY)
+ENDIF(NOT READLINE_FOUND)
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 0000000..60600a7
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1 @@
+#define PACKAGE "${PACKAGE}"