Browse Source

first part of FindXXX.cmake changes to enable x64 msvc build

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
120f123d6d
  1. 20
      cmake/FindCURL.cmake
  2. 18
      cmake/FindJsoncpp.cmake
  3. 20
      cmake/FindMHD.cmake
  4. 35
      cmake/Findjson_rpc_cpp.cmake

20
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"
)

18
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"
)

20
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})

35
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"
)

Loading…
Cancel
Save