-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ext] organizing extensions (capd/ibex) (missing CMakeLists)
- Loading branch information
1 parent
34dd287
commit 895df62
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# ================================================================== | ||
# Codac - cmake configuration file | ||
# ================================================================== | ||
|
||
list(APPEND CODAC_IBEX_SRC | ||
|
||
${CMAKE_CURRENT_SOURCE_DIR}/codac2_ibex.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/codac2_ibex.h | ||
) | ||
|
||
################################################################################ | ||
# Create the target for libcodac-ibex | ||
################################################################################ | ||
|
||
#if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
#endif() | ||
|
||
add_library(${PROJECT_NAME}-ibex ${CODAC_IBEX_SRC}) | ||
target_link_libraries(${PROJECT_NAME}-ibex PUBLIC ${PROJECT_NAME}-core Ibex::ibex Eigen3::Eigen Ibex::ibex) | ||
|
||
|
||
################################################################################ | ||
# For the generation of the PKG file | ||
################################################################################ | ||
|
||
set(CODAC_PKG_CONFIG_CFLAGS "${CODAC_PKG_CONFIG_CFLAGS} -I\${includedir}/${PROJECT_NAME}-ibex" PARENT_SCOPE) | ||
set(CODAC_PKG_CONFIG_LIBS "${CODAC_PKG_CONFIG_LIBS} -l${PROJECT_NAME}-ibex" PARENT_SCOPE) | ||
|
||
|
||
################################################################################ | ||
# Installation of libcodac-ibex files | ||
################################################################################ | ||
|
||
# Getting header files from sources | ||
|
||
foreach(srcfile ${CODAC_IBEX_SRC}) | ||
if(srcfile MATCHES "\\.h$" OR srcfile MATCHES "\\.hpp$") | ||
list(APPEND CODAC_IBEX_HDR ${srcfile}) | ||
file(COPY ${srcfile} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../../../include) | ||
endif() | ||
endforeach() | ||
|
||
# Generating the file codac-ibex.h | ||
|
||
set(CODAC_IBEX_MAIN_HEADER ${CMAKE_CURRENT_BINARY_DIR}/codac-ibex.h) | ||
file(WRITE ${CODAC_IBEX_MAIN_HEADER} "/* This file is generated by CMake */\n\n") | ||
file(APPEND ${CODAC_IBEX_MAIN_HEADER} "#pragma once\n\n") | ||
foreach(header_path ${CODAC_IBEX_HDR}) | ||
get_filename_component(header_name ${header_path} NAME) | ||
file(APPEND ${CODAC_IBEX_MAIN_HEADER} "#include <${header_name}>\n") | ||
endforeach() | ||
file(COPY ${CODAC_IBEX_MAIN_HEADER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../../../include) | ||
|
||
# Install files in system directories | ||
|
||
install(TARGETS ${PROJECT_NAME}-ibex DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
install(FILES ${CODAC_IBEX_HDR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}-ibex) | ||
install(FILES ${CODAC_IBEX_MAIN_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}-ibex) |