diff options
| author | aneejit1 <aneejit1@gmail.com> | 2020-06-25 14:06:56 +0000 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-06-26 15:00:20 +0900 |
| commit | f337cd3d7e8e7e4d59d4568e41b6d87af4e6c23d (patch) | |
| tree | 943ee6e188ee1635ee88c58616d5ee07700ed58b | |
| parent | d5fe80869f7b4b70300a502ebf8d8ba4e190d3d2 (diff) | |
| download | amarok-f337cd3d7e8e7e4d59d4568e41b6d87af4e6c23d.tar.gz amarok-f337cd3d7e8e7e4d59d4568e41b6d87af4e6c23d.zip | |
Tidy up the formatting of the mysql tests
Signed-off-by: aneejit1 <aneejit1@gmail.com>
(cherry picked from commit 6b36c71829e01be3ee241f77e8b4123c41bea86c)
| -rw-r--r-- | ConfigureChecks.cmake | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 44ea0682..d9e923ca 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -265,15 +265,16 @@ endif( WITH_MP4V2 ) if( WITH_MYSQL ) -#### check for MySql or Mariadb + #### check for MySql or Mariadb -message( STATUS "Check for MariaDB or MySQL" ) -find_program( MYSQL_CONFIG NAMES mariadb_config mysql_config ) -if( NOT MYSQL_CONFIG ) + message( STATUS "Check for MariaDB or MySQL" ) + find_program( MYSQL_CONFIG NAMES mariadb_config mysql_config ) + + if( NOT MYSQL_CONFIG ) tde_message_fatal( "MySql support is requested but neither MySql or Mariadb have been found on your system" ) else() -macro( _mysql_config __type __var ) + macro( _mysql_config __type __var ) execute_process( COMMAND ${MYSQL_CONFIG} --${__type} OUTPUT_VARIABLE ${__var} @@ -282,62 +283,61 @@ macro( _mysql_config __type __var ) if( _result ) tde_message_fatal( "Unable to run ${MYSQL_CONFIG}!" ) endif() -endmacro() + endmacro() -_mysql_config( include MYSQL_INCLUDE_DIRS ) -_mysql_config( libs MYSQL_LIBRARIES ) + _mysql_config( include MYSQL_INCLUDE_DIRS ) + _mysql_config( libs MYSQL_LIBRARIES ) -if( MYSQL_INCLUDE_DIRS ) + if( MYSQL_INCLUDE_DIRS ) string( REGEX REPLACE "(^| +)-I" ";" MYSQL_INCLUDE_DIRS "${MYSQL_INCLUDE_DIRS}" ) -endif() + endif() -if( MYSQL_LIBRARIES ) + if( MYSQL_LIBRARIES ) string( REGEX REPLACE "(^| +)-l" ";" MYSQL_LIBRARIES "${MYSQL_LIBRARIES}" ) -endif( ) - -set( MYSQL_INCLUDE_DIRS "${MYSQL_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE ) -set( MYSQL_LIBRARIES "${MYSQL_LIBRARIES}" CACHE INTERNAL "" FORCE ) - -message( STATUS " includes ${MYSQL_INCLUDE_DIRS} ") -message( STATUS " libraries ${MYSQL_LIBRARIES} ") -set( USE_MYSQL 1 ) + endif( ) -tde_save_and_set( CMAKE_REQUIRED_INCLUDES ${MYSQL_INCLUDE_DIRS} ) + set( MYSQL_INCLUDE_DIRS "${MYSQL_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE ) + set( MYSQL_LIBRARIES "${MYSQL_LIBRARIES}" CACHE INTERNAL "" FORCE ) -check_cxx_source_compiles(" -#include <mysql.h> -typedef struct st_mysql MYSQL; + message( STATUS " includes ${MYSQL_INCLUDE_DIRS} ") + message( STATUS " libraries ${MYSQL_LIBRARIES} ") + set( USE_MYSQL 1 ) -int main(int, char**) -{ - return 1; -}" -HAVE_STRUCT_ST_MYSQL ) - -if( HAVE_STRUCT_ST_MYSQL ) - set( MYSQL_STRUCT "st_mysql" ) -else() + tde_save_and_set( CMAKE_REQUIRED_INCLUDES ${MYSQL_INCLUDE_DIRS} ) check_cxx_source_compiles(" -#include <mysql.h> -typedef struct MYSQL MYSQL; - -int main() -{ - return 1; -}" - HAVE_STRUCT_MYSQL ) - - if( HAVE_STRUCT_MYSQL ) - set( MYSQL_STRUCT "MYSQL" ) + #include <mysql.h> + typedef struct st_mysql MYSQL; + int main(int, char**) + { + return 1; + }" + HAVE_STRUCT_ST_MYSQL ) + + if( HAVE_STRUCT_ST_MYSQL ) + set( MYSQL_STRUCT "st_mysql" ) else() - tde_message_fatal( "MySQL is requested, but it is not possible to determine the type of MySQL structure" ) + check_cxx_source_compiles(" + #include <mysql.h> + typedef struct MYSQL MYSQL; + + int main() + { + return 1; + }" + HAVE_STRUCT_MYSQL ) + + if( HAVE_STRUCT_MYSQL ) + set( MYSQL_STRUCT "MYSQL" ) + else() + tde_message_fatal( "MySQL is requested, but it is not possible to determine the type of MySQL structure" ) + endif() endif() -endif() -tde_restore( CMAKE_REQUIRED_INCLUDES ) + tde_restore( CMAKE_REQUIRED_INCLUDES ) + + endif( NOT MYSQL_CONFIG ) -endif( NOT MYSQL_CONFIG ) endif( WITH_MYSQL ) |
