Tidied up example/static test executables
This commit is contained in:
@@ -40,7 +40,7 @@ target_compile_options(test PRIVATE
|
||||
)
|
||||
|
||||
|
||||
## Move test images to build dir
|
||||
## Move test assest to build dir
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
@@ -48,21 +48,39 @@ ADD_CUSTOM_COMMAND(
|
||||
)
|
||||
|
||||
|
||||
##############
|
||||
# Executable #
|
||||
##############
|
||||
FILE(GLOB exec_src exec/*.cpp)
|
||||
add_executable(exec
|
||||
${exec_src}
|
||||
)
|
||||
target_link_libraries(exec ${PROJECT_NAME})
|
||||
|
||||
target_include_directories(exec PRIVATE
|
||||
###############
|
||||
# Executables #
|
||||
###############
|
||||
FILE(GLOB bmpp_src exec/BmpPP/BmpPP/src/*.cpp)
|
||||
FILE(GLOB eule_src exec/Eule/Eule/src/*.cpp)
|
||||
add_compile_definitions(_EULE_NO_INTRINSICS_)
|
||||
include_directories(
|
||||
include
|
||||
exec/BmpPP/BmpPP/include
|
||||
exec/Eule/Eule/include
|
||||
)
|
||||
|
||||
target_compile_options(exec PRIVATE
|
||||
-Werror
|
||||
-fdiagnostics-color=always
|
||||
## Move exec assets to build dir
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_SOURCE_DIR}/exec/execAssets/ $<TARGET_FILE_DIR:${PROJECT_NAME}>/execAssets/
|
||||
)
|
||||
|
||||
function(DECLARE_EXEC_EXAMPLE name)
|
||||
add_executable(example-${name} exec/${name}.cpp ${bmpp_src} ${eule_src})
|
||||
target_link_libraries(example-${name} ${PROJECT_NAME})
|
||||
target_compile_options(example-${name} PRIVATE -Werror -fdiagnostics-color=always)
|
||||
endfunction()
|
||||
|
||||
# These are the names of the cpp files in /exec/, without the ".cpp".
|
||||
DECLARE_EXEC_EXAMPLE(encrypt-decrypt-files)
|
||||
DECLARE_EXEC_EXAMPLE(encrypt-decrypt-strings)
|
||||
DECLARE_EXEC_EXAMPLE(benchmark-encryption)
|
||||
DECLARE_EXEC_EXAMPLE(benchmark-prng)
|
||||
DECLARE_EXEC_EXAMPLE(visualize-singleblock-diffusion)
|
||||
DECLARE_EXEC_EXAMPLE(visualize-multiblock-diffusion)
|
||||
DECLARE_EXEC_EXAMPLE(visualize-extreme-input-diffusion)
|
||||
DECLARE_EXEC_EXAMPLE(visualize-prng-distribution)
|
||||
DECLARE_EXEC_EXAMPLE(visualize-hashing-distribution)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user