Skip to content

Commit

Permalink
Do not link nocode with Qt5Widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
yegord committed May 24, 2019
1 parent e6546a0 commit e2df9ea
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,17 @@ if(${NC_QT5})
macro(qt4_wrap_cpp)
endmacro()

set(QT_LIBRARIES Qt5::Core Qt5::Widgets)
set(NC_QT_CORE Qt5::Core)
set(NC_QT_WIDGETS Qt5::Widgets)
else()
# Find Qt4.
find_package(Qt4 REQUIRED QtCore QtGui)
include(${QT_USE_FILE})

# Too lazy to filter the right libraries from ${QT_LIBRARIES}.
set(NC_QT_CORE ${QT_LIBRARIES})
set(NC_QT_WIDGETS ${QT_LIBRARIES})

# This is used to produce standalone bundles on Windows.
include(DeployQt4)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/ida-plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ endif()
qt4_wrap_cpp(SOURCES ${MOC_HEADERS} OPTIONS -DQ_MOC_RUN)

add_library(ida-plugin SHARED ${SOURCES})
target_link_libraries(ida-plugin nc nc-gui ${Boost_LIBRARIES} ${QT_LIBRARIES} ${IDA_LIBRARIES})
target_link_libraries(ida-plugin nc nc-gui ${Boost_LIBRARIES} ${NC_QT_CORE} ${NC_QT_WIDGETS} ${IDA_LIBRARIES})
set_target_properties(ida-plugin PROPERTIES OUTPUT_NAME "snowman" PREFIX "" SUFFIX "${IDA_PLUGIN_EXT}")
install(TARGETS ida-plugin RUNTIME DESTINATION bin LIBRARY DESTINATION lib)

Expand Down
2 changes: 1 addition & 1 deletion src/nc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/common/Version.cpp")
qt4_wrap_cpp(SOURCES ${MOC_HEADERS} OPTIONS -DQ_MOC_RUN)

add_library(nc ${SOURCES})
target_link_libraries(nc capstone-static udis86 iberty undname ${Boost_LIBRARIES} ${QT_LIBRARIES})
target_link_libraries(nc capstone-static udis86 iberty undname ${Boost_LIBRARIES} ${NC_QT_CORE})

add_subdirectory(gui)

Expand Down
2 changes: 1 addition & 1 deletion src/nc/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ set(SOURCES
qt4_wrap_cpp(SOURCES ${MOC_HEADERS} OPTIONS -DQ_MOC_RUN)

add_library(nc-gui ${SOURCES})
target_link_libraries(nc-gui nc ${Boost_LIBRARIES} ${QT_LIBRARIES})
target_link_libraries(nc-gui nc ${Boost_LIBRARIES} ${NC_QT_CORE} ${NC_QT_WIDGETS})

# vim:set et sts=4 sw=4 nospell:
2 changes: 1 addition & 1 deletion src/nocode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(SOURCES
)

add_executable(nocode ${SOURCES})
target_link_libraries(nocode nc ${Boost_LIBRARIES} ${QT_LIBRARIES})
target_link_libraries(nocode nc ${Boost_LIBRARIES} ${NC_QT_CORE})

if (NOT ${IDA_PLUGIN_ENABLED})
install(TARGETS nocode RUNTIME DESTINATION bin)
Expand Down
2 changes: 1 addition & 1 deletion src/snowman/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(SOURCES
)

add_executable(snowman WIN32 ${SOURCES})
target_link_libraries(snowman nc nc-gui ${Boost_LIBRARIES} ${QT_LIBRARIES})
target_link_libraries(snowman nc nc-gui ${Boost_LIBRARIES} ${NC_QT_CORE} ${NC_QT_WIDGETS})
if(MSVC)
set_target_properties(snowman PROPERTIES LINK_FLAGS /ENTRY:mainCRTStartup)
endif()
Expand Down

0 comments on commit e2df9ea

Please sign in to comment.