Skip to content

Commit

Permalink
Improve Windows link library dependency
Browse files Browse the repository at this point in the history
Fixes an error when building with CMAKE_LINK_LIBRARIES_ONLY_TARGETS enabled.
  • Loading branch information
triplef committed Sep 11, 2023
1 parent 14e9d14 commit aed9391
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ endif()
target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_LIBRARIES})

if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE advapi32)
find_library(advapi32_LIBRARY advapi32 REQUIRED)
mark_as_advanced(advapi32_LIBRARY)
target_link_libraries(${PROJECT_NAME} PRIVATE ${advapi32_LIBRARY})
endif()

target_compile_definitions(${PROJECT_NAME} PUBLIC QAPPLICATION_CLASS=${QAPPLICATION_CLASS})
Expand Down

0 comments on commit aed9391

Please sign in to comment.