Commit 95509630 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Improve runtime output folder for windows builds and installs

parent 4ae437a9
......@@ -6,6 +6,12 @@ project (
LANGUAGES CXX
)
if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY AND WIN32)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
endif ()
include (GNUInstallDirs)
include (CMakeDependentOption)
include (CMakePackageConfigHelpers)
......
......@@ -18,6 +18,25 @@ CPMAddPackage (
GITHUB_REPOSITORY TheLartians/PackageProject.cmake
)
if (PackageProject.cmake_ADDED)
find_package (Git)
execute_process (
COMMAND ${GIT_EXECUTABLE} apply --check "${CMAKE_CURRENT_LIST_DIR}/patches/change_install_dir.patch"
RESULT_VARIABLE patch_ok
WORKING_DIRECTORY ${PackageProject.cmake_SOURCE_DIR}
)
if (${patch_ok} STREQUAL "0")
execute_process (
COMMAND ${GIT_EXECUTABLE} apply --whitespace=fix
"${CMAKE_CURRENT_LIST_DIR}/patches/change_install_dir.patch"
RESULT_VARIABLE patch_ok
WORKING_DIRECTORY ${PackageProject.cmake_SOURCE_DIR}
)
endif ()
endif ()
CPMAddPackage (
NAME Format.cmake
VERSION 1.7.2
......
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 125d673..998cf1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,7 +126,7 @@ function(packageProject)
NAMELINK_COMPONENT "${PROJECT_NAME}_Development"
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}${PROJECT_VERSION_SUFFIX}
COMPONENT "${PROJECT_NAME}_Development"
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME}${PROJECT_VERSION_SUFFIX}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}$<IF:$<PLATFORM_ID:UNIX>,/${PROJECT_NAME}${PROJECT_VERSION_SUFFIX},>
COMPONENT "${PROJECT_NAME}_Runtime"
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME}${PROJECT_VERSION_SUFFIX}
COMPONENT "${PROJECT_NAME}_Runtime"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment