summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authoraneejit1 <aneejit1@gmail.com>2020-06-25 14:06:56 +0000
committerTDE Gitea <gitea@mirror.git.trinitydesktop.org>2020-06-26 05:57:21 +0000
commit6b36c71829e01be3ee241f77e8b4123c41bea86c (patch)
treeb44c7607e3de25894a8b6bbdd283f029aa1cea83 /ConfigureChecks.cmake
parentb75198842550c75fbb2a2d5023f4716dfe2a5c77 (diff)
downloadamarok-6b36c71829e01be3ee241f77e8b4123c41bea86c.tar.gz
amarok-6b36c71829e01be3ee241f77e8b4123c41bea86c.zip
Tidy up the formatting of the mysql tests
Signed-off-by: aneejit1 <aneejit1@gmail.com>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake94
1 files changed, 47 insertions, 47 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index d151dd61..f1b7246b 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 )