Permalink
Browse files

CMake: Fix errors when path contains spaces

  • Loading branch information...
Lukas W Lukas W
Lukas W authored and Lukas W committed Jun 19, 2018
1 parent 583e42e commit d1c36d7b9664a2bde688cf06e600c4dad8055429
Showing with 10 additions and 10 deletions.
  1. +8 −8 cmake/modules/BuildPlugin.cmake
  2. +2 −2 plugins/CMakeLists.txt
@@ -7,7 +7,7 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "" "MOCFILES;EMBEDDED_RESOURCES;UICFILES;LINK" ${ARGN})
SET(PLUGIN_SOURCES ${PLUGIN_UNPARSED_ARGUMENTS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/gui)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}/src/gui")
ADD_DEFINITIONS(-DPLUGIN_NAME=${PLUGIN_NAME})
@@ -20,15 +20,15 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
FILE(GLOB EXPANDED "${ARG}")
LIST(SORT EXPANDED)
FOREACH(ITEM ${EXPANDED})
LIST(APPEND NEW_ARGS ${ITEM})
LIST(APPEND NEW_ARGS "${ITEM}")
ENDFOREACH()
ENDFOREACH()
SET(PLUGIN_EMBEDDED_RESOURCES ${NEW_ARGS})
SET(ER_H ${CMAKE_CURRENT_BINARY_DIR}/embedded_resources.h)
SET(ER_H "${CMAKE_CURRENT_BINARY_DIR}/embedded_resources.h")
ADD_CUSTOM_COMMAND(OUTPUT ${ER_H}
COMMAND ${BIN2RES}
ARGS ${PLUGIN_EMBEDDED_RESOURCES} > ${ER_H}
ARGS ${PLUGIN_EMBEDDED_RESOURCES} > "${ER_H}"
DEPENDS bin2res)
ENDIF(ER_LEN)
@@ -45,11 +45,11 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
ENDFOREACH(f)
IF(LMMS_BUILD_APPLE)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
LINK_DIRECTORIES("${CMAKE_BINARY_DIR}")
LINK_LIBRARIES(${QT_LIBRARIES})
ENDIF(LMMS_BUILD_APPLE)
IF(LMMS_BUILD_WIN32)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
LINK_DIRECTORIES("${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}")
LINK_LIBRARIES(${QT_LIBRARIES})
ENDIF(LMMS_BUILD_WIN32)
IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -73,12 +73,12 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
INSTALL(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION "${PLUGIN_DIR}")
IF(LMMS_BUILD_APPLE)
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "-bundle_loader ${CMAKE_BINARY_DIR}/lmms")
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "-bundle_loader \"${CMAKE_BINARY_DIR}/lmms\"")
ADD_DEPENDENCIES(${PLUGIN_NAME} lmms)
ENDIF(LMMS_BUILD_APPLE)
IF(LMMS_BUILD_WIN32)
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES PREFIX "")
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} $<TARGET_FILE:${PLUGIN_NAME}>)
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} "$<TARGET_FILE:${PLUGIN_NAME}>")
ENDIF(LMMS_BUILD_WIN32)
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ER_H} ${plugin_MOC_out}")
View
@@ -1,5 +1,5 @@
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
# Enable C++11
ADD_DEFINITIONS(-std=c++0x)

0 comments on commit d1c36d7

Please sign in to comment.