CMake を使用してソリューションを作成しようとしています。初めてなので簡単なものから始めました。
テキストファイル(CMakeLists.txt)を作成し、CMakeで使用しました。エラーなしで「構成」できますが、生成しようとするとエラーが発生します。
CMake Error at CMakeLists.txt:75 (ADD_EXECUTABLE):
Cannot find source file:
./source/server/server.hpp
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
これは私のファイルのパスです:
\QTCP_Connection\source\server (contain server.cpp and server.hpp)
\QTCP_Connection\source\qtcp (contain main.cpp)
\QTCP_Connection\source\libs (contain singleton_holder.hpp and stdafx.hpp and stdafx.cpp and targetver.hpp)
そして、これは私の CMakeLists.txt です:
cmake_minimum_required(VERSION 2.8.6)
PROJECT(QTCP_Connection)
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE} )
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_SHARED)
ADD_DEFINITIONS(-DQT_DLL)
ADD_DEFINITIONS(-DQT_LARGEFILE_SUPPORT)
ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
SET(QT_DONT_USE_QTGUI TRUE)
SET(QTCP_PROJECT_DIR .)
SET(QTCP_QT_DIR $ENV{SEPANTA_QT_DIR})
SET(QTCP_BOOST_DIR $ENV{SEPANTA_BOOST_DIR})
SET(QTCP_PYTHON_DIR $ENV{SEPANTA_PYTHON_DIR})
SET(QTCP_XFS_DIR $ENV{XFS_DIR})
SET(QTCP_LOGGER_DIR $ENV{SEPANTA_LOGGER_DIR})
SET(DEVICE_MANAGER_IMPL_DIR device-manager)
SET(DEVICES_BASE_DIR ../../devices)
SET(DEVICES_IMPL_DIR devices)
SET(QTCP_DIR ${QTCP_PROJECT_DIR}/source/qtcp)
SET(SERVER_DIR ${QTCP_PROJECT_DIR}/source/server)
SET(LIBS_DIR ${QTCP_PROJECT_DIR}/source/libs)
INCLUDE_DIRECTORIES(
${QTCP_PROJECT_DIR}/source
${QTCP_QT_DIR}/include
${QTCP_QT_DIR}/include/QtCore
${QTCP_BOOST_DIR}/include/boost-1_50
${QTCP_LOGGER_DIR}/include
${QTCP_PYTHON_DIR}/include
)
SET(QT_HEADERS
${SERVER_DIR}/server.hpp
)
QT4_WRAP_CPP(QT_HEADERS_MOC ${QT_HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
SET(QTCP_FILES
${QTCP_PROJECT_DIR}/source/qtcp/main.cpp
)
SET(SERVER_FILES
${SERVER_DIR}/server.hpp
${SERVER_DIR}/server.cpp
)
SET(LIBS_FILES
${LIBS_DIR}/singleton_holder.hpp
${LIBS_DIR}/stdafx.cpp
${LIBS_DIR}/stdafx.hpp
${LIBS_DIR}/targetver.hpp
)
LINK_DIRECTORIES(
${QTCP_QT_DIR}/lib
${QTCP_BOOST_DIR}/lib
${QTCP_PYTHON_DIR}/libs
${QTCP_LOGGER_DIR}/lib
${QTCP_XFS_DIR}/XFS_WINCOR_4.1
${QTCP_XFS_DIR}/XFS_WINCOR_4.1/LIB)
SET(XFS_LIBS
MSXFS
xfs_conf
SSIDLL)
ADD_EXECUTABLE(QTCP_Connection
${QT_HEADERS_MOC}
${QTCP_FILES}
${SERVER_FILES}
${LIBS_FILES}
)
source_group("moc_generated" FILES ${QT_HEADERS_MOC})
source_group("source\\qtcp" FILES ${QTCP_FILES})
source_group("source\\server" FILES ${SERVER_FILES})
source_group("source\\libs" FILES ${LIBS_FILES})
TARGET_LINK_LIBRARIES(QTCP_Connection
#${QT_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTSQL_LIBRARY}
${XFS_LIBS}
debug log4cplusUD.lib
optimized log4cplusU.lib
)
set_target_properties(QTCP_Connection PROPERTIES COMPILE_FLAGS "/W2 /Zc:wchar_t-")
set_target_properties(QTCP_Connection PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
ここで私が間違っていることを教えてもらえますか?