Browse Source

new way of searching for windows libs

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
7cd581abc5
  1. 6
      cmake/EthDependencies.cmake
  2. 19
      cmake/FindCURL.cmake
  3. 12
      cmake/FindCryptoPP.cmake
  4. 11
      cmake/FindJsoncpp.cmake
  5. 17
      cmake/FindLevelDB.cmake
  6. 17
      cmake/FindMHD.cmake
  7. 34
      cmake/Findjson_rpc_cpp.cmake

6
cmake/EthDependencies.cmake

@ -4,7 +4,11 @@
# by defining this variable, cmake will look for dependencies first in our own repository before looking in system paths like /usr/local/ ... # by defining this variable, cmake will look for dependencies first in our own repository before looking in system paths like /usr/local/ ...
# this must be set to point to the same directory as $ETH_DEPENDENCY_INSTALL_DIR in /extdep directory # this must be set to point to the same directory as $ETH_DEPENDENCY_INSTALL_DIR in /extdep directory
string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name)
set (ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extdep/install/${_system_name}") if (CMAKE_CL_64)
set (ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extdep/install/${_system_name}/x64")
else ()
set (ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extdep/install/${_system_name}/Win32")
endif()
set (CMAKE_PREFIX_PATH ${ETH_DEPENDENCY_INSTALL_DIR}) set (CMAKE_PREFIX_PATH ${ETH_DEPENDENCY_INSTALL_DIR})
# setup directory for cmake generated files and include it globally # setup directory for cmake generated files and include it globally

19
cmake/FindCURL.cmake

@ -16,17 +16,10 @@ find_path(
DOC "curl include dir" DOC "curl include dir"
) )
# if msvc 64 build
# names from cmake's FindCURL
if (CMAKE_CL_64)
set(CURL_NAMES curl_x64 curllib_x64 libcurl_imp_x64 curllib_static_x64 libcurl_x64)
else ()
set(CURL_NAMES curl curllib libcurl_imp curllib_static libcurl)
endif()
find_library( find_library(
CURL_LIBRARY CURL_LIBRARY
NAMES ${CURL_NAMES} # names from cmake's FindCURL
NAMES curl curllib libcurl_imp curllib_static libcurl
DOC "curl library" DOC "curl library"
) )
@ -38,15 +31,9 @@ set(CURL_LIBRARIES ${CURL_LIBRARY})
# boost is using the same "hack" as us with "optimized" and "debug" # boost is using the same "hack" as us with "optimized" and "debug"
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if (CMAKE_CL_64)
set(CURL_NAMES_DEBUG curld_x64 libcurld_x64)
else ()
set(CURL_NAMES_DEBUG curld libcurld)
endif()
find_library( find_library(
CURL_LIBRARY_DEBUG CURL_LIBRARY_DEBUG
NAMES ${CURL_NAMES_DEBUG} NAMES curld libcurld
DOC "curl debug library" DOC "curl debug library"
) )

12
cmake/FindCryptoPP.cmake

@ -53,22 +53,14 @@ FIND_PATH (CRYPTOPP_INCLUDE_DIR
PATH_SUFFIXES include PATH_SUFFIXES include
DOC "CryptoPP include directory") DOC "CryptoPP include directory")
if (CMAKE_CL_64)
set(CRYPTOPP_NAMES cryptlib_x64 cryptopp_x64)
set(CRYPTOPP_NAMES_DEBUG cryptlibd_x64 cryptoppd_x64)
else ()
set(CRYPTOPP_NAMES cryptlib cryptopp)
set(CRYPTOPP_NAMES_DEBUG cryptlibd cryptoppd)
endif()
FIND_LIBRARY (CRYPTOPP_LIBRARY_DEBUG FIND_LIBRARY (CRYPTOPP_LIBRARY_DEBUG
NAMES ${CRYPTOPP_NAMES_DEBUG} NAMES cryptlibd cryptoppd
HINTS ${CRYPTOPP_ROOT_DIR} HINTS ${CRYPTOPP_ROOT_DIR}
PATH_SUFFIXES lib PATH_SUFFIXES lib
DOC "CryptoPP debug library") DOC "CryptoPP debug library")
FIND_LIBRARY (CRYPTOPP_LIBRARY_RELEASE FIND_LIBRARY (CRYPTOPP_LIBRARY_RELEASE
NAMES ${CRYPTOPP_NAMES} NAMES cryptlib cryptopp
HINTS ${CRYPTOPP_ROOT_DIR} HINTS ${CRYPTOPP_ROOT_DIR}
PATH_SUFFIXES lib PATH_SUFFIXES lib
DOC "CryptoPP release library") DOC "CryptoPP release library")

11
cmake/FindJsoncpp.cmake

@ -17,16 +17,9 @@ find_path(
DOC "jsoncpp include dir" DOC "jsoncpp include dir"
) )
# if msvc 64 build
if (CMAKE_CL_64)
set(JSONCPP_NAMES jsoncpp_x64)
else ()
set(JSONCPP_NAMES jsoncpp)
endif()
find_library( find_library(
JSONCPP_LIBRARY JSONCPP_LIBRARY
NAMES ${JSONCPP_NAMES} NAMES jsoncpp
DOC "jsoncpp library" DOC "jsoncpp library"
) )
@ -46,7 +39,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
find_library( find_library(
JSONCPP_LIBRARY_DEBUG JSONCPP_LIBRARY_DEBUG
NAMES ${JSONCPP_NAMES_DEBUG} NAMES jsoncppd
DOC "jsoncpp debug library" DOC "jsoncpp debug library"
) )

