]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Fix setup of build time output paths in cmake
authorRalf Habacker <ralf.habacker@freenet.de>
Sat, 15 Dec 2018 09:54:47 +0000 (10:54 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 17 Dec 2018 15:25:03 +0000 (16:25 +0100)
Instead of the variables EXECUTABLE_OUTPUT_PATH and
LIBRARY_OUTPUT_PATH, which have become obsolete since
cmake 3.x, CMAKE_xxx_OUTPUT_PATH is now used to define
output paths in the build directory.

cmake/CMakeLists.txt

index 884b277fda6e24179b7a70f4d1f6e5474b43d1e5..759c40a1be84620a26dccfcb1ad74b2740175fee 100644 (file)
@@ -278,19 +278,20 @@ ENABLE_TESTING()
 #endif(${generatedFileInSourceDir})
 #########################################################################
 
-if (WIN32 OR CYGWIN)
-       set (LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/bin)
-else (WIN32 OR CYGWIN)
-       set (LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/lib)
-endif (WIN32 OR CYGWIN)
-
-set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
+########### build output path definitions ###############
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+if(WIN32 OR CYGWIN)
+    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+else()
+    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+endif()
+set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 
 # for including config.h and for includes like <dir/foo.h>
 include_directories( ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR} ${CMAKE_INCLUDE_PATH} )
 
 # linker search directories
-link_directories(${DBUS_LIB_DIR} ${LIBRARY_OUTPUT_PATH} )
+link_directories(${DBUS_LIB_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} )
 include_directories( ${CMAKE_LIBRARY_PATH}  )
 
 set(DBUS_INCLUDES)
@@ -482,9 +483,9 @@ add_definitions(${DBUS_BUS_CFLAGS})
 
 if (DBUS_BUILD_TESTS)
     # set variables used for the .in files (substituted by configure_file) in test/data:
-    set(DBUS_TEST_EXEC ${Z_DRIVE_IF_WINE}${EXECUTABLE_OUTPUT_PATH}${IDE_BIN})
+    set(DBUS_TEST_EXEC ${Z_DRIVE_IF_WINE}${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${IDE_BIN})
     set(DBUS_TEST_DATA ${Z_DRIVE_IF_WINE}${CMAKE_BINARY_DIR}/test/data)
-    set(TEST_LAUNCH_HELPER_BINARY ${Z_DRIVE_IF_WINE}${EXECUTABLE_OUTPUT_PATH}/dbus-daemon-launch-helper-test)
+    set(TEST_LAUNCH_HELPER_BINARY ${Z_DRIVE_IF_WINE}${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dbus-daemon-launch-helper-test)
     if (UNIX)
         set(TEST_SOCKET_DIR ${DBUS_SESSION_SOCKET_DIR})
         set(TEST_LISTEN "unix:tmpdir=${TEST_SOCKET_DIR}")