Fix build with cmake Visual Studio generator

Fixes #156
This commit is contained in:
Sergio Martins
2021-02-02 23:02:04 +00:00
parent a6b9a82e9c
commit 2c5cf77cf2
4 changed files with 30 additions and 16 deletions

6
.gitignore vendored
View File

@@ -58,3 +58,9 @@ kddockwidgets_minimal_example
/CMakeDoxygenDefaults.cmake /CMakeDoxygenDefaults.cmake
/Testing /Testing
/layout_tst* /layout_tst*
/x64
/src/kddockwidgets_version.h
*.vcxproj*
*.sln
*.dir

View File

@@ -191,15 +191,17 @@ if(${PROJECT_NAME}_PYTHON_BINDINGS)
endif() endif()
# Generate .pri file for qmake users # Generate .pri file for qmake users
include(ECMGeneratePriFile) if (NOT CMAKE_CONFIGURATION_TYPES) # Not working with VS generator
set(PROJECT_VERSION_STRING ${${PROJECT_NAME}_VERSION}) include(ECMGeneratePriFile)
ecm_generate_pri_file(BASE_NAME KDDockWidgets set(PROJECT_VERSION_STRING ${${PROJECT_NAME}_VERSION})
LIB_NAME kddockwidgets ecm_generate_pri_file(BASE_NAME KDDockWidgets
DEPS ${${PROJECT_NAME}_DEPS} LIB_NAME kddockwidgets
FILENAME_VAR pri_filename DEPS ${${PROJECT_NAME}_DEPS}
INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR} FILENAME_VAR pri_filename
) INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) )
install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
endif()
install(FILES LICENSE.txt README.md DESTINATION ${INSTALL_DOC_DIR}) install(FILES LICENSE.txt README.md DESTINATION ${INSTALL_DOC_DIR})
install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR}) install(DIRECTORY LICENSES DESTINATION ${INSTALL_DOC_DIR})

View File

@@ -14,6 +14,7 @@
- Fixed bug where last tab index position wouldn't be remembered in case user - Fixed bug where last tab index position wouldn't be remembered in case user
had manually reordered tabs (#154) had manually reordered tabs (#154)
- Fixed crash when hosting a QQuickWidget (#150) - Fixed crash when hosting a QQuickWidget (#150)
- Fixed CMake Visual Studio generator not working
* v1.2.1 (unreleased) * v1.2.1 (unreleased)
- Support for resizing dock widgets when they are in overlay/popup mode (autohide/sidebar feature) - Support for resizing dock widgets when they are in overlay/popup mode (autohide/sidebar feature)

View File

@@ -266,13 +266,18 @@ set_target_properties(kddockwidgets PROPERTIES
#version libraries on Windows #version libraries on Windows
if(WIN32) if(WIN32)
set(postfix ${${PROJECT_NAME}_VERSION_MAJOR}) if (CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE) set(postfix ${${PROJECT_NAME}_VERSION_MAJOR})
if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG") string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
string(CONCAT postfix ${postfix} "d") if(${UPPER_BUILD_TYPE} MATCHES "^DEBUG")
set_target_properties(kddockwidgets PROPERTIES DEBUG_POSTFIX ${postfix}) string(CONCAT postfix ${postfix} "d")
else() set_target_properties(kddockwidgets PROPERTIES DEBUG_POSTFIX ${postfix})
set_target_properties(kddockwidgets PROPERTIES ${UPPER_BUILD_TYPE}_POSTFIX ${postfix}) else()
set_target_properties(kddockwidgets PROPERTIES ${UPPER_BUILD_TYPE}_POSTFIX ${postfix})
endif()
elseif(CMAKE_CONFIGURATION_TYPES)
# Visual Studio generator
set_target_properties(kddockwidgets PROPERTIES DEBUG_POSTFIX d)
endif() endif()
endif() endif()