Hi
The last problem is with . I’m trying to get the WIN32 to detect the MySQL include and library. I tried the find_library in the WIN32 part which it does not detect the library. I also tried hard coding the ROOT_DIR which fails also.
The Linux side compiles but now the Win32 finds the includes if I hard code the include path but it does not add the libraries. Additional in the header
#include “mysql_connectionh” for example shows file not detected.
Vivienne
[code]# - Try to find Mysql-Connector-C++
Once done, this will define
MYSQLCONNECTORCPP_FOUND - system has Mysql-Connector-C++ installed
MYSQLCONNECTORCPP_INCLUDE_DIRS - the Mysql-Connector-C++ include directories
MYSQLCONNECTORCPP_LIBRARIES - link these to use Mysql-Connector-C++
The user may wish to set, in the CMake GUI or otherwise, this variable:
MYSQLCONNECTORCPP_ROOT_DIR - path to start searching for the module
set(MYSQLCONNECTORCPP_ROOT_DIR
"${MYSQLCONNECTORCPP_ROOT_DIR}“
CACHE
PATHS
"path goes here”)
if(WIN32)
set(MYSQLCONNECTORCPP_INCLUDE_DIR “/usr/local/include”)
set(MYSQLCONNECTORCPP_ROOT_DIR “/usr/local/include”)
set(MYSQLCONNECTORCPP_LIBRARY “/usr/local/lib”)
else()
find_path(MYSQLCONNECTORCPP_INCLUDE_DIR
mysql_connection.h
HINTS
${MYSQLCONNECTORCPP_ROOT_DIR}
PATH_SUFFIXES
include)
find_library(MYSQLCONNECTORCPP_LIBRARY
NAMES
mysqlcppconn
mysqlcppconn-static
HINTS
${MYSQLCONNECTORCPP_ROOT_DIR}
PATH_SUFFIXES
lib64
lib)
endif()
mark_as_advanced(MYSQLCONNECTORCPP_INCLUDE_DIR MYSQLCONNECTORCPP_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MysqlConnectorCpp
DEFAULT_MSG
MYSQLCONNECTORCPP_INCLUDE_DIR
MYSQLCONNECTORCPP_LIBRARY)
if(MYSQLCONNECTORCPP_FOUND)
set(MYSQLCONNECTORCPP_INCLUDE_DIRS “${MYSQLCONNECTORCPP_INCLUDE_DIR}”) # Add any dependencies here
set(MYSQLCONNECTORCPP_LIBRARIES “${MYSQLCONNECTORCPP_LIBRARY}”) # Add any dependencies here
mark_as_advanced(MYSQLCONNECTORCPP_ROOT_DIR)
endif()
[/code]
CMake Build
vivienne@vivienne-System-Product-Name:/media/home2/vivienne/Urho3D-gameeconomic$ ./cmake_mingw.sh /media/home2/vivienne/GameEconomicUrhoWin -DURHO3D_64BIT=0 -DURHO3D_GAMEECONOMICSERVER=0 -DURHO3D_GAMEECONOMICSERVERCLIENT=0 -DURHO3D_GAMEECONOMICGAMECLIENT=1 -DWIN32=0 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32=0 -DURHO3D_SSE=0
-- DirectX SDK search skipped for MinGW. It is assumed that MinGW itself comes with the necessary headers & libraries
-- Configuring done
WARNING: Target "GameEconomicGameClient" requests linking to directory "/usr/local/lib". Targets may link only to libraries. CMake is dropping the item.
-- Generating done
-- Build files have been written to: /media/home2/vivienne/GameEconomicUrhoWin
Compile Results
-- Generating done
-- Build files have been written to: /media/home2/vivienne/GameEconomicUrhoWin
[ 5%] Built target FreeType
[ 5%] Built target JO
[ 5%] Built target LZ4
[ 5%] Built target PugiXml
[ 5%] Built target rapidjson
[ 17%] Built target SDL
[ 17%] Built target StanHull
[ 17%] Built target STB
[ 21%] Built target AngelScript
[ 21%] Built target Civetweb
[ 24%] Built target kNet
[ 25%] Built target Detour
[ 26%] Built target DetourCrowd
[ 26%] Built target DetourTileCache
[ 27%] Built target Recast
[ 32%] Built target Box2D
[ 48%] Built target Bullet
[ 48%] Built target GLEW
[ 49%] Built target LibCpuId
[ 76%] Built target Urho3D
[ 76%] Built target Urho3DPlayer
[ 95%] Built target Assimp
[ 95%] Built target AssetImporter
[ 95%] Built target OgreImporter
[ 95%] Built target PackageTool
[ 95%] Built target RampGenerator
[ 95%] Built target SpritePacker
[ 96%] Built target ScriptCompiler
[ 96%] Building CXX object Source/GameEconomic/GameEconomicGameClient/CMakeFiles/GameEconomicGameClient.dir/__/GameEconomicComponents/connectorDB.cpp.obj
/media/home2/vivienne/Urho3D-gameeconomic/Source/GameEconomic/GameEconomicComponents/connectorDB.cpp:13:30: fatal error: mysql_connection.h: No such file or directory
compilation terminated.
make[2]: *** [Source/GameEconomic/GameEconomicGameClient/CMakeFiles/GameEconomicGameClient.dir/__/GameEconomicComponents/connectorDB.cpp.obj] Error 1
make[1]: *** [Source/GameEconomic/GameEconomicGameClient/CMakeFiles/GameEconomicGameClient.dir/all] Error 2
make: *** [all] Error 2