Commit cd02b212 authored by Christophe Giboudeaux's avatar Christophe Giboudeaux
Browse files

CMake: use target_compile_definitions when possible

parent 2512ae03
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
if(MYSQLD_EXECUTABLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMYSQLD_EXECUTABLE=\"\\\"${MYSQLD_EXECUTABLE}\\\"\"")
endif()
if(POSTGRES_PATH)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPOSTGRES_PATH=\"\\\"${POSTGRES_PATH}\\\"\"")
endif()
########### next target ############### ########### next target ###############
set(AKONADI_DB_SCHEMA "${CMAKE_CURRENT_SOURCE_DIR}/storage/akonadidb.xml") set(AKONADI_DB_SCHEMA "${CMAKE_CURRENT_SOURCE_DIR}/storage/akonadidb.xml")
...@@ -173,10 +165,18 @@ add_library(libakonadiserver STATIC ${libakonadiserver_SRCS}) ...@@ -173,10 +165,18 @@ add_library(libakonadiserver STATIC ${libakonadiserver_SRCS})
set_target_properties(libakonadiserver PROPERTIES OUTPUT_NAME akonadiserver) set_target_properties(libakonadiserver PROPERTIES OUTPUT_NAME akonadiserver)
if(MYSQLD_EXECUTABLE)
target_compile_definitions(libakonadiserver PRIVATE MYSQLD_EXECUTABLE="${MYSQLD_EXECUTABLE}")
endif()
if(MYSQLD_SCRIPTS_PATH) if(MYSQLD_SCRIPTS_PATH)
target_compile_definitions(libakonadiserver PRIVATE MYSQLD_SCRIPTS_PATH="${MYSQLD_SCRIPTS_PATH}") target_compile_definitions(libakonadiserver PRIVATE MYSQLD_SCRIPTS_PATH="${MYSQLD_SCRIPTS_PATH}")
endif() endif()
if(POSTGRES_PATH)
target_compile_definitions(libakonadiserver PRIVATE POSTGRES_PATH="${POSTGRES_PATH}")
endif()
target_link_libraries(libakonadiserver target_link_libraries(libakonadiserver
akonadi_shared akonadi_shared
KF5AkonadiPrivate KF5AkonadiPrivate
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment