diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b8ad20..04fcbfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,6 @@ project(Criterion C) # Project setup & environment variables -enable_testing() -add_subdirectory(samples) - set(PROJECT_VERSION "1.3.1") set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) set(GettextTranslate_ALL 1) @@ -133,3 +130,7 @@ install(TARGETS criterion add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/uninstall.cmake" ) + +enable_testing() +add_subdirectory(samples) + diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index f614717..17edd70 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -1,5 +1,3 @@ -project(criterion_samples) - set(CMAKE_C_FLAGS "-std=c99 -Wall -Wextra -pedantic") include_directories(../include) @@ -22,11 +20,14 @@ set(SCRIPTS early_exit verbose list - pattern fail_fast help ) +if (HAVE_PCRE) + set(SCRIPTS ${SCRIPTS} pattern) +endif () + foreach(sample ${SAMPLES}) add_executable(${sample} ${sample}.c) target_link_libraries(${sample} criterion)