From a2adb293b165d33ea845573a9c870ef6b3398836 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Fri, 15 Sep 2017 17:48:22 -0400 Subject: [PATCH 1/7] corrected use of directory variable --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bbb1d29..557d891 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,7 +13,7 @@ find_package(Qt5Widgets 5.2 REQUIRED) message(STATUS "Found Qt version ${Qt5Widgets_VERSION_STRING}") if(QACCORDION_EXTERNAL) - set(base_path ${CMAKE_SOURCE_DIR}/external/qaccordion/) + set(base_path ${PROJECT_SOURCE_DIR}/external/qaccordion/) message(STATUS "Using qAccordion external config with base path: ${base_path}") # provide the current build path to parent scope. add this to include @@ -23,7 +23,7 @@ if(QACCORDION_EXTERNAL) PARENT_SCOPE ) else() - set(base_path ${CMAKE_SOURCE_DIR}) + set(base_path ${PROJECT_SOURCE_DIR}) endif() # configure a header file to pass some of the CMake settings From a9a8fa8f0cb932a14030ee4887ff0b6732dcbcb1 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Sat, 16 Sep 2017 13:35:59 -0400 Subject: [PATCH 2/7] requiring CMake 3.4.3 only on windows --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79b996f..fd1645a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,17 @@ -cmake_minimum_required(VERSION 3.6 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) project(qAccordion VERSION 0.2.2) option(QACCORDION_BUILD_TESTER OFF) option(QACCORDION_EXTERNAL OFF) -# let cmake handle all the export business on windows -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +if(WIN32) + if(${CMAKE_VERSION} VERSION_LESS 3.4.3) + message(FATAL_ERROR "Windows builds require CMake 3.4.3 or greator") + else(${CMAKE_VERSION} VERSION_LESS 3.4.3) + # let cmake handle all the export business on windows + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + endif(${CMAKE_VERSION} VERSION_LESS 3.4.3) +endif(WIN32) add_subdirectory(demo) add_subdirectory(include/qaccordion) From 93ad878b33f4a7c9c62e06636d531aecacb9cf41 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Sat, 16 Sep 2017 13:47:43 -0400 Subject: [PATCH 3/7] installing export header only on windows --- src/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 557d891..a23174d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -79,6 +79,7 @@ install(FILES ${base_path}/include/qaccordion/qaccordion.hpp DESTINATION include/qaccordion) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qaccordion_config.hpp DESTINATION include/qaccordion) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qaccordion_export.hpp - DESTINATION include/qaccordion) - +if(WIN32) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qaccordion_export.hpp + DESTINATION include/qaccordion) +endif(WIN32) From 08892b1be6fc29b208a2b31a8d7fa9625968be77 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Wed, 4 Oct 2017 21:27:07 -0400 Subject: [PATCH 4/7] using QACCORDING_EXPORT macro --- include/qaccordion/qaccordion.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/qaccordion/qaccordion.hpp b/include/qaccordion/qaccordion.hpp index 456aa90..3421f50 100644 --- a/include/qaccordion/qaccordion.hpp +++ b/include/qaccordion/qaccordion.hpp @@ -34,6 +34,14 @@ #include "qaccordion_config.hpp" +#ifdef _WIN32 +#include "qaccordion_exports.hpp" +#endif + +#ifndef QACCORDION_EXPORT +#define QACCORDION_EXPORT +#endif + #include "contentpane.hpp" class ContentPane; @@ -65,7 +73,7 @@ class ContentPane; * Currently Headers have to be unique * */ -class QAccordion : public QWidget +class QACCORDION_EXPORT QAccordion : public QWidget { Q_OBJECT public: From 81a5e421620e6fec8aaa7b207d552344e36417a5 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Wed, 4 Oct 2017 21:28:08 -0400 Subject: [PATCH 5/7] generating export header --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a23174d..e835f8d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,6 +49,10 @@ add_library(qaccordion SHARED ${QACCORDION_SOURCE} ${ICON_RESOURCE_ADDED}) +set (CMAKE_INCLUDE_CURRENT_DIR ON) +include(GenerateExportHeader) +generate_export_header(qaccordion EXPORT_FILE_NAME "qaccordion_exports.hpp") + target_link_libraries(qaccordion Qt5::Widgets) set_property(TARGET qaccordion PROPERTY CXX_STANDARD_REQUIRED ON) From 9104627eee6ea60bee061f1831d8800fd6427ba1 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Thu, 5 Oct 2017 15:31:12 -0400 Subject: [PATCH 6/7] fixed header path --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e835f8d..d00f196 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -84,6 +84,6 @@ install(FILES ${base_path}/include/qaccordion/qaccordion.hpp install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qaccordion_config.hpp DESTINATION include/qaccordion) if(WIN32) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qaccordion_export.hpp + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qaccordion_exports.hpp DESTINATION include/qaccordion) endif(WIN32) From 773fdc1ef762bd79f09c0b1086a89230844f155d Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Thu, 5 Oct 2017 16:51:40 -0400 Subject: [PATCH 7/7] using appropriate library install paths --- src/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d00f196..0678ecc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -74,7 +74,10 @@ if(QACCORDION_BUILD_DEMO) set_property(TARGET accordion_demo PROPERTY CXX_STANDARD 14) endif() -install(TARGETS qaccordion DESTINATION lib) +install(TARGETS qaccordion + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) install(FILES ${base_path}/include/qaccordion/clickableframe.hpp DESTINATION include/qaccordion) install(FILES ${base_path}/include/qaccordion/contentpane.hpp