diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 01dda18..64ef37f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,26 @@ PROJECT(usbmuxd) -SET ( USBMUXD_VERSION "1.0.0" ) -SET ( LIBUSBMUXD_VERSION "${USBMUXD_VERSION}" ) -SET ( LIBUSBMUXD_SOVERSION "1" ) +set(USBMUXD_VERSION "1.0.0") +set(LIBUSBMUXD_VERSION "${USBMUXD_VERSION}") +set(LIBUSBMUXD_SOVERSION "1") cmake_minimum_required(VERSION 2.6) -IF(NOT DEFINED LIB_SUFFIX) - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(LIB_SUFFIX "64" CACHE STRING "Define suffix of library directory name (32/64)" ) - ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) -ENDIF(NOT DEFINED LIB_SUFFIX) +if(NOT DEFINED LIB_SUFFIX) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(LIB_SUFFIX "64" CACHE STRING "Define suffix of library directory name (32/64)" ) + else(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) + endif(CMAKE_SIZEOF_VOID_P EQUAL 8) +endif(NOT DEFINED LIB_SUFFIX) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Modules/") +# let CFLAGS env override this +if(CMAKE_C_FLAGS STREQUAL "") + set(CMAKE_C_FLAGS "-O2") +endif(CMAKE_C_FLAGS STREQUAL "") + add_definitions(-Wall) add_subdirectory (libusbmuxd) @@ -24,10 +29,10 @@ add_subdirectory (tools) add_subdirectory (udev) # pkg-config -CONFIGURE_FILE ("${CMAKE_SOURCE_DIR}/libusbmuxd.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc") +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libusbmuxd.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc") # install pkg-config file -INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig/) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig/) # add uninstall target -CONFIGURE_FILE( "${CMAKE_SOURCE_DIR}/Modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +configure_file("${CMAKE_SOURCE_DIR}/Modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) +add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") |