Skip to content

Commit

Permalink
Fixes for cmake 2.8.12
Browse files Browse the repository at this point in the history
For some unknown reason, cmake doesn't pass macro definitions from
add_definitions() to moc anymore.
  • Loading branch information
hluk committed Oct 12, 2013
1 parent de8eb3c commit 0a12ba7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ macro (copyq_add_plugin)
${copyq_plugin_RCC}
)

set_target_properties(${copyq_pkg} PROPERTIES
COMPILE_DEFINITIONS "${copyq_plugin_${copyq_pkg}_DEFINITIONS}")

if (WITH_QT5)
qt5_use_modules(${copyq_pkg} Widgets ${copyq_plugin_${copyq_pkg}_Qt5_Modules})
else()
Expand Down
4 changes: 3 additions & 1 deletion plugins/itemfakevim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ file(GLOB copyq_plugin_itemfakevim_SOURCES

include_directories(fakevim)

add_definitions( -DFAKEVIM_STANDALONE -DQTCREATOR_UTILS_STATIC_LIB )
set(copyq_plugin_itemfakevim_DEFINITIONS
FAKEVIM_STANDALONE
QTCREATOR_UTILS_STATIC_LIB)

set(copyq_plugin_itemfakevim_RESOURCES itemfakevim.qrc)

Expand Down
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (WITH_TESTS)
)

if (WITH_QT5)
set(copyq_Qt5_Modules ${copyq_Qt5_Modules} Test)
list(APPEND copyq_Qt5_Modules Test)
else()
set(QT_USE_QTTEST TRUE)
endif()
Expand Down Expand Up @@ -112,6 +112,9 @@ if (WIN32)
include(${QT_USE_FILE})
endif()

# macros definitions for preprocessor and moc
set_target_properties(copyqcon PROPERTIES COMPILE_DEFINITIONS "${copyq_DEFINITIONS}")

# link console app
target_link_libraries(copyqcon ${QT_LIBRARIES})

Expand All @@ -133,6 +136,9 @@ else()
include(${QT_USE_FILE})
endif()

# macros definitions for preprocessor and moc
set_target_properties(copyq PROPERTIES COMPILE_DEFINITIONS "${copyq_DEFINITIONS}")

# link
target_link_libraries(copyq ${QT_LIBRARIES} ${copyq_LIBRARIES})

Expand Down
6 changes: 3 additions & 3 deletions src/platform/x11/x11platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ if(NOT X11_Xfixes_FOUND)
endif(NOT X11_Xfixes_FOUND)

if(X11_XTest_FOUND)
add_definitions( -DHAS_X11TEST )
set(copyq_LIBRARIES ${X11_XTest_LIB})
list(APPEND copyq_DEFINITIONS HAS_X11TEST)
list(APPEND copyq_LIBRARIES ${X11_XTest_LIB})
else(X11_XTest_FOUND)
message(WARNING "X11 'TEST' extension library is needed to be able to"
" automatically paste to some windows!")
endif(X11_XTest_FOUND)

add_definitions( -DCOPYQ_WS_X11 )
list(APPEND copyq_DEFINITIONS COPYQ_WS_X11)

file(GLOB copyq_SOURCES ${copyq_SOURCES}
platform/x11/*.cpp
Expand Down

0 comments on commit 0a12ba7

Please sign in to comment.