17
cmake/FindLevelDB.cmake

@ -16,16 +16,9 @@ find_path(
DOC "leveldb include dir" DOC "leveldb include dir"
) )
# if msvc 64 build
if (CMAKE_CL_64)
set(LEVELDB_NAMES leveldb_x64)
else ()
set(LEVELDB_NAMES leveldb)
endif()
find_library( find_library(
LEVELDB_LIBRARY LEVELDB_LIBRARY
NAMES ${LEVELDB_NAMES} NAMES leveldb
DOC "leveldb library" DOC "leveldb library"
) )
@ -37,15 +30,9 @@ set(LEVELDB_LIBRARIES ${LEVELDB_LIBRARY})
# boost is using the same "hack" as us with "optimized" and "debug" # boost is using the same "hack" as us with "optimized" and "debug"
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if (CMAKE_CL_64)
set(LEVELDB_NAMES_DEBUG leveldbd_x64)
else ()
set(LEVELDB_NAMES_DEBUG leveldbd)
endif()
find_library( find_library(
LEVELDB_LIBRARY_DEBUG LEVELDB_LIBRARY_DEBUG
NAMES ${LEVELDB_NAMES_DEBUG} NAMES leveldbd
DOC "leveldb debug library" DOC "leveldb debug library"
) )

17
cmake/FindMHD.cmake

@ -15,16 +15,9 @@ find_path(
DOC "microhttpd include dir" DOC "microhttpd include dir"
) )
# if msvc 64 build
if (CMAKE_CL_64)
set(MHD_NAMES microhttpd_x64 microhttpd-10_x64 libmicrohttpd_x64 libmicrohttpd-dll_x64)
else ()
set(MHD_NAMES microhttpd microhttpd-10 libmicrohttpd libmicrohttpd-dll)
endif()
find_library( find_library(
MHD_LIBRARY MHD_LIBRARY
NAMES ${MHD_NAMES} NAMES microhttpd microhttpd-10 libmicrohttpd libmicrohttpd-dll
DOC "microhttpd library" DOC "microhttpd library"
) )
@ -37,15 +30,9 @@ set(MHD_LIBRARIES ${MHD_LIBRARY})
# official MHD project actually uses _d suffix # official MHD project actually uses _d suffix
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if (CMAKE_CL_64)
set(MHD_NAMES_DEBUG microhttpd_d_x64 microhttpd-10_d_x64 libmicrohttpd_d_x64 libmicrohttpd-dll_d_x64)
else ()
set(MHD_NAMES_DEBUG microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d)
endif()
find_library( find_library(
MHD_LIBRARY_DEBUG MHD_LIBRARY_DEBUG
NAMES ${MHD_NAMES_DEBUG} NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d
DOC "mhd debug library" DOC "mhd debug library"
) )

