使用cmake-gui工具在Windows上安装Mfast [英] Mfast installation on windows using cmake-gui tool

查看:313
本文介绍了使用cmake-gui工具在Windows上安装Mfast的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的Windows机器上使用mFast for FastFix协议,但无法使用cmake-gui.exe进行安装我在Windows Server 2003上使用Visual Studio 2010.



CMAKE-LISTS.txt



文件(GLOB标题* .h)##检索当前目录中的所有头文件
文件(GLOB源* .cpp)##检索当前目录中的所有源文件我添加了可执行路径和库路径。

文件(GLOB instruction_headersinstructions / * .h)##检索指令目录中的所有头文件
file(GLOB instruction_sourcesinstructions / * .cpp)##检索所有源文件指令目录中的文件

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 $ {M FAST_STATIC_LIBRARIES} mfast_static CACHE INTERNAL)


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

if(NOT$ {CMAKE_VERSION}VERSION_LESS2.8.12)
target_compile_definitions(mfast INTERFACE-DMFAST_DYN_LINK)
endif(NOT$ {CMAKE_VERSION}VERSION_LESS2.8.12)

if(CMAKE_COMPILER_IS_GNUCXX OR($ {CMAKE_CXX_COMPILER_ID}STREQUALClang))
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)
en dif(BUILD_SHARED_LIBS)

add_subdirectory(编码器)
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错误在mfast / CMakeLists.txt:20(安装):
安装TARGETS给出静态库目标没有ARCHIVE DESTINATION
mfast_static。


mfast / coder / CMakeLists.txt的CMake错误:28(安装):
安装TARGETS给出静态库目标没有ARCHIVE DESTINATION
mfast_coder_static。


mfast / xml_parser / CMakeLists.txt中的CMake错误:22(安装):
安装TARGETS给出静态库目标没有ARCHIVE DESTINATION
mfast_xml_parser_static。


mfast / json / CMakeLists.txt中的CMake错误:19(安装):
安装TARGETS给出静态库目标没有ARCHIVE DESTINATION
mfast_json_static。


在fast_type_gen / CMakeLists.txt的CMake错误:18(安装):
安装TARGETS给出可执行目标没有RUNTIME DESTINATION
fast_type_gen。


CMakeLists.txt的CMake警告(dev):5(设置):
无法设置FAST_TYPE_GEN_INSTALL_LOCATION:当前范围没有父级。
此警告适用于项目开发人员。使用-Wno-dev来抑制它。

CMakeLists.txt的CMake错误:7(安装):
安装文件没有给出DESTINATION!


CMakeLists.txt中的CMake警告(dev):
没有cmake_minimum_required命令。应该在文件顶部添加一行代码,例如

cmake_minimum_required(VERSION 3.12)

。如果您希望为此项目支持较旧的CMake版本,则指定的版本可能低于
。如需更多
信息,请运行cmake --help-policy CMP0000。
此警告适用于项目开发人员。使用-Wno-dev来抑制它。

配置不完整,发生错误!





我尝试过: < br $>


添加了可执行路径和库安装的Boost-library 1.63并添加了Path,但是没有找到任何运气,因为你可以看到我正在获取静态库文件错误。提前感谢

解决方案

{PROJECT_BINARY_DIR} / lib)

set(mfast_SRCS


{源}

{instruction_sources}

I am trying to use mFast for FastFix protocol on my windows machine but not able to install using cmake-gui.exe I am using Visual studio 2010 on Windows Server 2003.

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



Error Log file

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!



What I have tried:

Added Executable Path and Library Installed Boost-library 1.63 and added in Path,But found no luck whatsoever as you can see i am getting static library file error. Thanking in Advance

解决方案

{PROJECT_BINARY_DIR}/lib) set(mfast_SRCS


{sources}


{instruction_sources}


这篇关于使用cmake-gui工具在Windows上安装Mfast的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