Skip to content

Commit

Permalink
Rely on CMAKE_CURRENT_LIST_DIR to make possible project use as a subm…
Browse files Browse the repository at this point in the history
…odule
  • Loading branch information
Gennady Pospelov committed Jun 26, 2020
1 parent 5d0484a commit 056a914
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ option(MVVM_DISCOVER_TESTS "Auto discover tests and add to ctest, otherwise will
option(MVVM_ENABLE_FILESYSTEM "Enable <filesystem> (requires modern compiler), otherwise rely on Qt" ON)
option(MVVM_BUILD_EXAMPLES "Build user examples" ON)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/modules)
include(configuration)

add_subdirectory(source)
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ message(STATUS " Qt5 Includes : ${Qt5Widgets_INCLUDE_DIRS}")
# Generating config files
# -----------------------------------------------------------------------------

configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/testconfig.h.in ${MVVM_AUTOGEN_DIR}/testconfig.h @ONLY)
configure_file(${CMAKE_CURRENT_LIST_DIR}/../scripts/testconfig.h.in ${MVVM_AUTOGEN_DIR}/testconfig.h @ONLY)

if (MVVM_BUMP_VERSION)
configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/mvvm_version.h.in ${CMAKE_SOURCE_DIR}/source/libmvvm_model/mvvm/core/version.h @ONLY)
configure_file(${CMAKE_CURRENT_LIST_DIR}/../scripts/mvvm_version.h.in ${CMAKE_SOURCE_DIR}/source/libmvvm_model/mvvm/core/version.h @ONLY)
endif()

# -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/installation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export(PACKAGE MVVM)
include(CMakePackageConfigHelpers)

# to use in the build tree
configure_package_config_file(${CMAKE_SOURCE_DIR}/cmake/scripts/MVVMConfig.cmake.in
configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/../scripts/MVVMConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/MVVMConfig.cmake
INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
)
Expand Down

0 comments on commit 056a914

Please sign in to comment.