Skip to content

Commit

Permalink
Build: Replaced deprecated exec_program with execute_process
Browse files Browse the repository at this point in the history
  • Loading branch information
Shauren committed Mar 1, 2024
1 parent 5c44ac1 commit 8eac622
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW) # find_package() uses upper-case <PACKAGENAME>_ROOT variables
endif()

if(POLICY CMP0153)
cmake_policy(SET CMP0153 NEW) # The exec_program() command should not be called
endif()

# Set RPATH-handing (CMake parameters)
set(CMAKE_SKIP_BUILD_RPATH 0)
set(CMAKE_BUILD_WITH_INSTALL_RPATH 0)
Expand Down
8 changes: 4 additions & 4 deletions cmake/macros/FindMySQL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ if(UNIX)
if(MYSQL_CONFIG)
message(STATUS "Using mysql-config: ${MYSQL_CONFIG}")
# set INCLUDE_DIR
exec_program(${MYSQL_CONFIG}
ARGS --include
execute_process(
COMMAND "${MYSQL_CONFIG}" --include
OUTPUT_VARIABLE MY_TMP
)

string(REGEX REPLACE "-I([^ ]*)( .*)?" "\\1" MY_TMP "${MY_TMP}")
set(MYSQL_ADD_INCLUDE_PATH ${MY_TMP} CACHE FILEPATH INTERNAL)
#message("[DEBUG] MYSQL ADD_INCLUDE_PATH : ${MYSQL_ADD_INCLUDE_PATH}")
# set LIBRARY_DIR
exec_program(${MYSQL_CONFIG}
ARGS --libs_r
execute_process(
COMMAND "${MYSQL_CONFIG}" --libs_r
OUTPUT_VARIABLE MY_TMP
)
set(MYSQL_ADD_LIBRARIES "")
Expand Down

0 comments on commit 8eac622

Please sign in to comment.