34
cmake/Findjson_rpc_cpp.cmake

@ -24,32 +24,21 @@ find_path(
DOC "json-rpc-cpp include dir" DOC "json-rpc-cpp include dir"
) )
# if msvc 64 build
if (CMAKE_CL_64)
set(JSON_RPC_CPP_COMMON_NAME jsonrpccpp-common_x64)
set(JSON_RPC_CPP_SERVER_NAME jsonrpccpp-server_x64)
set(JSON_RPC_CPP_CLIENT_NAME jsonrpccpp-client_x64)
else ()
set(JSON_RPC_CPP_COMMON_NAME jsonrpccpp-common)
set(JSON_RPC_CPP_SERVER_NAME jsonrpccpp-server)
set(JSON_RPC_CPP_CLIENT_NAME jsonrpccpp-client)
endif()
find_library( find_library(
JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_COMMON_LIBRARY
NAMES ${JSON_RPC_CPP_COMMON_NAME} NAMES jsonrpccpp-common
DOC "json-rpc-cpp common library" DOC "json-rpc-cpp common library"
) )
find_library( find_library(
JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY
NAMES ${JSON_RPC_CPP_SERVER_NAME} NAMES jsonrpccpp-server
DOC "json-rpc-cpp server library" DOC "json-rpc-cpp server library"
) )
find_library( find_library(
JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY
NAMES ${JSON_RPC_CPP_CLIENT_NAME} NAMES jsonrpccpp-client
DOC "json-rpc-cpp client library" DOC "json-rpc-cpp client library"
) )
@ -64,32 +53,21 @@ set (JSON_RPC_CPP_CLIENT_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP
# boost is using the same "hack" as us with "optimized" and "debug" # boost is using the same "hack" as us with "optimized" and "debug"
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# if msvc 64 build
if (CMAKE_CL_64)
set(JSON_RPC_CPP_COMMON_NAME_DEBUG jsonrpccpp-commond_x64)
set(JSON_RPC_CPP_SERVER_NAME_DEBUG jsonrpccpp-serverd_x64)
set(JSON_RPC_CPP_CLIENT_NAME_DEBUG jsonrpccpp-clientd_x64)
else ()
set(JSON_RPC_CPP_COMMON_NAME_DEBUG jsonrpccpp-commond)
set(JSON_RPC_CPP_SERVER_NAME_DEBUG jsonrpccpp-serverd)
set(JSON_RPC_CPP_CLIENT_NAME_DEBUG jsonrpccpp-clientd)
endif()
find_library( find_library(
JSON_RPC_CPP_COMMON_LIBRARY_DEBUG JSON_RPC_CPP_COMMON_LIBRARY_DEBUG
NAMES ${JSON_RPC_CPP_COMMON_NAME_DEBUG} NAMES jsonrpccpp-commond
DOC "json-rpc-cpp common debug library" DOC "json-rpc-cpp common debug library"
) )
find_library( find_library(
JSON_RPC_CPP_SERVER_LIBRARY_DEBUG JSON_RPC_CPP_SERVER_LIBRARY_DEBUG
NAMES ${JSON_RPC_CPP_SERVER_NAME_DEBUG} NAMES jsonrpccpp-serverd
DOC "json-rpc-cpp server debug library" DOC "json-rpc-cpp server debug library"
) )
find_library( find_library(
JSON_RPC_CPP_CLIENT_LIBRARY_DEBUG JSON_RPC_CPP_CLIENT_LIBRARY_DEBUG
NAMES ${JSON_RPC_CPP_CLIENT_NAME_DEBUG} NAMES jsonrpccpp-clientd
DOC "json-rpc-cpp client debug library" DOC "json-rpc-cpp client debug library"
) )

Loading…
Cancel
Save