diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-12-26 02:15:05 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-12-26 02:15:05 +0400 |
commit | c223aade3cd0c9ee651902f70da5497aae0f8014 (patch) | |
tree | d942db33fca7a4023c1c7f2639566471fd6f8e2d | |
parent | 4acfa46c321a344b9a6ce4128e72d1e02828d8a0 (diff) | |
download | accel-ppp-c223aade3cd0c9ee651902f70da5497aae0f8014.tar.gz accel-ppp-c223aade3cd0c9ee651902f70da5497aae0f8014.zip |
cmake: use CMAKE_FIND_ROOT_PATH and LIB_SUFFIX
-rw-r--r-- | accel-pppd/CMakeLists.txt | 23 | ||||
-rw-r--r-- | accel-pppd/auth/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/l2tp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/pppoe/CMakeLists.txt | 6 | ||||
-rw-r--r-- | accel-pppd/ctrl/pptp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/extra/CMakeLists.txt | 6 | ||||
-rw-r--r-- | accel-pppd/extra/net-snmp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/ipv6/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/logs/CMakeLists.txt | 8 | ||||
-rw-r--r-- | accel-pppd/radius/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/shaper/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/triton/CMakeLists.txt | 4 |
12 files changed, 35 insertions, 26 deletions
diff --git a/accel-pppd/CMakeLists.txt b/accel-pppd/CMakeLists.txt index 0c1c9496..2d1db497 100644 --- a/accel-pppd/CMakeLists.txt +++ b/accel-pppd/CMakeLists.txt @@ -15,6 +15,19 @@ ENDIF (EXISTS ${CMAKE_HOME_DIRECTORY}/.git AND NOT DEFINED IGNORE_GIT) ADD_DEFINITIONS(-DACCEL_PPP_VERSION="${ACCEL_PPP_VERSION}") +IF (NOT DEFINED LIB_SUFFIX) + EXECUTE_PROCESS( + COMMAND uname -m + COMMAND tr -d '\n' + OUTPUT_VARIABLE ARCH + ) + message(STATUS "'" ${ARCH} "'") + IF (ARCH STREQUAL x86_64) + SET(LIB_SUFFIX 64) + ENDIF (ARCH STREQUAL x86_64) +ENDIF (NOT DEFINED LIB_SUFFIX) + + INCLUDE_DIRECTORIES(include) IF (MEMDEBUG) @@ -93,7 +106,7 @@ TARGET_LINK_LIBRARIES(accel-pppd triton rt pthread ${crypto_lib} pcre) set_property(TARGET accel-pppd PROPERTY CMAKE_SKIP_BUILD_RPATH FALSE) set_property(TARGET accel-pppd PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set_property(TARGET accel-pppd PROPERTY INSTALL_RPATH_USE_LINK_PATH FALSE) -set_property(TARGET accel-pppd PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/accel-ppp) +set_property(TARGET accel-pppd PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SIFFIX}/accel-ppp) INSTALL(TARGETS accel-pppd RUNTIME DESTINATION sbin @@ -102,10 +115,10 @@ INSTALL(TARGETS accel-pppd INSTALL(FILES accel-ppp.conf.5 DESTINATION share/man/man5) IF (NOT DEFINED CPACK_TYPE) - INSTALL(FILES accel-ppp.conf DESTINATION /etc RENAME accel-ppp.conf.dist) + INSTALL(FILES accel-ppp.conf DESTINATION ${CMAKE_FIND_ROOT_PATH}/etc RENAME accel-ppp.conf.dist) - INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p /var/log/accel-ppp)") - INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p /var/run/accel-ppp)") - INSTALL(CODE "EXECUTE_PROCESS(COMMAND 'echo 0 > /var/run/accel-ppp/seq')") + INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p ${CMAKE_FIND_ROOT_PATH}/var/log/accel-ppp)") + INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p ${CMAKE_FIND_ROOT_PATH}/var/run/accel-ppp)") + INSTALL(CODE "EXECUTE_PROCESS(COMMAND 'echo 0 > ${CMAKE_FIND_ROOT_PATH}/var/run/accel-ppp/seq')") ENDIF (NOT DEFINED CPACK_TYPE) diff --git a/accel-pppd/auth/CMakeLists.txt b/accel-pppd/auth/CMakeLists.txt index 7af8faca..f93d9e35 100644 --- a/accel-pppd/auth/CMakeLists.txt +++ b/accel-pppd/auth/CMakeLists.txt @@ -8,6 +8,6 @@ TARGET_LINK_LIBRARIES(auth_mschap_v1 ${crypto_lib}) TARGET_LINK_LIBRARIES(auth_mschap_v2 ${crypto_lib}) INSTALL(TARGETS auth_pap auth_chap_md5 auth_mschap_v1 auth_mschap_v2 - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/ctrl/l2tp/CMakeLists.txt b/accel-pppd/ctrl/l2tp/CMakeLists.txt index b2952899..66dd3fc6 100644 --- a/accel-pppd/ctrl/l2tp/CMakeLists.txt +++ b/accel-pppd/ctrl/l2tp/CMakeLists.txt @@ -10,7 +10,7 @@ ADD_LIBRARY(l2tp SHARED ) #TARGET_LINK_LIBRARIES(l2tp nl nl-genl) -INSTALL(TARGETS l2tp LIBRARY DESTINATION lib/accel-ppp) +INSTALL(TARGETS l2tp LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp) FILE(GLOB dict "${CMAKE_CURRENT_SOURCE_DIR}/dict/*") INSTALL(FILES ${dict} DESTINATION share/accel-ppp/l2tp) diff --git a/accel-pppd/ctrl/pppoe/CMakeLists.txt b/accel-pppd/ctrl/pppoe/CMakeLists.txt index a38cfb2c..fad9efd0 100644 --- a/accel-pppd/ctrl/pppoe/CMakeLists.txt +++ b/accel-pppd/ctrl/pppoe/CMakeLists.txt @@ -13,9 +13,5 @@ ENDIF(RADIUS) ADD_LIBRARY(pppoe SHARED ${sources}) TARGET_LINK_LIBRARIES(pppoe ${crypto_lib}) -#set_property(TARGET pppoe PROPERTY CMAKE_SKIP_BUILD_RPATH FALSE) -#set_property(TARGET pppoe PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -#set_property(TARGET pppoe PROPERTY INSTALL_RPATH_USE_LINK_PATH FALSE) -#set_property(TARGET pppoe PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/accel-ppp) -INSTALL(TARGETS pppoe LIBRARY DESTINATION lib/accel-ppp) +INSTALL(TARGETS pppoe LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp) diff --git a/accel-pppd/ctrl/pptp/CMakeLists.txt b/accel-pppd/ctrl/pptp/CMakeLists.txt index 3199e7f1..aa011d1a 100644 --- a/accel-pppd/ctrl/pptp/CMakeLists.txt +++ b/accel-pppd/ctrl/pptp/CMakeLists.txt @@ -2,4 +2,4 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) ADD_LIBRARY(pptp SHARED pptp.c) -INSTALL(TARGETS pptp LIBRARY DESTINATION lib/accel-ppp ) +INSTALL(TARGETS pptp LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/extra/CMakeLists.txt b/accel-pppd/extra/CMakeLists.txt index cbaef49c..43ba367f 100644 --- a/accel-pppd/extra/CMakeLists.txt +++ b/accel-pppd/extra/CMakeLists.txt @@ -1,6 +1,6 @@ ADD_LIBRARY(pppd_compat SHARED pppd_compat.c) TARGET_LINK_LIBRARIES(pppd_compat sigchld) -set_property(TARGET pppd_compat PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/accel-ppp) +set_property(TARGET pppd_compat PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/accel-ppp) ADD_LIBRARY(ippool SHARED ippool.c) ADD_LIBRARY(ipv6pool SHARED ipv6pool.c) ADD_LIBRARY(sigchld SHARED sigchld.c) @@ -10,7 +10,7 @@ TARGET_LINK_LIBRARIES(logwtmp util) ADD_LIBRARY(connlimit SHARED connlimit.c) INSTALL(TARGETS pppd_compat ippool ipv6pool sigchld chap-secrets logwtmp connlimit - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) IF (SHAPER) @@ -20,7 +20,7 @@ IF (SHAPER) SET_PROPERTY(TARGET shaper_tbf PROPERTY LINK_FLAGS "-L${LIBNL_PREFIX}/lib") ENDIF (LIBNL_PREFIX) TARGET_LINK_LIBRARIES(shaper_tbf nl m) - INSTALL(TARGETS shaper_tbf LIBRARY DESTINATION lib/accel-ppp) + INSTALL(TARGETS shaper_tbf LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp) ENDIF (SHAPER) diff --git a/accel-pppd/extra/net-snmp/CMakeLists.txt b/accel-pppd/extra/net-snmp/CMakeLists.txt index b61c0d01..7633f371 100644 --- a/accel-pppd/extra/net-snmp/CMakeLists.txt +++ b/accel-pppd/extra/net-snmp/CMakeLists.txt @@ -25,5 +25,5 @@ IF (NETSNMP_PREFIX) ENDIF (NETSNMP_PREFIX) INSTALL(TARGETS net-snmp - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/ipv6/CMakeLists.txt b/accel-pppd/ipv6/CMakeLists.txt index 9f8c3d1d..e95eadba 100644 --- a/accel-pppd/ipv6/CMakeLists.txt +++ b/accel-pppd/ipv6/CMakeLists.txt @@ -2,6 +2,6 @@ ADD_LIBRARY(ipv6_dhcp SHARED dhcpv6.c dhcpv6_packet.c) ADD_LIBRARY(ipv6_nd SHARED nd.c) INSTALL(TARGETS ipv6_dhcp ipv6_nd - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/logs/CMakeLists.txt b/accel-pppd/logs/CMakeLists.txt index b10163f4..b25cbe26 100644 --- a/accel-pppd/logs/CMakeLists.txt +++ b/accel-pppd/logs/CMakeLists.txt @@ -15,21 +15,21 @@ IF(LOG_FILE) ADD_LIBRARY(log_file SHARED log_file.c) TARGET_LINK_LIBRARIES(log_file rt) INSTALL(TARGETS log_file - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) ENDIF(LOG_FILE) IF(LOG_TCP) ADD_LIBRARY(log_tcp SHARED log_tcp.c) INSTALL(TARGETS log_tcp - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) ENDIF(LOG_TCP) IF(LOG_SYSLOG) ADD_LIBRARY(log_syslog SHARED log_syslog.c) INSTALL(TARGETS log_syslog - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) ENDIF(LOG_SYSLOG) @@ -37,7 +37,7 @@ IF(LOG_PGSQL) ADD_LIBRARY(log_pgsql SHARED log_pgsql.c) TARGET_LINK_LIBRARIES(log_pgsql pq) INSTALL(TARGETS log_pgsql - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) ENDIF(LOG_PGSQL) diff --git a/accel-pppd/radius/CMakeLists.txt b/accel-pppd/radius/CMakeLists.txt index 0c1789ef..566f3f9e 100644 --- a/accel-pppd/radius/CMakeLists.txt +++ b/accel-pppd/radius/CMakeLists.txt @@ -15,7 +15,7 @@ ADD_DEFINITIONS(-DDICTIONARY="${CMAKE_INSTALL_PREFIX}/share/accel-ppp/radius/dic ADD_LIBRARY(radius SHARED ${sources}) INSTALL(TARGETS radius - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) FILE(GLOB dict "${CMAKE_CURRENT_SOURCE_DIR}/dict/*") INSTALL(FILES ${dict} DESTINATION share/accel-ppp/radius) diff --git a/accel-pppd/shaper/CMakeLists.txt b/accel-pppd/shaper/CMakeLists.txt index 3c1ac951..7f211fd1 100644 --- a/accel-pppd/shaper/CMakeLists.txt +++ b/accel-pppd/shaper/CMakeLists.txt @@ -1,6 +1,6 @@ ADD_LIBRARY(shaper SHARED shaper.c limiter.c leaf_qdisc.c tc_core.c) INSTALL(TARGETS shaper - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/triton/CMakeLists.txt b/accel-pppd/triton/CMakeLists.txt index 105b62a6..0dc7ba57 100644 --- a/accel-pppd/triton/CMakeLists.txt +++ b/accel-pppd/triton/CMakeLists.txt @@ -30,11 +30,11 @@ ENDIF (HAVE_TIMERFD) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -ADD_DEFINITIONS(-DMODULE_PATH="${CMAKE_INSTALL_PREFIX}/lib/accel-ppp") +ADD_DEFINITIONS(-DMODULE_PATH="${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/accel-ppp") ADD_LIBRARY(triton SHARED ${sources_c}) TARGET_LINK_LIBRARIES(triton dl) INSTALL(TARGETS triton - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) |