使用cmake为Mysql Connector/C++ 1.0.5生成的visual studio 2005工程时有以下错误:
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CPack.cmake:702 (message):
CPack license resource file: "LICENSE.mysql" could not be found.
Call Stack (most recent call first):
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CPack.cmake:707 (cpack_check_file_exists)
CMakeLists.txt:137 (INCLUDE)
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CPack.cmake:702 (message):
CPack readme resource file: "README" could not be found.
Call Stack (most recent call first):
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CPack.cmake:708 (cpack_check_file_exists)
CMakeLists.txt:137 (INCLUDE)
网上找到一个解释:
http://bugs.mysql.com/bug.php?id=45843
解决:
在CMakeLists.txt中注释掉以下3个部分就可以了
#IF(EXISTS "COPYING")
# SET(CPACK_RESOURCE_FILE_LICENSE "COPYING")
#ELSE(EXISTS "COPYING")
# SET(CPACK_RESOURCE_FILE_LICENSE "LICENSE.mysql")
#ENDIF(EXISTS "COPYING")
#SET(CPACK_RESOURCE_FILE_README "README")
#SET( LICENSE_FILENAME "${CPACK_RESOURCE_FILE_LICENSE}")")
#INSTALL(FILES "README" "COPYING" "LICENSE.mysql" "ANNOUNCEMENT" DESTINATION "." OPTIONAL)