diff --git a/cmake/FindCURL.cmake b/cmake/FindCURL.cmake index ba6603784..0b20c4e79 100644 --- a/cmake/FindCURL.cmake +++ b/cmake/FindCURL.cmake @@ -16,10 +16,17 @@ find_path( 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( CURL_LIBRARY - # names from cmake's FindCURL - NAMES curl curllib libcurl_imp curllib_static libcurl + NAMES ${CURL_NAMES} DOC "curl library" ) @@ -30,9 +37,16 @@ set(CURL_LIBRARIES ${CURL_LIBRARY}) # same naming convention as in qt (appending debug library with d) # boost is using the same "hack" as us with "optimized" and "debug" 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( CURL_LIBRARY_DEBUG - NAMES curld libcurld + NAMES ${CURL_DEBUG} DOC "curl debug library" ) diff --git a/cmake/FindJsoncpp.cmake b/cmake/FindJsoncpp.cmake index c5b9c87d8..711ba667c 100644 --- a/cmake/FindJsoncpp.cmake +++ b/cmake/FindJsoncpp.cmake @@ -17,9 +17,16 @@ find_path( 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( JSONCPP_LIBRARY - NAMES jsoncpp + NAMES ${JSONCPP_NAMES} DOC "jsoncpp library" ) @@ -30,9 +37,16 @@ set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY}) # same naming convention as in qt (appending debug library with d) # boost is using the same "hack" as us with "optimized" and "debug" if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + + if (CMAKE_CL_64) + set(JSONCPP_NAMES_DEBUG jsoncppd_x64) + else () + set(JSONCPP_NAMES_DEBUG jsoncppd) + endif() + find_library( JSONCPP_LIBRARY_DEBUG - NAMES jsoncppd + NAMES ${JSONCPP_NAMES_DEBUG} DOC "jsoncpp debug library" ) diff --git a/cmake/FindMHD.cmake b/cmake/FindMHD.cmake index 5cb8a98d6..f836ce391 100755 --- a/cmake/FindMHD.cmake +++ b/cmake/FindMHD.cmake @@ -15,9 +15,16 @@ find_path( 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( MHD_LIBRARY - NAMES microhttpd microhttpd-10 libmicrohttpd libmicrohttpd-dll + NAMES ${MHD_NAMES} DOC "microhttpd library" ) @@ -34,11 +41,20 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") string(REPLACE ".lib" ".dll" MHD_DLL_RELEASE ${MHD_LIBRARY}) string(REPLACE "/lib/" "/bin/" MHD_DLL_RELEASE ${MHD_DLL_RELEASE}) + 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( MHD_LIBRARY_DEBUG - NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d + NAMES ${MHD_NAMES_DEBUG} DOC "mhd debug library" ) + + set(MHD_LIBRARIES optimized ${MHD_LIBRARIES} debug ${MHD_LIBRARY_DEBUG}) + # not sure why this was commented # always use release for now #string(REPLACE ".lib" ".dll" MHD_DLL_DEBUG ${MHD_LIBRARY_DEBUG}) #set(MHD_LIBRARIES optimized ${MHD_LIBRARIES} debug ${MHD_LIBRARY_DEBUG}) diff --git a/cmake/Findjson_rpc_cpp.cmake b/cmake/Findjson_rpc_cpp.cmake index 9b64cda2b..ca3439717 100644 --- a/cmake/Findjson_rpc_cpp.cmake +++ b/cmake/Findjson_rpc_cpp.cmake @@ -24,21 +24,32 @@ find_path( 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( JSON_RPC_CPP_COMMON_LIBRARY - NAMES jsonrpccpp-common + NAMES ${JSON_RPC_CPP_COMMON_NAME} DOC "json-rpc-cpp common library" ) find_library( JSON_RPC_CPP_SERVER_LIBRARY - NAMES jsonrpccpp-server + NAMES ${JSON_RPC_CPP_SERVER_NAME} DOC "json-rpc-cpp server library" ) find_library( JSON_RPC_CPP_CLIENT_LIBRARY - NAMES jsonrpccpp-client + NAMES ${JSON_RPC_CPP_CLIENT_NAME} DOC "json-rpc-cpp client library" ) @@ -52,21 +63,33 @@ set (JSON_RPC_CPP_CLIENT_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP # same naming convention as in qt (appending debug library with d) # boost is using the same "hack" as us with "optimized" and "debug" 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( JSON_RPC_CPP_COMMON_LIBRARY_DEBUG - NAMES jsonrpccpp-commond + NAMES ${JSON_RPC_CPP_COMMON_NAME_DEBUG} DOC "json-rpc-cpp common debug library" ) find_library( JSON_RPC_CPP_SERVER_LIBRARY_DEBUG - NAMES jsonrpccpp-serverd + NAMES ${JSON_RPC_CPP_SERVER_NAME_DEBUG} DOC "json-rpc-cpp server debug library" ) find_library( JSON_RPC_CPP_CLIENT_LIBRARY_DEBUG - NAMES jsonrpccpp-clientd + NAMES ${JSON_RPC_CPP_CLIENT_NAME_DEBUG} DOC "json-rpc-cpp client debug library" )