-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove automake flow #311
Comments
The issue I have with cmake is that I think we should support two essentially different ways of working I would strongly recommend that if we're using CMAKE - internally to Accellera - we should use CMP to handle package management, this would give us the following 'boilerplate': project(....)
include(FetchContent)
FetchContent_Declare(
cpm-cmake
GIT_REPOSITORY ${GITHUB}cpm-cmake/CPM.cmake.git
GIT_SHALLOW True
GIT_TAG v0.31.1
)
FetchContent_MakeAvailable(cpm-cmake)
include(${cpm-cmake_SOURCE_DIR}/cmake/CPM.cmake)
cpmaddpackage("${GITHUB}TheLartians/[email protected]")
# check if caller has already setup SystemC based on e.g. SYSTEMC_HOME
if(DEFINED ENV{SYSTEMC_HOME} OR DEFINED SYSTEMC_HOME)
include(${PROJECT_SOURCE_DIR}/cmake/FindSystemC.cmake)
else ()
cpmaddpackage(
NAME SystemCLanguage
GIT_REPOSITORY ${GITHUB}accellera-official/systemc.git
GIT_SHALLOW True
GIT_TAG main....v3.0....
)
endif()
...
packageproject(
NAME "${PROJECT_NAME}"
VERSION ${PROJECT_VERSION}
NAMESPACE SomeNameSpace
BINARY_DIR ${PROJECT_BINARY_DIR}
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
INCLUDE_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
VERSION_HEADER "${VERSION_HEADER_LOCATION}"
COMPATIBILITY SameMajorVersion
) As you can see, the boilerplate is really small, and the only thing you need to add are the specifics to the project in hand (in our case CCI). Indeed, this allows RapidJSON to be included (though I am in favour of forking that into CCI). Using a combination of CMP and PackageProject means the CMakeLists.txt is kept short, but also, the PakcageProject means that the project is packaged in a very convenient way for others to use it. We could 'replicate' all of this, but I dont see the point, it just gives us more to maintain. In this 'boilerplate' I'm checking for SYSTEMC_HOME and that then relies on a FindSystemC.cmake. The 'downside' of this is that each and every SystemC components (CCI, SCP, or any 'user') would need to have a FindSystemC.cmake if they want to support the 'legacy' approach. I personally dont like that. Perhaps we could provide a single 'source' for that.
if(DEFINED ENV{SYSTEMC_HOME}
cpmaddpackage(
NAME SystemCLanguage
SOURCE_DIR ENV{SYSTEMC_HOME}
....
)
else ()
cpmaddpackage(
NAME SystemCLanguage
GIT_REPOSITORY ${GITHUB}accellera-official/systemc.git
GIT_SHALLOW True
GIT_TAG master
) Should work? |
Hi,
I think we should remove the automake flow.
Nobody wants to maintain it and cmake works well on all platforms anyways.
BR,
Lukas
The text was updated successfully, but these errors were encountered: