mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
an attempt to improve the MySQL CMake module, let's see if Travis build fails
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
c25e7674fa
commit
2c65588e34
2 changed files with 42 additions and 14 deletions
|
@ -21,8 +21,8 @@ before_script:
|
||||||
- sleep 3
|
- sleep 3
|
||||||
script:
|
script:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- if [ "$CXX" == "clang++" ];then cmake ../ -GNinja -DENABLE_TESTING=TRUE -DKATIE_UTILS=ON -Wno-dev -DMYSQL_LIBRARIES:STRING="-lmysqld -lcrypt -laio" ;fi
|
- if [ "$CXX" == "clang++" ];then cmake ../ -GNinja -DENABLE_TESTING=TRUE -DKATIE_UTILS=ON -Wno-dev ;fi
|
||||||
- if [ "$CXX" == "g++" ];then cmake ../ -GNinja -DENABLE_TESTING=TRUE -DKATIE_UTILS=ON -DKATIE_ALLINONE=ON -Wno-dev -DMYSQL_LIBRARIES:STRING="-lmysqld -lcrypt -laio" ;fi
|
- if [ "$CXX" == "g++" ];then cmake ../ -GNinja -DENABLE_TESTING=TRUE -DKATIE_UTILS=ON -DKATIE_ALLINONE=ON -Wno-dev ;fi
|
||||||
- ninja
|
- ninja
|
||||||
# the tests/benchmarks take more then 1-hour and Travis times out,
|
# the tests/benchmarks take more then 1-hour and Travis times out,
|
||||||
# despite the documentaiton for the service claiming otherwise
|
# despite the documentaiton for the service claiming otherwise
|
||||||
|
|
|
@ -14,22 +14,50 @@ if(MYSQL_INCLUDES AND MYSQL_LIBRARIES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Neither MySQL nor MariaDB provide pkg-config files
|
# Neither MySQL nor MariaDB provide pkg-config files
|
||||||
|
# However, they provide mysql_config
|
||||||
find_path(MYSQL_INCLUDES
|
find_program(MYSQL_CONFIG
|
||||||
NAMES
|
NAMES
|
||||||
mysql.h
|
mysql_config
|
||||||
PATH_SUFFIXES mysql
|
|
||||||
HINTS
|
HINTS
|
||||||
$ENV{MYSQLDIR}/include
|
$ENV{MYSQLDIR}/bin
|
||||||
${INCLUDE_INSTALL_DIR}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(MYSQL_LIBRARIES
|
if(MYSQL_CONFIG)
|
||||||
mysqld
|
message(STATUS "Using ${MYSQL_CONFIG} to get package variables")
|
||||||
HINTS
|
execute_process(
|
||||||
$ENV{MYSQLDIR}/lib
|
COMMAND ${MYSQL_CONFIG} --variable=pkgincludedir
|
||||||
${LIB_INSTALL_DIR}
|
RESULT_VARIABLE procerror1
|
||||||
)
|
OUTPUT_VARIABLE MYSQL_INCLUDES
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${MYSQL_CONFIG} --libmysqld-libs
|
||||||
|
RESULT_VARIABLE proceerror2
|
||||||
|
OUTPUT_VARIABLE MYSQL_LIBRARIES
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
# just in case
|
||||||
|
if(NOT procerror1 STREQUAL "0" OR NOT proceerror2 STREQUAL "0")
|
||||||
|
set(MYSQL_INCLUDES)
|
||||||
|
set(MYSQL_LIBRARIES)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
find_path(MYSQL_INCLUDES
|
||||||
|
NAMES
|
||||||
|
mysql.h
|
||||||
|
PATH_SUFFIXES mysql
|
||||||
|
HINTS
|
||||||
|
$ENV{MYSQLDIR}/include
|
||||||
|
${INCLUDE_INSTALL_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(MYSQL_LIBRARIES
|
||||||
|
mysqld
|
||||||
|
HINTS
|
||||||
|
$ENV{MYSQLDIR}/lib
|
||||||
|
${LIB_INSTALL_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(MySQL DEFAULT_MSG MYSQL_INCLUDES MYSQL_LIBRARIES)
|
find_package_handle_standard_args(MySQL DEFAULT_MSG MYSQL_INCLUDES MYSQL_LIBRARIES)
|
||||||
|
|
Loading…
Add table
Reference in a new issue