Skip to content

Commit

Permalink
replace CMAKE_SOURCE_DIR with PROJECT_SOURCE_DIR to fix ALPSCore#619
Browse files Browse the repository at this point in the history
  • Loading branch information
wistaria committed Nov 21, 2022
1 parent 6a10a2e commit bc75bdc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ project(ALPSCore C CXX)
# set(CMAKE_CXX_STANDARD 11)

# include cmake scripts from common/cmake directory
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/./common/cmake)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/common/cmake)

include(ALPSCommonModuleDefinitions)

Expand Down Expand Up @@ -72,9 +72,9 @@ endforeach()

#Doxygen building is a function to prevent namespace damage
function(build_documentation_)
set(DOXYFILE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/common/doc")
set(DOXYFILE_SOURCE_DIR "${PROJECT_SOURCE_DIR}/common/doc")
message(STATUS "Building documentation for sources in ${DOXYFILE_EXTRA_SOURCES}")
set(DOXYFILE_IN "${CMAKE_SOURCE_DIR}/common/doc/Doxyfile.in")
set(DOXYFILE_IN "${PROJECT_SOURCE_DIR}/common/doc/Doxyfile.in")
set(CMAKE_PROJECT_NAME "ALPSCore reference") # to provide name for the documentation
include(UseDoxygen)
unset(CMAKE_PROJECT_NAME)
Expand All @@ -91,5 +91,5 @@ gen_cfg_main()
# Create the main *.hpp config file
gen_main_hpp_config()
# create module file for lmod manager
configure_file("${CMAKE_SOURCE_DIR}/common/misc/alpscore.lmod.in" "${CMAKE_BINARY_DIR}/alpscore.lmod")
configure_file("${PROJECT_SOURCE_DIR}/common/misc/alpscore.lmod.in" "${CMAKE_BINARY_DIR}/alpscore.lmod")

4 changes: 2 additions & 2 deletions common/cmake/ALPSCommonModuleDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ endif()

# add includes and libs for each module
macro(alps_add_module module module_path)
set(${module}_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/${module_path}/include ${CMAKE_BINARY_DIR}/${module_path}/include)
set(${module}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/${module_path}/include ${CMAKE_BINARY_DIR}/${module_path}/include)
set(${module}_LIBRARIES ${module})
endmacro(alps_add_module)

Expand Down Expand Up @@ -284,7 +284,7 @@ macro(gen_documentation)
endmacro(gen_documentation)

function(gen_main_hpp_config)
configure_file("${CMAKE_SOURCE_DIR}/utilities/include/config.hpp.in" "${CMAKE_BINARY_DIR}/utilities/include/alps/config.hpp")
configure_file("${PROJECT_SOURCE_DIR}/utilities/include/config.hpp.in" "${CMAKE_BINARY_DIR}/utilities/include/alps/config.hpp")
install(FILES "${CMAKE_BINARY_DIR}/utilities/include/alps/config.hpp" DESTINATION include/alps)
endfunction(gen_main_hpp_config)

Expand Down
2 changes: 1 addition & 1 deletion common/cmake/ALPSEnableTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ endfunction()
# enable testing with gtest - fetch it if needed
if (NOT tests_are_already_enabled)
if (ALPS_GLOBAL_BUILD)
set(gtest_root "${CMAKE_SOURCE_DIR}/common/deps/gtest-1.7.0")
set(gtest_root "${PROJECT_SOURCE_DIR}/common/deps/gtest-1.7.0")
else(ALPS_GLOBAL_BUILD)
set(gtest_root "${PROJECT_SOURCE_DIR}/../common/deps/gtest-1.7.0")
endif(ALPS_GLOBAL_BUILD)
Expand Down
2 changes: 1 addition & 1 deletion gf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project (alps-gf CXX)
message ("\nALPSCore module : ${PROJECT_NAME}\n")

# find additional cmake module in cmake dir
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../common/cmake)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../common/cmake)
# add common definitions, if being configured independently
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
include(ALPSCommonModuleDefinitions)
Expand Down

0 comments on commit bc75bdc

Please sign in to comment.