diff options
| author | 2010-02-07 01:59:03 +0100 | |
|---|---|---|
| committer | 2010-02-07 02:00:31 +0100 | |
| commit | c9db7c05573bee6e819ae76095e0d80f5fe02dd4 (patch) | |
| tree | 2ee4c78140ca4ac53e7aaf1fd760979338c79df9 | |
| parent | 003e72659b579e4376d099767f2e757e80d8f2a4 (diff) | |
| download | usbmuxd-c9db7c05573bee6e819ae76095e0d80f5fe02dd4.tar.gz usbmuxd-c9db7c05573bee6e819ae76095e0d80f5fe02dd4.tar.bz2 | |
Clean up CMakeLists (inspired by Gentoo patch)
| -rw-r--r-- | CMakeLists.txt | 33 | ||||
| -rw-r--r-- | daemon/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | libusbmuxd/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | tools/CMakeLists.txt | 1 |
4 files changed, 24 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 01dda18..64ef37f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -1,21 +1,26 @@ | |||
| 1 | PROJECT(usbmuxd) | 1 | PROJECT(usbmuxd) |
| 2 | 2 | ||
| 3 | SET ( USBMUXD_VERSION "1.0.0" ) | 3 | set(USBMUXD_VERSION "1.0.0") |
| 4 | SET ( LIBUSBMUXD_VERSION "${USBMUXD_VERSION}" ) | 4 | set(LIBUSBMUXD_VERSION "${USBMUXD_VERSION}") |
| 5 | SET ( LIBUSBMUXD_SOVERSION "1" ) | 5 | set(LIBUSBMUXD_SOVERSION "1") |
| 6 | 6 | ||
| 7 | cmake_minimum_required(VERSION 2.6) | 7 | cmake_minimum_required(VERSION 2.6) |
| 8 | 8 | ||
| 9 | IF(NOT DEFINED LIB_SUFFIX) | 9 | if(NOT DEFINED LIB_SUFFIX) |
| 10 | IF(CMAKE_SIZEOF_VOID_P EQUAL 8) | 10 | if(CMAKE_SIZEOF_VOID_P EQUAL 8) |
| 11 | SET(LIB_SUFFIX "64" CACHE STRING "Define suffix of library directory name (32/64)" ) | 11 | set(LIB_SUFFIX "64" CACHE STRING "Define suffix of library directory name (32/64)" ) |
| 12 | ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) | 12 | else(CMAKE_SIZEOF_VOID_P EQUAL 8) |
| 13 | SET(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) | 13 | set(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) |
| 14 | ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) | 14 | endif(CMAKE_SIZEOF_VOID_P EQUAL 8) |
| 15 | ENDIF(NOT DEFINED LIB_SUFFIX) | 15 | endif(NOT DEFINED LIB_SUFFIX) |
| 16 | 16 | ||
| 17 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Modules/") | 17 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Modules/") |
| 18 | 18 | ||
| 19 | # let CFLAGS env override this | ||
| 20 | if(CMAKE_C_FLAGS STREQUAL "") | ||
| 21 | set(CMAKE_C_FLAGS "-O2") | ||
| 22 | endif(CMAKE_C_FLAGS STREQUAL "") | ||
| 23 | |||
| 19 | add_definitions(-Wall) | 24 | add_definitions(-Wall) |
| 20 | 25 | ||
| 21 | add_subdirectory (libusbmuxd) | 26 | add_subdirectory (libusbmuxd) |
| @@ -24,10 +29,10 @@ add_subdirectory (tools) | |||
| 24 | add_subdirectory (udev) | 29 | add_subdirectory (udev) |
| 25 | 30 | ||
| 26 | # pkg-config | 31 | # pkg-config |
| 27 | CONFIGURE_FILE ("${CMAKE_SOURCE_DIR}/libusbmuxd.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc") | 32 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libusbmuxd.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc") |
| 28 | # install pkg-config file | 33 | # install pkg-config file |
| 29 | INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig/) | 34 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig/) |
| 30 | 35 | ||
| 31 | # add uninstall target | 36 | # add uninstall target |
| 32 | CONFIGURE_FILE( "${CMAKE_SOURCE_DIR}/Modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) | 37 | configure_file("${CMAKE_SOURCE_DIR}/Modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) |
| 33 | ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") | 38 | add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") |
diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 1ba052c..6593deb 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt | |||
| @@ -6,9 +6,8 @@ include_directories (${CMAKE_SOURCE_DIR}/common) | |||
| 6 | include_directories (${CMAKE_SOURCE_DIR}/daemon) | 6 | include_directories (${CMAKE_SOURCE_DIR}/daemon) |
| 7 | include_directories (${CMAKE_SOURCE_DIR}/libusbmuxd) | 7 | include_directories (${CMAKE_SOURCE_DIR}/libusbmuxd) |
| 8 | 8 | ||
| 9 | add_definitions(-O2 -g) | ||
| 10 | add_definitions(-DUSBMUXD_DAEMON -DUSBMUXD_VERSION="${USBMUXD_VERSION}") | 9 | add_definitions(-DUSBMUXD_DAEMON -DUSBMUXD_VERSION="${USBMUXD_VERSION}") |
| 11 | add_executable(usbmuxd main.c usb-linux.c log.c ../common/utils.c device.c client.c) | 10 | add_executable(usbmuxd main.c usb-linux.c log.c ${CMAKE_SOURCE_DIR}/common/utils.c device.c client.c) |
| 12 | target_link_libraries(usbmuxd ${LIBS}) | 11 | target_link_libraries(usbmuxd ${LIBS}) |
| 13 | 12 | ||
| 14 | install(TARGETS usbmuxd RUNTIME DESTINATION sbin) | 13 | install(TARGETS usbmuxd RUNTIME DESTINATION sbin) |
diff --git a/libusbmuxd/CMakeLists.txt b/libusbmuxd/CMakeLists.txt index d062f23..d275169 100644 --- a/libusbmuxd/CMakeLists.txt +++ b/libusbmuxd/CMakeLists.txt | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | include_directories (${CMAKE_SOURCE_DIR}/common) | 1 | include_directories (${CMAKE_SOURCE_DIR}/common) |
| 2 | find_package(Threads) | ||
| 2 | 3 | ||
| 3 | add_library (libusbmuxd SHARED libusbmuxd.c sock_stuff.c ../common/utils.c) | 4 | add_library (libusbmuxd SHARED libusbmuxd.c sock_stuff.c ${CMAKE_SOURCE_DIR}/common/utils.c) |
| 4 | find_library (PTHREAD pthread) | 5 | find_library (PTHREAD pthread) |
| 5 | target_link_libraries (libusbmuxd ${PTHREAD}) | 6 | target_link_libraries (libusbmuxd ${CMAKE_THREAD_LIBS_INIT}) |
| 7 | |||
| 6 | # 'lib' is a UNIXism, the proper CMake target is usbmuxd | 8 | # 'lib' is a UNIXism, the proper CMake target is usbmuxd |
| 7 | # But we can't use that due to the conflict with the usbmuxd daemon, | 9 | # But we can't use that due to the conflict with the usbmuxd daemon, |
| 8 | # so instead change the library output base name to usbmuxd here | 10 | # so instead change the library output base name to usbmuxd here |
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 47ffa90..08ea714 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | include_directories (${CMAKE_SOURCE_DIR}/libusbmuxd) | 1 | include_directories (${CMAKE_SOURCE_DIR}/libusbmuxd) |
| 2 | link_directories (${CMAKE_BINARY_DIR}/libusbmuxd) | 2 | link_directories (${CMAKE_BINARY_DIR}/libusbmuxd) |
| 3 | 3 | ||
| 4 | add_definitions(-O2 -g) | ||
| 5 | add_executable(iproxy iproxy.c) | 4 | add_executable(iproxy iproxy.c) |
| 6 | target_link_libraries(iproxy libusbmuxd pthread) | 5 | target_link_libraries(iproxy libusbmuxd pthread) |
| 7 | 6 | ||
