使用cmake-gui工具在Windows上进行mFast安装

时间:2018-09-26 07:14:48

标签: c++ cmake cmake-gui fast-protocol

我正在尝试在Windows计算机上使用mFast进行FastFix协议,但无法使用cmake-gui.exe进行安装。我正在Windows Server 2003上使用Visual Studio 2010。

cmake-gui tool.exe image with configurations

CMAKE-LISTS.txt

file (GLOB headers "*.h") ## retrieve all header files in current directory
file (GLOB sources "*.cpp")     ## retrieve all source files in current directory     I had added Executable path and Library path.

file (GLOB instruction_headers "instructions/*.h") ## retrieve all header files in instructions directory
file (GLOB instruction_sources "instructions/*.cpp")     ## retrieve all source files in instructions directory

SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

set(mfast_SRCS  ${sources} ${instruction_sources} ${headers} ${instruction_headers})

add_library(mfast_static STATIC ${mfast_SRCS})
target_include_directories(mfast_static PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)

if (UNIX)
  set_target_properties(mfast_static PROPERTIES OUTPUT_NAME mfast)
endif()
set_target_properties(mfast_static PROPERTIES COMPILE_FLAGS -DMFAST_STATIC_DEFINE)

install(TARGETS mfast_static
        EXPORT  mFASTTargets
        RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin
        ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib)

set(MFAST_STATIC_LIBRARIES ${MFAST_STATIC_LIBRARIES} mfast_static CACHE INTERNAL "")


if (BUILD_SHARED_LIBS)
  add_library(mfast SHARED ${mfast_SRCS})

  if (NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.12")
    target_compile_definitions(mfast INTERFACE "-DMFAST_DYN_LINK")
  endif (NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.12")

  if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
    set_target_properties(mfast PROPERTIES COMPILE_FLAGS -fvisibility=hidden)
  endif()
  set_target_properties(mfast PROPERTIES
                        VERSION "${MFAST_VERSION}"
                        SOVERSION "${MFAST_SOVERSION}")

  install(TARGETS mfast
          EXPORT  mFASTTargets
          RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin
          LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib)

  set(MFAST_SHARED_LIBRARIES ${MFAST_SHARED_LIBRARIES} mfast CACHE INTERNAL "")
endif (BUILD_SHARED_LIBS)

add_subdirectory (coder)
add_subdirectory (xml_parser)
add_subdirectory (json)

if (BUILD_SQLITE3)
    add_subdirectory (sqlite3)
endif(BUILD_SQLITE3)

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
        DESTINATION "${INSTALL_INCLUDE_DIR}"
        FILES_MATCHING PATTERN "*.h")

错误日志文件

CMake Error at mfast/CMakeLists.txt:20 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "mfast_static".


CMake Error at mfast/coder/CMakeLists.txt:28 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "mfast_coder_static".


CMake Error at mfast/xml_parser/CMakeLists.txt:22 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "mfast_xml_parser_static".


CMake Error at mfast/json/CMakeLists.txt:19 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "mfast_json_static".


CMake Error at fast_type_gen/CMakeLists.txt:18 (install):
  install TARGETS given no RUNTIME DESTINATION for executable target
  "fast_type_gen".


CMake Warning (dev) at CMakeLists.txt:5 (set):
  Cannot set "FAST_TYPE_GEN_INSTALL_LOCATION": current scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:7 (install):
  install FILES given no DESTINATION!


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.12)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring incomplete, errors occurred!
See also "D:/Mihir/mFastVisualStudioProject/CMakeFiles/CMakeOutput.log".

我尝试过的方法: 添加了可执行路径和库 安装了Boost-library 1.63并添加到Path中,但是没有发现任何运气,因为您看到的是我遇到静态库文件错误。在此先感谢

0 个答案:

没有答案