Skip to content
Snippets Groups Projects
Commit 3193825b authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Updates for compiling on Windows

parent 2a5c6b25
No related branches found
No related tags found
No related merge requests found
Pipeline #9528 passed
......@@ -12,6 +12,13 @@ enable_testing()
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
find_package( glog REQUIRED )
find_package( OpenCV REQUIRED )
find_package( Threads REQUIRED )
find_package( URIParser REQUIRED )
find_package( MsgPack )
find_package( LibSGM )
check_language(CUDA)
if (CUDA_TOOLKIT_ROOT_DIR)
enable_language(CUDA)
......@@ -22,23 +29,21 @@ add_definitions(-DHAVE_CUDA)
include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
endif ()
find_package( glog REQUIRED )
find_package( OpenCV REQUIRED )
find_package( Threads REQUIRED )
find_package( MsgPack )
find_package( LibSGM )
if (NOT MSGPACK_FOUND)
if (NOT MsgPack_FOUND)
check_include_file_cxx("msgpack.hpp" MSGPACK_FOUND)
if (NOT MSGPACK_FOUND)
message(ERROR "Msgpack is required")
endif()
else()
include_directories(${MSGPACK_INCLUDE_DIRS})
endif()
if (NOT WIN32)
check_include_file("uuid/uuid.h" UUID_FOUND)
if (NOT UUID_FOUND)
message(ERROR "UUID library is required")
endif()
endif()
find_program(CPPCHECK_FOUND cppcheck)
if (CPPCHECK_FOUND)
......
###############################################################################
# Find URI Parser
#
if(WIN32)
find_path(URIP_DIR NAMES include/uriparser/Uri.h PATHS "C:/Program Files/uriparser" "C:/Program Files (x86)/uriparser")
else()
set(URIP_DIR "")
endif()
# Find lib
set(URIPARSER_FOUND FALSE CACHE BOOL "" FORCE)
find_library(URIPARSER_LIBRARY
NAMES uriparser liburiparser
PATHS ${URIP_DIR}
PATH_SUFFIXES lib/
)
# Find include
find_path(URIPARSER_INCLUDE_DIRS
NAMES uriparser/Uri.h
PATHS ${URIP_DIR}
PATH_SUFFIXES include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(URIParser DEFAULT_MSG URIPARSER_LIBRARY URIPARSER_INCLUDE_DIRS)
mark_as_advanced(URIPARSER_FOUND)
if(URIPARSER_FOUND)
include_directories(${URIPARSER_INCLUDE_DIRS})
set(URIPARSER_FOUND TRUE CACHE BOOL "" FORCE)
set(URIPARSER_LIBRARIES ${URIPARSER_LIBRARY})
message(STATUS "Found URIParser")
endif()
......@@ -3,8 +3,8 @@
#
if(WIN32)
find_path(glog_DIR glog PATHS "C:/Program Files" "C:/Program Files (x86)")
set(glog_DIR ${glog_DIR}/glog)
find_path(glog_DIR NAMES include/glog/logging.h PATHS "C:/Program Files/glog" "C:/Program Files/google-glog" "C:/Program Files (x86)/google-glog")
set(glog_DIR ${glog_DIR})
else()
set(glog_DIR "")
endif()
......
......@@ -11,10 +11,10 @@ set(NETSOURCE
src/protocol.cpp
)
check_include_file("uriparser/Uri.h" HAVE_URI_H)
if(NOT HAVE_URI_H)
message(FATAL_ERROR "Uriparser not found")
endif()
#check_include_file("uriparser/Uri.h" HAVE_URI_H)
#if(NOT HAVE_URI_H)
# message(FATAL_ERROR "Uriparser not found")
#endif()
check_function_exists(uriParseSingleUriA HAVE_URIPARSESINGLE)
add_library(net ${NETSOURCE})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment