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 2f959a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ endif()
target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_LIBRARIES})

if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE advapi32)
find_library(advapi32_LIBRARY advapi32 REQUIRED)
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 2f959a1

Please sign in to comment.