我正在尝试在我的 Windows 机器上将 mFast 用于 FastFix 协议,但无法使用 cmake-gui.exe 安装我在 Windows Server 2003 上使用 Visual Studio 2010。
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 并添加到了路径中,但没有发现任何运气,因为你可以看到我收到静态库文件错误。提前致谢