Skip to content

Commit

Permalink
cmake: Use default install location on windows for dlls
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort committed Aug 27, 2023
1 parent a0c029a commit bf15f6f
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 74 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ endif()

set( wpilib_dest "")
set( include_dest include )
set( main_lib_dest lib )
set( java_lib_dest java )
set( jni_lib_dest jni )

Expand Down
12 changes: 2 additions & 10 deletions apriltag/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ if (WITH_JAVA)
target_link_libraries(apriltagjni PRIVATE apriltag_jni_headers)
add_dependencies(apriltagjni apriltag_jar)

if (MSVC)
install(TARGETS apriltagjni RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

install(TARGETS apriltagjni EXPORT apriltagjni DESTINATION "${main_lib_dest}")
install(TARGETS apriltagjni EXPORT apriltagjni)

endif()

Expand Down Expand Up @@ -94,13 +90,9 @@ target_include_directories(apriltag PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
$<INSTALL_INTERFACE:${include_dest}/apriltag>)

install(TARGETS apriltag EXPORT apriltag DESTINATION "${main_lib_dest}")
install(TARGETS apriltag EXPORT apriltag)
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/apriltag")

if (WITH_JAVA AND MSVC)
install(TARGETS apriltag RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

if (WITH_FLAT_INSTALL)
set (apriltag_config_dir ${wpilib_dest})
else()
Expand Down
6 changes: 1 addition & 5 deletions cameraserver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,9 @@ target_link_libraries(cameraserver PUBLIC ntcore cscore wpiutil ${OpenCV_LIBS})

set_property(TARGET cameraserver PROPERTY FOLDER "libraries")

install(TARGETS cameraserver EXPORT cameraserver DESTINATION "${main_lib_dest}")
install(TARGETS cameraserver EXPORT cameraserver)
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/cameraserver")

if (WITH_JAVA AND MSVC)
install(TARGETS cameraserver RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

if (WITH_FLAT_INSTALL)
set (cameraserver_config_dir ${wpilib_dest})
else()
Expand Down
8 changes: 2 additions & 6 deletions cscore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ target_link_libraries(cscore PUBLIC wpinet wpiutil ${OpenCV_LIBS})

set_property(TARGET cscore PROPERTY FOLDER "libraries")

install(TARGETS cscore EXPORT cscore DESTINATION "${main_lib_dest}")
install(TARGETS cscore EXPORT cscore)
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/cscore")

if (WITH_FLAT_INSTALL)
Expand Down Expand Up @@ -139,11 +139,7 @@ if (WITH_JAVA)
endif()
add_dependencies(cscorejni cscore_jar)

if (MSVC)
install(TARGETS cscorejni RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

install(TARGETS cscorejni EXPORT cscorejni DESTINATION "${main_lib_dest}")
install(TARGETS cscorejni EXPORT cscorejni)

endif()

Expand Down
4 changes: 2 additions & 2 deletions glass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ target_include_directories(libglass PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/lib/native/include>
$<INSTALL_INTERFACE:${include_dest}/glass>)

install(TARGETS libglass EXPORT libglass DESTINATION "${main_lib_dest}")
install(TARGETS libglass EXPORT libglass)
install(DIRECTORY src/lib/native/include/ DESTINATION "${include_dest}/glass")

#
Expand All @@ -43,7 +43,7 @@ target_include_directories(libglassnt PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/libnt/native/include>
$<INSTALL_INTERFACE:${include_dest}/glass>)

install(TARGETS libglassnt EXPORT libglassnt DESTINATION "${main_lib_dest}")
install(TARGETS libglassnt EXPORT libglassnt)
install(DIRECTORY src/libnt/native/include/ DESTINATION "${include_dest}/glass")

#
Expand Down
8 changes: 2 additions & 6 deletions hal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ target_link_libraries(hal PUBLIC wpiutil)

set_property(TARGET hal PROPERTY FOLDER "libraries")

install(TARGETS hal EXPORT hal DESTINATION "${main_lib_dest}")
install(TARGETS hal EXPORT hal)
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/hal")
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gen/ DESTINATION "${include_dest}/hal")

Expand Down Expand Up @@ -118,11 +118,7 @@ if (WITH_JAVA)
endif()
add_dependencies(haljni hal_jar)

if (MSVC)
install(TARGETS haljni RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

install(TARGETS haljni EXPORT haljni DESTINATION "${main_lib_dest}")
install(TARGETS haljni EXPORT haljni)

endif()

Expand Down
8 changes: 2 additions & 6 deletions ntcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ target_link_libraries(ntcore PUBLIC wpinet wpiutil)

set_property(TARGET ntcore PROPERTY FOLDER "libraries")

install(TARGETS ntcore EXPORT ntcore DESTINATION "${main_lib_dest}")
install(TARGETS ntcore EXPORT ntcore)
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/ntcore")
install(DIRECTORY ${WPILIB_BINARY_DIR}/ntcore/generated/main/native/include/ DESTINATION "${include_dest}/ntcore")

Expand Down Expand Up @@ -79,10 +79,6 @@ if (WITH_JAVA)

set_property(TARGET ntcorejni PROPERTY FOLDER "libraries")

if (MSVC)
install(TARGETS ntcorejni RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
target_include_directories(ntcorejni PRIVATE ${JNI_INCLUDE_DIRS})
target_include_directories(ntcorejni PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/jniheaders")
Expand All @@ -91,7 +87,7 @@ if (WITH_JAVA)
endif()
add_dependencies(ntcorejni ntcore_jar)

install(TARGETS ntcorejni EXPORT ntcorejni DESTINATION "${main_lib_dest}")
install(TARGETS ntcorejni EXPORT ntcorejni)

endif()

Expand Down
2 changes: 1 addition & 1 deletion simulation/halsim_ds_socket/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ target_include_directories(halsim_ds_socket PRIVATE src/main/native/include)

set_property(TARGET halsim_ds_socket PROPERTY FOLDER "libraries")

install(TARGETS halsim_ds_socket EXPORT halsim_ds_socket DESTINATION "${main_lib_dest}")
install(TARGETS halsim_ds_socket EXPORT halsim_ds_socket)
2 changes: 1 addition & 1 deletion simulation/halsim_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ target_include_directories(halsim_gui PRIVATE src/main/native/include)

set_property(TARGET halsim_gui PROPERTY FOLDER "libraries")

install(TARGETS halsim_gui EXPORT halsim_gui DESTINATION "${main_lib_dest}")
install(TARGETS halsim_gui EXPORT halsim_gui)
2 changes: 1 addition & 1 deletion simulation/halsim_ws_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ target_include_directories(halsim_ws_client PRIVATE src/main/native/include)

set_property(TARGET halsim_ws_client PROPERTY FOLDER "libraries")

install(TARGETS halsim_ws_client EXPORT halsim_ws_client DESTINATION "${main_lib_dest}")
install(TARGETS halsim_ws_client EXPORT halsim_ws_client)
2 changes: 1 addition & 1 deletion simulation/halsim_ws_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ target_include_directories(halsim_ws_core PUBLIC src/main/native/include)

set_property(TARGET halsim_ws_core PROPERTY FOLDER "libraries")

install(TARGETS halsim_ws_core EXPORT halsim_ws_core DESTINATION "${main_lib_dest}")
install(TARGETS halsim_ws_core EXPORT halsim_ws_core)
2 changes: 1 addition & 1 deletion simulation/halsim_ws_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ target_include_directories(halsim_ws_server PRIVATE src/main/native/include)

set_property(TARGET halsim_ws_server PROPERTY FOLDER "libraries")

install(TARGETS halsim_ws_server EXPORT halsim_ws_server DESTINATION "${main_lib_dest}")
install(TARGETS halsim_ws_server EXPORT halsim_ws_server)
2 changes: 1 addition & 1 deletion wpigui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ add_executable(wpiguidev src/dev/native/cpp/main.cpp)
wpilib_link_macos_gui(wpiguidev)
target_link_libraries(wpiguidev wpigui)

install(TARGETS wpigui EXPORT wpigui DESTINATION "${main_lib_dest}")
install(TARGETS wpigui EXPORT wpigui)
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/wpigui")

#if (WITH_FLAT_INSTALL)
Expand Down
2 changes: 1 addition & 1 deletion wpilibNewCommands/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ target_include_directories(wpilibNewCommands PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
$<INSTALL_INTERFACE:${include_dest}/wpilibNewCommands>)

install(TARGETS wpilibNewCommands EXPORT wpilibNewCommands DESTINATION "${main_lib_dest}")
install(TARGETS wpilibNewCommands EXPORT wpilibNewCommands)
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/wpilibNewCommands")

if (FLAT_INSTALL_WPILIB)
Expand Down
2 changes: 1 addition & 1 deletion wpilibc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ target_link_libraries(wpilibc PUBLIC hal ntcore wpimath wpiutil)

set_property(TARGET wpilibc PROPERTY FOLDER "libraries")

install(TARGETS wpilibc EXPORT wpilibc DESTINATION "${main_lib_dest}")
install(TARGETS wpilibc EXPORT wpilibc)
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/wpilibc")

if (WITH_FLAT_INSTALL)
Expand Down
12 changes: 2 additions & 10 deletions wpimath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ if (WITH_JAVA)
endif()
add_dependencies(wpimathjni wpimath_jar)

if (MSVC)
install(TARGETS wpimathjni RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

install(TARGETS wpimathjni EXPORT wpimathjni DESTINATION "${main_lib_dest}")
install(TARGETS wpimathjni EXPORT wpimathjni)

endif()

Expand Down Expand Up @@ -126,11 +122,7 @@ target_include_directories(wpimath PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
$<INSTALL_INTERFACE:${include_dest}/wpimath>)

install(TARGETS wpimath EXPORT wpimath DESTINATION "${main_lib_dest}")

if (WITH_JAVA AND MSVC)
install(TARGETS wpimath RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()
install(TARGETS wpimath EXPORT wpimath)

if (WITH_FLAT_INSTALL)
set (wpimath_config_dir ${wpilib_dest})
Expand Down
12 changes: 2 additions & 10 deletions wpinet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ if (WITH_JAVA)
endif()
add_dependencies(wpinetjni wpinet_jar)

if (MSVC)
install(TARGETS wpinetjni RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

install(TARGETS wpinetjni EXPORT wpinetjni DESTINATION "${main_lib_dest}")
install(TARGETS wpinetjni EXPORT wpinetjni)

endif()

Expand Down Expand Up @@ -171,11 +167,7 @@ target_include_directories(wpinet PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
$<INSTALL_INTERFACE:${include_dest}/wpinet>)

install(TARGETS wpinet EXPORT wpinet DESTINATION "${main_lib_dest}")

if (WITH_JAVA AND MSVC)
install(TARGETS wpinet RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()
install(TARGETS wpinet EXPORT wpinet)

if (WITH_FLAT_INSTALL)
set (wpinet_config_dir ${wpilib_dest})
Expand Down
12 changes: 2 additions & 10 deletions wpiutil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ if (WITH_JAVA)
endif()
add_dependencies(wpiutiljni wpiutil_jar)

if (MSVC)
install(TARGETS wpiutiljni RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()

install(TARGETS wpiutiljni EXPORT wpiutiljni DESTINATION "${main_lib_dest}")
install(TARGETS wpiutiljni EXPORT wpiutiljni)

endif()

Expand Down Expand Up @@ -171,11 +167,7 @@ target_include_directories(wpiutil PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
$<INSTALL_INTERFACE:${include_dest}/wpiutil>)

install(TARGETS wpiutil EXPORT wpiutil DESTINATION "${main_lib_dest}")

if (WITH_JAVA AND MSVC)
install(TARGETS wpiutil RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
endif()
install(TARGETS wpiutil EXPORT wpiutil)

if (WITH_FLAT_INSTALL)
set (wpiutil_config_dir ${wpilib_dest})
Expand Down

0 comments on commit bf15f6f

Please sign in to comment.