Skip to content

Commit

Permalink
Allow building out-of-tree modules per-cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Aug 17, 2023
1 parent e4d1a38 commit 1eb9006
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/cmake/UseIMP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ function(imp_build_module sourcedir)
set(modname "")
endif()

set(IMP_PER_CPP_COMPILATION "" CACHE STRING "A colon-separated list of modules to build one .cpp at a time, or ALL to do this for all modules.")

# Use same compiler flags as IMP itself
include(${IMP_MODULES_DIR}/IMPFindC++11.cmake)
include(${IMP_MODULES_DIR}/IMPFindCompilerFlags.cmake)
Expand Down Expand Up @@ -100,6 +102,17 @@ function(imp_build_module sourcedir)
set(IMP_TEST_SETUP )
endif()

if("${IMP_PER_CPP_COMPILATION}" STREQUAL "ALL")
message(STATUS "All modules are percpp")
set(IMP_IS_PER_CPP 1)
else()
string(REGEX MATCHALL "[a-zA-Z0-9_]+" percpplist "${IMP_PER_CPP_COMPILATION}")
foreach(m ${percpplist})
message(STATUS ${m} " is percpp")
set(IMP_${m}_IS_PER_CPP 1)
endforeach(m)
endif()

add_custom_target("IMP-version"
COMMAND ${PYTHON_EXECUTABLE}
${IMP_TOOLS_DIR}/build/make_version.py
Expand Down

0 comments on commit 1eb9006

Please sign in to comment.