Skip to content
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

Updated CMake to contain warning and error message if proper packages… #28

Merged
merged 4 commits into from
Dec 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions fsw/crypto_util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
include_directories(include)
include_directories(../crypto/public_inc)

if(ENCTEST)
if(${ENCTEST})
find_package (Python3 REQUIRED COMPONENTS Interpreter Development)
endif(ENCTEST)
execute_process(COMMAND pip show pycryptodome RESULT_VARIABLE EXIT_CODE OUTPUT_QUIET)
if(NOT ${EXIT_CODE} EQUAL 0)
message(FATAL_ERROR "The \"pycryptodome\" Python3 package is not installed, and is required for ENCTEST.")
endif()
endif(${ENCTEST})

aux_source_directory(src UTIL_SRC_FILES)
aux_source_directory(app APP_SRC_FILES)
Expand All @@ -41,6 +45,8 @@ foreach(SOURCE_PATH ${SOURCE_FILES})
if(${ENCTEST} AND ${EXECUTABLE_NAME} STREQUAL et_dt_validation)
target_link_libraries(${EXECUTABLE_NAME} PUBLIC ${Python3_LIBRARIES})
target_include_directories(${EXECUTABLE_NAME} PUBLIC ${Python3_INCLUDE_DIRS})
find_library(${Python3_LIBRARIES} pycryptodome)

endif()

add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
Expand All @@ -50,4 +56,4 @@ foreach(SOURCE_PATH ${SOURCE_FILES})
)
endforeach(SOURCE_PATH ${SOURCE_FILES})

target_include_directories (Crypto PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (Crypto PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})