Skip to content

Commit

Permalink
Rename qwt_setup.cmake file to QwtConfig.cmake. Some simplifying.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 11, 2024
1 parent 81561f2 commit eef6b5d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 41 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif()
find_package(Qt6 REQUIRED COMPONENTS Widgets Core Test)
qt_standard_project_setup()

include(qwt_setup.cmake)
include(QwtConfig.cmake)

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
Expand Down
33 changes: 33 additions & 0 deletions QwtConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
if(MSVC)
set(QWT_BUILD_COMMAND "nmake")
else()
set(QWT_BUILD_COMMAND ${CMAKE_MAKE_PROGRAM})
endif()

set(PATCH_MARKER "${CMAKE_CURRENT_BINARY_DIR}/qwt_patch_applied.txt")
if (NOT EXISTS "${PATCH_MARKER}")
set(QWT_PATCH_FILE ${CMAKE_CURRENT_SOURCE_DIR}/qwt.patch)
message(STATUS "Using QWT_PATCH_FILE=${QWT_PATCH_FILE}")
file(TOUCH ${PATCH_MARKER})
else()
set(QWT_PATCH_FILE ${PATCH_MARKER})
message(STATUS "Qwt patch already applied. Using empty file as QWT_PATCH_FILE=${PATCH_MARKER}")
endif()

configure_file(CMakeLists.txt.qwt qwt/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qwt)
execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qwt)

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qwt/install)
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/qwt/qwt/src/qwt-build/lib DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/qwt/install)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qwt/install/include)
file(GLOB QWT_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/qwt/qwt/src/qwt/src/*.h")
file(COPY ${QWT_HEADERS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/qwt/install/include)
set(QWT_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR}/qwt/install/include)
set(QWT_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/qwt/install/lib)

message(STATUS "Using QWT_INCLUDE_PATH ${QWT_INCLUDE_PATH}")
message(STATUS "Using QWT_BINARY_PATH ${QWT_BINARY_PATH}")

include_directories(${QWT_INCLUDE_PATH})
link_directories(${QWT_BINARY_PATH})
40 changes: 0 additions & 40 deletions qwt_setup.cmake

This file was deleted.

0 comments on commit eef6b5d

Please sign in to comment.