diff --git a/CMakeLists.txt b/CMakeLists.txt index 592877fdd9..2cd941c1c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,9 @@ include(jkqtplotter_common_compilersettings) # include Qt with appropriate options to build this lib include(jkqtplotter_common_qtsettings) +# additionnal common macros +include(jkqtplotter_macros) + # now add subdirectories with the library code ... diff --git a/cmake/jkqtplotter_macros.cmake b/cmake/jkqtplotter_macros.cmake new file mode 100644 index 0000000000..c47b5a6da1 --- /dev/null +++ b/cmake/jkqtplotter_macros.cmake @@ -0,0 +1,22 @@ +function(jkqtplotter_installlibrary lib_name libIncludeSubdir) + install(TARGETS ${lib_name} EXPORT ${lib_name}_TARGETS + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} + ) + if(WIN32 AND MSVC AND (NOT MSVC_VERSION LESS 1600) AND (NOT CMAKE_VERSION VERSION_LESS "3.1")) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) + endif() + set(JKQTP_CURRENT_TARGET_FILENAME "${lib_name}Targets.cmake") + configure_file(LibTarget.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake" @ONLY) + install(EXPORT ${lib_name}_TARGETS + FILE "${JKQTP_CURRENT_TARGET_FILENAME}" + DESTINATION lib/cmake + ) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" + DESTINATION lib/cmake ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake" + DESTINATION lib/cmake ) +endfunction(jkqtplotter_installlibrary) diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index cfc3acc8d1..ebad714ee2 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -18,6 +18,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
  • CLEANUP (BREAKING) of library structure
  • NEW: Using precompiled headers in CMake-build to speed up build times
  • NEW/BREAKING: split jkqtcommon into basic tools and jkqtcommon_statistics_and_math for advanced math tools not used by all libs
  • +
  • NEW: When using a MSVC compiler, the generated PDB files are installed to \c CMAKE_INSTALL_PREFIX/bin/
  • JKQTPlotter: