diff --git a/BuildOfficialDistribution.bat b/BuildOfficialDistribution.bat new file mode 100644 index 00000000..613a2e14 --- /dev/null +++ b/BuildOfficialDistribution.bat @@ -0,0 +1,147 @@ +@echo off +setlocal + +::Select the path to the root Boost folder +if DEFINED BOOST_ROOT_PATH (goto build_thirdparty) +set "psCommand="(new-object -COM 'Shell.Application')^ +.BrowseForFolder(0,'Please select the root folder for 64-bit Boost (ex: c:\local\boost_1_61_0).',0,0).self.path"" +for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "BOOST_ROOT_PATH=%%I" +if NOT DEFINED BOOST_ROOT_PATH (goto failure) + +:: Cleanup any prior distribution folders +For /D %%D in ("PSMoveService_*") Do ( + echo "Cleaning up old distro: %%~fD" + del /f /s /q "%%~fD" > nul + rmdir /s /q "%%~fD" +) + +:: Generate the 32-bit project files and dependencies for PSMoveService +call InitialSetup_Win32.bat || goto failure +IF %ERRORLEVEL% NEQ 0 ( + echo "Error setting up 32-bit PSMoveService project" + goto failure +) + +:: Add MSVC build tools to the path +call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 +IF %ERRORLEVEL% NEQ 0 ( + echo "Unable to initialize 32-bit visual studio build environment" + goto failure +) + +:: Compile and install the DEBUG|Win32 build of PSMoveService to the distribution folder +pushd build\ +echo "Building PSMoveService DEBUG|Win32..." +MSBuild.exe opencv.vcxproj /p:configuration=DEBUG /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building OpenCV DEBUG|Win32!" + goto failure +) +MSBuild.exe PSMoveService.sln /p:configuration=DEBUG /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building PSMoveService DEBUG|Win32!" + goto failure +) +MSBuild.exe INSTALL.vcxproj /p:configuration=DEBUG /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error deploying PSMoveService DEBUG|Win32 to distribution folder!" + goto failure +) + +:: Compile and install the RELEASE|Win32 build of PSMoveService to the distribution folder +echo "Building PSMoveService RELEASE|Win32..." +MSBuild.exe opencv.vcxproj /p:configuration=RELEASE /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building OpenCV RELEASE|Win32!" + goto failure +) +MSBuild.exe PSMoveService.sln /p:configuration=RELEASE /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building PSMoveService RELEASE|Win32!" + goto failure +) +MSBuild.exe INSTALL.vcxproj /p:configuration=RELEASE /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error deploying PSMoveService RELEASE|Win32 to distribution folder!" + goto failure +) +popd + +:: Generate the 64-bit project files and dependencies for PSMoveService +call InitialSetup_X64.bat || goto failure +IF %ERRORLEVEL% NEQ 0 ( + echo "Error setting up 64-bit PSMoveService project" + goto failure +) + +:: Add MSVC build tools to the path +call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 +IF %ERRORLEVEL% NEQ 0 ( + echo "Unable to initialize 64-bit visual studio build environment" + goto failure +) + +:: Compile and install the DEBUG|x64 build of PSMoveService to the distribution folder +pushd build\ +echo "Building PSMoveService DEBUG|x64..." +MSBuild.exe opencv.vcxproj /p:configuration=DEBUG /p:Platform="x64" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building OpenCV DEBUG|x64!" + goto failure +) +MSBuild.exe PSMoveService.sln /p:configuration=DEBUG /p:Platform="x64" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building PSMoveService DEBUG|x64!" + goto failure +) +MSBuild.exe INSTALL.vcxproj /p:configuration=DEBUG /p:Platform="x64" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error deploying PSMoveService DEBUG|x64 to distribution folder!" + goto failure +) + +:: Compile and install the RELEASE|x64 build of PSMoveService to the distribution folder +echo "Building PSMoveService RELEASE|x64..." +MSBuild.exe opencv.vcxproj /p:configuration=RELEASE /p:Platform="x64" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building OpenCV RELEASE|x64!" + goto failure +) +MSBuild.exe PSMoveService.sln /p:configuration=RELEASE /p:Platform="x64" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building PSMoveService RELEASE|x64!" + goto failure +) +MSBuild.exe INSTALL.vcxproj /p:configuration=RELEASE /p:Platform="x64" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error deploying PSMoveService RELEASE|x64 to distribution folder!" + goto failure +) +popd + +:: Find the distribution folder +For /D %%D in ("PSMoveService_*") Do ( + set "DISTRIBUTION_LABEL=%%~fD" +) +if NOT DEFINED DISTRIBUTION_LABEL ( + echo "Failed to find the distribution folder generated from the builds!" + goto failure +) + +:: Create the distribution zip from the Release|x64 folder +set "DISTRIBUTION_FOLDER=%DISTRIBUTION_LABEL%\Win64\Release" +set "DISTRIBUTION_ZIP=%DISTRIBUTION_LABEL%.zip" +echo "Creating distribution zip (%DISTRIBUTION_ZIP%) from: %DISTRIBUTION_FOLDER%" +powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('%DISTRIBUTION_FOLDER%', '%DISTRIBUTION_ZIP%'); }" +IF %ERRORLEVEL% NEQ 0 ( + echo "Failed to generate the distribution zip!" + goto failure +) + +echo "Successfully created distribution zip: %DISTRIBUTION_ZIP%" +pause +EXIT /B 0 + +:failure +pause +EXIT /B 1 \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a68d3edc..e01cda9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,8 @@ include(cmake/Environment.cmake) include(cmake/Version.cmake) set(PSM_PROJECT_NAME "PSMoveService_${PSM_VERSION_STRING}") +set(PSM_DEBUG_INSTALL_PATH "${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/Debug") +set(PSM_RELEASE_INSTALL_PATH "${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/Release") include(cmake/ThirdParty.cmake) diff --git a/GenerateProjectFiles_Win32.bat b/GenerateProjectFiles_Win32.bat index 26f960f4..f7c16bb2 100644 --- a/GenerateProjectFiles_Win32.bat +++ b/GenerateProjectFiles_Win32.bat @@ -6,4 +6,13 @@ cd build echo "Rebuilding PSMoveService Project files..." cmake .. -G "Visual Studio 14 2015" -DBOOST_ROOT=%BOOST_ROOT_PATH% -DBOOST_LIBRARYDIR=%BOOST_LIB_PATH% -DPROTOBUF_SRC_ROOT_FOLDER=..\thirdparty\protobuf -pause \ No newline at end of file +IF %ERRORLEVEL% NEQ 0 ( + echo "Error generating PSMoveService 32-bit project files" + goto failure +) + +EXIT /B 0 + +:failure +pause +EXIT /B 1 \ No newline at end of file diff --git a/GenerateProjectFiles_X64.bat b/GenerateProjectFiles_X64.bat index cfb0218a..7b8eb16f 100644 --- a/GenerateProjectFiles_X64.bat +++ b/GenerateProjectFiles_X64.bat @@ -6,4 +6,13 @@ cd build echo "Rebuilding PSMoveService x64 Project files..." cmake .. -G "Visual Studio 14 2015 Win64" -DOpenCV_DIR=%OPENCV_BUILD_PATH% -DBOOST_ROOT=%BOOST_ROOT_PATH% -DBOOST_LIBRARYDIR=%BOOST_LIB_PATH% -DPROTOBUF_SRC_ROOT_FOLDER=..\thirdparty\protobuf -pause \ No newline at end of file +IF %ERRORLEVEL% NEQ 0 ( + echo "Error generating PSMoveService 64-bit project files" + goto failure +) + +EXIT /B 0 + +:failure +pause +EXIT /B 1 \ No newline at end of file diff --git a/InitialSetup_Win32.bat b/InitialSetup_Win32.bat index edb32c4c..8648a369 100644 --- a/InitialSetup_Win32.bat +++ b/InitialSetup_Win32.bat @@ -13,9 +13,11 @@ del /f /s /q deps > nul rmdir /s /q deps ) + ::Select the path to the root Boost folder +if DEFINED BOOST_ROOT_PATH (goto build_thirdparty) set "psCommand="(new-object -COM 'Shell.Application')^ -.BrowseForFolder(0,'Please select the root folder for Boost (ex: c:\local\boost_1_61_0).',0,0).self.path"" +.BrowseForFolder(0,'Please select the root folder for 32-bit Boost (ex: c:\local\boost_1_61_0).',0,0).self.path"" for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "BOOST_ROOT_PATH=%%I" if NOT DEFINED BOOST_ROOT_PATH (goto failure) @@ -25,8 +27,14 @@ echo @echo off >> SetBuildVars_Win32.bat echo set BOOST_ROOT_PATH=%BOOST_ROOT_PATH% >> SetBuildVars_Win32.bat echo set BOOST_LIB_PATH=%BOOST_ROOT_PATH%/lib32-msvc-14.0 >> SetBuildVars_Win32.bat +:build_thirdparty + :: Add MSVC build tools to the path call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 +IF %ERRORLEVEL% NEQ 0 ( + echo "Unable to initialize 32-bit visual studio build environment" + goto failure +) :: Compile the DEBUG|Win32 and RELEASE|Win32 builds of protobuf echo "Creating protobuf project files..." @@ -37,18 +45,38 @@ mkdir vsprojects pushd vsprojects cmake -G "Visual Studio 14 2015" -Dprotobuf_DEBUG_POSTFIX="" -Dprotobuf_BUILD_TESTS=OFF ../cmake echo "Building protobuf DEBUG|Win32" +IF %ERRORLEVEL% NEQ 0 ( + echo "Error generating protobuf project files!" + goto failure +) MSBuild.exe protobuf.sln /p:configuration=DEBUG /t:Clean;Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building protobuf DEBUG|Win32!" + goto failure +) echo "Building protobuf RELEASE|Win32" MSBuild.exe protobuf.sln /p:configuration=RELEASE /t:Clean;Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building protobuf Release|Win64!" + goto failure +) popd popd :: Compile the DEBUG|Win32 and RELEASE|Win32 builds of libusb pushd thirdparty\libusb\msvc\ echo "Building libusb DEBUG|Win32..." -MSBuild.exe libusb_2015.sln /p:configuration=DEBUG /p:Platform="Win32" /t:Clean;Build +MSBuild.exe libusb_2015.sln /p:configuration=DEBUG /p:Platform="Win32" /t:Clean;Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building libusb DEBUG|Win32!" + goto failure +) echo "Building libusb RELEASE|Win32..." MSBuild.exe libusb_2015.sln /p:configuration=RELEASE /p:Platform="Win32" /t:Clean;Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building libusb RELEASE|Win32!" + goto failure +) popd :: Compile the RELEASE|Win32 build of SDL2 @@ -59,20 +87,34 @@ rmdir /s /q build mkdir build pushd build cmake .. -G "Visual Studio 14 2015" -DDIRECTX=OFF -DDIRECTX=OFF -DSDL_STATIC=ON -DFORCE_STATIC_VCRT=ON -DEXTRA_CFLAGS="-MT -Z7 -DSDL_MAIN_HANDLED -DWIN32 -DNDEBUG -D_CRT_SECURE_NO_WARNINGS -DHAVE_LIBC -D_USE_MATH_DEFINES +IF %ERRORLEVEL% NEQ 0 ( + echo "Error generating SDL2 project files!" + goto failure +) + echo "Building SDL2 Release|Win32..." MSBuild.exe SDL2.sln /p:configuration=RELEASE /p:Platform="Win32" /t:Clean -MSBuild.exe SDL2-static.vcxproj /p:configuration=RELEASE /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building SDL2 Release|Win32!" + goto failure +) +MSBuild.exe SDL2-static.vcxproj /p:configuration=RELEASE /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building SDL2-static Release|Win32!" + goto failure +) MSBuild.exe SDL2main.vcxproj /p:configuration=RELEASE /p:Platform="Win32" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building SDL2main Release|Win32!" + goto failure +) popd popd :: Generate the project files for PSMoveService -call GenerateProjectFiles_Win32.bat -pause -goto exit +call GenerateProjectFiles_Win32.bat || goto failure +EXIT /B 0 :failure -goto exit - -:exit -endlocal +pause +EXIT /B 1 \ No newline at end of file diff --git a/InitialSetup_X64.bat b/InitialSetup_X64.bat index f41c876f..6f158c95 100644 --- a/InitialSetup_X64.bat +++ b/InitialSetup_X64.bat @@ -14,6 +14,7 @@ rmdir /s /q deps ) ::Select the path to the root Boost folder +if DEFINED BOOST_ROOT_PATH (goto build_thirdparty) set "psCommand="(new-object -COM 'Shell.Application')^ .BrowseForFolder(0,'Please select the root folder for 64-bit Boost (ex: c:\local\boost_1_61_0).',0,0).self.path"" for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "BOOST_ROOT_PATH=%%I" @@ -25,8 +26,14 @@ echo @echo off >> SetBuildVars_x64.bat echo set BOOST_ROOT_PATH=%BOOST_ROOT_PATH% >> SetBuildVars_x64.bat echo set BOOST_LIB_PATH=%BOOST_ROOT_PATH%/lib64-msvc-14.0 >> SetBuildVars_x64.bat +:build_thirdparty + :: Add MSVC build tools to the path call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 +IF %ERRORLEVEL% NEQ 0 ( + echo "Unable to initialize 64-bit visual studio build environment" + goto failure +) :: Compile the DEBUG|x64 and RELEASE|x64 builds of protobuf echo "Creating protobuf project files..." @@ -36,14 +43,28 @@ rmdir /s /q vsprojects mkdir vsprojects pushd vsprojects cmake -G "Visual Studio 14 2015 Win64" -Dprotobuf_DEBUG_POSTFIX="" -Dprotobuf_BUILD_TESTS=OFF ../cmake +IF %ERRORLEVEL% NEQ 0 ( + echo "Error generating protobuf project files!" + goto failure +) + echo "Building protobuf DEBUG|x64" MSBuild.exe protobuf.sln /p:configuration=DEBUG /t:Clean;Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building protobuf DEBUG|x64!" + goto failure +) :: Work around for issue in 64-bit builds, FindProtobuf modules expects files in x64\Debug -copy Debug\*.* x64\Debug +copy Debug\*.* x64\Debug || goto failure + echo "Building protobuf RELEASE|x64" MSBuild.exe protobuf.sln /p:configuration=RELEASE /t:Clean;Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building protobuf RELEASE|x64!" + goto failure +) :: Work around for issue in 64-bit builds, FindProtobuf modules expects files in x64\Release -copy Release\*.* x64\Release +copy Release\*.* x64\Release || goto failure popd popd @@ -51,8 +72,16 @@ popd pushd thirdparty\libusb\msvc\ echo "Building libusb DEBUG|x64..." MSBuild.exe libusb_2015.sln /tv:14.0 /p:configuration=DEBUG /p:Platform="x64" /t:Clean;Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building libusb DEBUG|x64!" + goto failure +) echo "Building libusb RELEASE|x64..." MSBuild.exe libusb_2015.sln /tv:14.0 /p:configuration=RELEASE /p:Platform="x64" /t:Clean;Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building libusb RELEASE|x64!" + goto failure +) popd :: Compile the RELEASE|x64 build of SDL2 @@ -63,20 +92,34 @@ rmdir /s /q build mkdir build pushd build cmake .. -G "Visual Studio 14 2015 Win64" -DDIRECTX=OFF -DDIRECTX=OFF -DSDL_STATIC=ON -DFORCE_STATIC_VCRT=ON -DEXTRA_CFLAGS="-MT -Z7 -DSDL_MAIN_HANDLED -DWIN32 -DNDEBUG -D_CRT_SECURE_NO_WARNINGS -DHAVE_LIBC -D_USE_MATH_DEFINES +IF %ERRORLEVEL% NEQ 0 ( + echo "Error generating SDL2 project files!" + goto failure +) + echo "Building SDL2 Release|x64..." MSBuild.exe SDL2.sln /p:configuration=RELEASE /p:Platform="x64" /t:Clean +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building SDL2 Release|x64!" + goto failure +) MSBuild.exe SDL2-static.vcxproj /p:configuration=RELEASE /p:Platform="x64" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building SDL2-static Release|x64!" + goto failure +) MSBuild.exe SDL2main.vcxproj /p:configuration=RELEASE /p:Platform="x64" /t:Build +IF %ERRORLEVEL% NEQ 0 ( + echo "Error building SDL2main Release|x64!" + goto failure +) popd popd :: Generate the project files for PSMoveService -call GenerateProjectFiles_X64.bat -pause -goto exit +call GenerateProjectFiles_X64.bat || goto failure +EXIT /B 0 :failure -goto exit - -:exit -endlocal +pause +EXIT /B 1 diff --git a/src/psmoveclient/CMakeLists.txt b/src/psmoveclient/CMakeLists.txt index d1853419..288753f5 100644 --- a/src/psmoveclient/CMakeLists.txt +++ b/src/psmoveclient/CMakeLists.txt @@ -71,10 +71,17 @@ set_target_properties(PSMoveClient_CAPI PROPERTIES C_VISIBILITY_PRESET hidden) # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS PSMoveClient_CAPI - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - PUBLIC_HEADER DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/include) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + PUBLIC_HEADER DESTINATION ${PSM_DEBUG_INSTALL_PATH}/include) + install(TARGETS PSMoveClient_CAPI + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + PUBLIC_HEADER DESTINATION ${PSM_RELEASE_INSTALL_PATH}/include) ELSE() #Linux/Darwin install(TARGETS PSMoveClient_CAPI RUNTIME DESTINATION bin diff --git a/src/psmoveconfigtool/CMakeLists.txt b/src/psmoveconfigtool/CMakeLists.txt index 6056468b..c8dd52f5 100644 --- a/src/psmoveconfigtool/CMakeLists.txt +++ b/src/psmoveconfigtool/CMakeLists.txt @@ -70,14 +70,30 @@ add_custom_command(TARGET PSMoveConfigTool POST_BUILD # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS PSMoveConfigTool - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets/ - DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin/assets + CONFIGURATIONS Debug + DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin/assets FILES_MATCHING PATTERN "*.ttf" PATTERN "*.jpg") install(DIRECTORY ${OPENVR_BINARIES_DIR}/ - DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - FILES_MATCHING PATTERN "*.dll" PATTERN "*.pdb") + CONFIGURATIONS Debug + DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + FILES_MATCHING PATTERN "*.dll" PATTERN "*.pdb") + install(TARGETS PSMoveConfigTool + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets/ + CONFIGURATIONS Release + DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin/assets + FILES_MATCHING PATTERN "*.ttf" PATTERN "*.jpg") + install(DIRECTORY ${OPENVR_BINARIES_DIR}/ + CONFIGURATIONS Release + DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + FILES_MATCHING PATTERN "*.dll" PATTERN "*.pdb") ELSE() #Linux/Darwin ENDIF() diff --git a/src/psmoveprotocol/CMakeLists.txt b/src/psmoveprotocol/CMakeLists.txt index 312de8de..3cb35952 100644 --- a/src/psmoveprotocol/CMakeLists.txt +++ b/src/psmoveprotocol/CMakeLists.txt @@ -28,7 +28,11 @@ set_target_properties(PSMoveProtocol PROPERTIES # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(FILES ProtocolVersion.h SharedConstants.h - DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/include) + CONFIGURATIONS Debug + DESTINATION ${PSM_DEBUG_INSTALL_PATH}/include) + install(FILES ProtocolVersion.h SharedConstants.h + CONFIGURATIONS Release + DESTINATION ${PSM_RELEASE_INSTALL_PATH}/include) ELSE() #Linux/Darwin install(FILES ProtocolVersion.h SharedConstants.h DESTINATION include) diff --git a/src/psmoveservice/CMakeLists.txt b/src/psmoveservice/CMakeLists.txt index 10a4c42e..7c09fdcc 100644 --- a/src/psmoveservice/CMakeLists.txt +++ b/src/psmoveservice/CMakeLists.txt @@ -219,13 +219,24 @@ ENDIF() # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS PSMoveService - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) + install(TARGETS PSMoveService + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) IF(${ISWIN32}) install(DIRECTORY "${ROOT_DIR}/thirdparty/CLEYE/x86/bin/" - DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}//Win32/bin + CONFIGURATIONS Debug + DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin FILES_MATCHING PATTERN "*.dll") + install(DIRECTORY "${ROOT_DIR}/thirdparty/CLEYE/x86/bin/" + CONFIGURATIONS Release + DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + FILES_MATCHING PATTERN "*.dll") ENDIF()#ISWIN32 ELSE() #Linux/Darwin ENDIF() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 461e3dbc..9e632896 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -85,13 +85,25 @@ ENDIF() # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS test_camera - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) install(TARGETS test_camera_parallel - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) + install(TARGETS test_camera + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) + install(TARGETS test_camera_parallel + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) ELSE() #Linux/Darwin ENDIF() @@ -196,9 +208,15 @@ SET_TARGET_PROPERTIES(test_psmove_controller PROPERTIES FOLDER Test) # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS test_psmove_controller - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) + install(TARGETS test_psmove_controller + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) ELSE() #Linux/Darwin ENDIF() @@ -301,9 +319,15 @@ SET_TARGET_PROPERTIES(test_navi_controller PROPERTIES FOLDER Test) # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS test_navi_controller - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) + install(TARGETS test_navi_controller + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) ELSE() #Linux/Darwin ENDIF() @@ -415,9 +439,15 @@ SET_TARGET_PROPERTIES(test_ds4_controller PROPERTIES FOLDER Test) # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS test_ds4_controller - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) + install(TARGETS test_ds4_controller + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) ELSE() #Linux/Darwin ENDIF() @@ -433,9 +463,15 @@ SET_TARGET_PROPERTIES(test_console_CAPI PROPERTIES FOLDER Test) # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS test_console_CAPI - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) +install(TARGETS test_console_CAPI + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) ELSE() #Linux/Darwin ENDIF() @@ -484,9 +520,15 @@ SET_TARGET_PROPERTIES(test_kalman_filter PROPERTIES FOLDER Test) # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS test_kalman_filter - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) + install(TARGETS test_kalman_filter + CONFIGURATIONS Release + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) ELSE() #Linux/Darwin ENDIF() @@ -519,9 +561,15 @@ SET_TARGET_PROPERTIES(unit_test_suite PROPERTIES FOLDER Test) # Install IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") install(TARGETS unit_test_suite - RUNTIME DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/bin - LIBRARY DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib - ARCHIVE DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/lib) + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_DEBUG_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_DEBUG_INSTALL_PATH}/lib) + install(TARGETS unit_test_suite + CONFIGURATIONS Debug + RUNTIME DESTINATION ${PSM_RELEASE_INSTALL_PATH}/bin + LIBRARY DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib + ARCHIVE DESTINATION ${PSM_RELEASE_INSTALL_PATH}/lib) ELSE() #Linux/Darwin ENDIF()