diff --git a/CMakeLists.txt b/CMakeLists.txt index d6d97ff4..a0b7ccad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,14 +147,30 @@ endif() find_program(DOTNET dotnet) if(DOTNET) + SET(DOTNET_RUNTIME_FLAGS "") + if(WIN32) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(DOTNET_RUNTIME_FLAGS "--runtime;win-x64") + + elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + SET(DOTNET_RUNTIME_FLAGS "--runtime;win-x86") + endif() + endif() + + message("${DOTNET} build -c Release ${DOTNET_RUNTIME_FLAGS}") execute_process( - COMMAND ${DOTNET} build -c Release + COMMAND ${DOTNET} build -c Release ${DOTNET_RUNTIME_FLAGS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bindings/cs/) file(GLOB_RECURSE CS_BINDINGS "${CMAKE_CURRENT_SOURCE_DIR}/bindings/cs/libsurvive.net/bin/Release/*.dll") - install(FILES ${CS_BINDINGS} DESTINATION "lib") + install(FILES ${CS_BINDINGS} DESTINATION "bin") + + file(GLOB_RECURSE CS_DEMO + "${CMAKE_CURRENT_SOURCE_DIR}/bindings/cs/Demo/bin/Release/Demo.*") + + install(FILES ${CS_DEMO} DESTINATION "bin") endif() if(EXISTS /etc/bash_completion.d) diff --git a/redist/CMakeLists.txt b/redist/CMakeLists.txt index 543dc782..fea8c28a 100644 --- a/redist/CMakeLists.txt +++ b/redist/CMakeLists.txt @@ -73,6 +73,11 @@ elseif(WIN32) endif() message("Nuget is found at ${NUGET}") add_custom_command(TARGET minimal_opencv PRE_BUILD COMMAND ${NUGET} restore ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.sln) + + file(GLOB_RECURSE OPENBLAS_DLLS + "${CMAKE_BINARY_DIR}/packages/*.dll") + + install(FILES ${OPENBLAS_DLLS} DESTINATION "bin") ENDIF() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d661a235..9bcaaf4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,6 +55,9 @@ set_target_properties(survive PROPERTIES FOLDER "libraries" SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION}) +if(WIN32) + set_target_properties(survive PROPERTIES PREFIX "lib") +endif() target_link_libraries(survive minimal_opencv ${ADDITIONAL_LIBRARIES} mpfit) IF(HAVE_ZLIB_H) @@ -147,7 +150,12 @@ function(SURVIVE_REGISTER_PLUGIN PLUGIN) #set_target_properties(${PLUGIN} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}Release/plugins") #set_target_properties(${PLUGIN} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${OUTPUT_DIR}RelWithDebInfo/plugins") +if(NOT WIN32) install(TARGETS ${PLUGIN} DESTINATION lib/libsurvive/plugins) +else() + install(TARGETS ${PLUGIN} DESTINATION bin/plugins) +endif() + endfunction() foreach(PLUGIN ${PLUGINS}) @@ -168,6 +176,11 @@ ENDIF() set(SURVIVE_BUILT_PLUGINS "${SURVIVE_BUILT_PLUGINS}" PARENT_SCOPE) +if(NOT WIN32) install(TARGETS ${SURVIVE_BUILT_PLUGINS} DESTINATION lib/libsurvive/plugins) install(TARGETS survive DESTINATION lib/libsurvive) install(TARGETS survive DESTINATION lib) +else() +install(TARGETS ${SURVIVE_BUILT_PLUGINS} DESTINATION bin/plugins) +install(TARGETS survive DESTINATION bin) +endif()