diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f51c1e..30b398b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,23 +136,12 @@ set_target_properties(mcl_st PROPERTIES OUTPUT_NAME mcl) # https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B#The_Do.27s_and_Don.27ts set(LIBS mcl ${EXT_LIBS}) -add_library(mclbn256 SHARED src/bn_c256.cpp) -target_link_libraries(mclbn256 ${LIBS}) -add_library(mclbn384 SHARED src/bn_c384.cpp) -target_link_libraries(mclbn384 ${LIBS}) -add_library(mclbn512 SHARED src/bn_c512.cpp) -target_link_libraries(mclbn512 ${LIBS}) -add_library(mclbn384_256 SHARED src/bn_c384_256.cpp) -target_link_libraries(mclbn384_256 ${LIBS}) - -add_executable(bn_c256_test test/bn_c256_test.cpp) -target_link_libraries(bn_c256_test mclbn256) -add_executable(bn_c384_test test/bn_c384_test.cpp) -target_link_libraries(bn_c384_test mclbn384) -add_executable(bn_c512_test test/bn_c512_test.cpp) -target_link_libraries(bn_c512_test mclbn512) -add_executable(bn_c384_256_test test/bn_c384_256_test.cpp) -target_link_libraries(bn_c384_256_test mclbn384_256) +foreach(bit IN ITEMS 256 384 384_256 512) + add_library(mclbn${bit} SHARED src/bn_c${bit}.cpp) + target_link_libraries(mclbn${bit} ${LIBS}) + add_executable(bn_c${bit}_test test/bn_c${bit}_test.cpp) + target_link_libraries(bn_c${bit}_test mclbn${bit}) +endforeach() file(GLOB MCL_HEADERS include/mcl/*.hpp include/mcl/bn.h include/mcl/curve_type.h) file(GLOB CYBOZULIB_HEADERS include/cybozu/*.hpp)