2013-05-28 4 views
0

CMake로 VS 2012 용 C++ 커넥터를 빌드하려고합니다. MySQL 디렉토리를 검색하고 있지만 찾을 수 없습니다.CMake (win) mysql C++ connector - mystre find can not

C:\mysql-connector-c++-1.1.3>cmake -DBOOST_ROOT:STRING=C:\cpp\boost 
CMake Warning (dev) in CMakeLists.txt: 
    A logical block opening on the line 

    C:/mysql-connector-c++-1.1.3/CMakeLists.txt:39 (if) 

    closes on the line 

    C:/mysql-connector-c++-1.1.3/CMakeLists.txt:41 (endif) 

    with mis-matching arguments. 
This warning is for project developers. Use -Wno-dev to suppress it. 

-- Environment compile flags: 
-- Environment link flags: 
-- Boost version: 1.53.0 
-- BOOST_INCLUDE_DIRS=C:/cpp/boost 
-- ENV{MYSQL_DIR} = 
**CMake Error at FindMySQL.cm:220 (MESSAGE): 
    Cannot find MySQL. Include dir: MYSQL_INCLUDE_DIR-NOTFOUND library dir:** 
    cxxflags: 
Call Stack (most recent call first): 
    CMakeLists.txt:173 (INCLUDE) 


-- Configuring incomplete, errors occurred! 

직접 수작업으로 설정하는 방법이 있습니까? 감사합니다.

물론

답변

0

: 당신의 MySQL이있는 디렉토리 (예를 들어 C:\MySql\include 예를 들어)를 포함 위치를 알고 있다면, 바로 다음 -D 옵션을 CMake를 호출

cmake -DMYSQL_INCLUDE_DIR=C:\MySql\include 

-D 명령 줄 옵션으로 CMake 상수를 정의 필요에 따라서, 지정된 값 CMake가 변수를 찾을 수없고 어떤 값을 가져야하는지 알았을 때 호출 할 때 -D으로 CMake에 주어야합니다.

0

일반적으로 필요한 MySQL 파일은 프로그램 파일 폴더에 있습니다. 제 경우에는 MySQL C Connector를 C:\Program Files\MySQL\MySQL Connector C 6.1에있는 기본 위치에 설치했습니다.

당신은 비주얼 스튜디오 2012

주에 MySQL의 C++ 커넥터를 컴파일이 similar post의 단계를 수행 할 수 있습니다 : 당신이 -G "Visual Studio 11"cmake 호출 변화 -G "Visual Studio 11 Win64"에 다음 64 비트하지 않으려면.

-1

내 컴퓨터 환경 변수에 MYSQL_DIR을 추가하면 문제가 해결되었습니다.

희망이 도움이 :

이 디렉토리

은 나에게는 "5.6 \ MySQL은 \ MySQL 서버 E"입니다, MySQL 서버의 디렉토리로 설정해야합니다.