diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2020-02-16 03:40:06 +0000 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2020-02-16 03:40:06 +0000 |
commit | 425decdf7e9284d15aa726e3ae96b9942fb0e3ea (patch) | |
tree | 6c0dd7edfefff1be7b9e75fe0b3a0a85fe1595f3 /external/semver/src/quickcheck/CMakeLists.txt | |
parent | ccb0b2e4d6674a7a00c9bf491f08fc73b6898c54 (diff) |
create tremded branch
Diffstat (limited to 'external/semver/src/quickcheck/CMakeLists.txt')
-rw-r--r-- | external/semver/src/quickcheck/CMakeLists.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/external/semver/src/quickcheck/CMakeLists.txt b/external/semver/src/quickcheck/CMakeLists.txt new file mode 100644 index 0000000..b8bb9b9 --- /dev/null +++ b/external/semver/src/quickcheck/CMakeLists.txt @@ -0,0 +1,29 @@ +find_program(HSC2HS hsc2hs) +find_program(GHC ghc) + +if (HSC2HS AND GHC) + + # the shared lib + add_library(${PROJECT_NAME}_ffi SHARED + ../lib/semantic_version_v1.cpp ../lib/semantic_version_v2.cpp semantic_version_ffi.cpp) + # the ffi bindings + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Semver.hs + MAIN_DEPENDENCY Semver.hsc + DEPENDS semantic_version_ffi.h + COMMAND ${HSC2HS} ${CMAKE_CURRENT_SOURCE_DIR}/Semver.hsc -I ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/Semver.hs) + # the quickcheck executable + add_custom_command( + OUTPUT quickcheck_${PROJECT_NAME} + MAIN_DEPENDENCY Main.hs + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Semver.hs + DEPENDS ${PROJECT_NAME}_ffi + COMMAND ${GHC} --make ${CMAKE_CURRENT_SOURCE_DIR}/Main -L. -lsemver_ffi -o quickcheck_${PROJECT_NAME}) + add_custom_target(quickcheck ALL + DEPENDS quickcheck_${PROJECT_NAME}) + # pipe to ctest + add_test(NAME quickcheck_${PROJECT_NAME} + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/quickcheck_${PROJECT_NAME}) + set_tests_properties(quickcheck_${PROJECT_NAME} PROPERTIES TIMEOUT 30 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}") + +endif() |