Commit 3133d2ef authored by Ghislain MARY's avatar Ghislain MARY

Require at least CMake 2.8.12.

parent 79cf6b7d
......@@ -20,7 +20,7 @@
#
############################################################################
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.8.12)
project(CUNIT C)
......@@ -102,13 +102,13 @@ else()
add_definitions("-Wall -W -pedantic -Wshadow -ansi -std=c99")
endif()
if(${ENABLE_MEMTRACE})
if(ENABLE_MEMTRACE)
add_definitions(-DMEMTRACE)
endif()
if(${ENABLE_DEPRECATED})
if(ENABLE_DEPRECATED)
add_definitions(-DUSE_DEPRECATED_CUNIT_NAMES)
endif()
if(${ENABLE_CURSES})
if(ENABLE_CURSES)
set(CURSES_NEED_NCURSES 1)
find_package(Curses)
if(NOT CURSES_FOUND)
......@@ -127,6 +127,6 @@ add_subdirectory(CUnit)
add_subdirectory(doc)
add_subdirectory(Man)
add_subdirectory(Share)
if(${ENABLE_EXAMPLES})
if(ENABLE_EXAMPLES)
add_subdirectory(Examples)
endif()
......@@ -28,19 +28,19 @@ set(FRAMEWORK_INCLUDES CUError.h CUnit.h CUnit_intl.h MyMem.h TestDB.h TestRun.h
set(HEADER_FILES ${FRAMEWORK_INCLUDES})
if(${ENABLE_BASIC})
if(ENABLE_BASIC)
list(APPEND HEADER_FILES ${BASIC_INCLUDES})
endif()
if(${ENABLE_CONSOLE})
if(ENABLE_CONSOLE)
list(APPEND HEADER_FILES ${CONSOLE_INCLUDES})
endif()
if(${ENABLE_AUTOMATED})
if(ENABLE_AUTOMATED)
list(APPEND HEADER_FILES ${AUTOMATED_INCLUDES})
endif()
if(${ENABLE_CURSES})
if(ENABLE_CURSES)
list(APPEND HEADER_FILES ${CURSES_INCLUDES})
endif()
......
......@@ -112,7 +112,7 @@ set(FRAMEWORK_SYMBOLS "
set(SOURCE_FILES ${FRAMEWORK_SOURCE_FILES})
source_group(framework FILES ${FRAMEWORK_SOURCE_FILES})
if(${ENABLE_BASIC})
if(ENABLE_BASIC)
list(APPEND SOURCE_FILES ${BASIC_SOURCE_FILES})
source_group(basic FILES ${BASIC_SOURCE_FILES})
set(BASIC_SYMBOLS "
......@@ -124,7 +124,7 @@ if(${ENABLE_BASIC})
CU_basic_show_failures
")
endif()
if(${ENABLE_AUTOMATED})
if(ENABLE_AUTOMATED)
list(APPEND SOURCE_FILES ${AUTOMATED_SOURCE_FILES})
source_group(automated FILES ${AUTOMATED_SOURCE_FILES})
set(AUTOMATED_SYMBOLS "
......@@ -133,14 +133,14 @@ if(${ENABLE_AUTOMATED})
CU_set_output_filename
")
endif()
if(${ENABLE_CONSOLE})
if(ENABLE_CONSOLE)
list(APPEND SOURCE_FILES ${CONSOLE_SOURCE_FILES})
source_group(console FILES ${CONSOLE_SOURCE_FILES})
set(CONSOLE_SYMBOLS "
CU_console_run_tests
")
endif()
if(${ENABLE_CURSES})
if(ENABLE_CURSES)
list(APPEND SOURCE_FILES ${CURSES_SOURCE_FILES})
source_group(curses FILES ${CURSES_SOURCE_FILES})
endif()
......@@ -150,7 +150,7 @@ if(WIN32)
endif()
if(${ENABLE_STATIC})
if(ENABLE_STATIC)
add_library(cunit STATIC ${SOURCE_FILES})
target_link_libraries(cunit ${CURSES_LIBRARIES})
else()
......@@ -174,7 +174,7 @@ install(TARGETS cunit
)
if(${ENABLE_TEST})
if(ENABLE_TEST)
add_library(cunit_test STATIC ${FRAMEWORK_SOURCE_FILES})
target_compile_definitions(cunit_test PUBLIC MEMTRACE CUNIT_BUILD_TESTS CUNIT_DO_NOT_DEFINE_UNLESS_BUILDING_TESTS)
target_include_directories(cunit_test PUBLIC Test)
......
......@@ -24,15 +24,15 @@ add_library(cunitexamples STATIC ExampleTests.c)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
if(${ENABLE_BASIC})
if(ENABLE_BASIC)
add_subdirectory(BasicTest)
endif()
if(${ENABLE_CONSOLE})
if(ENABLE_CONSOLE)
add_subdirectory(ConsoleTest)
endif()
if(${ENABLE_CURSES})
if(ENABLE_CURSES)
add_subdirectory(CursesTest)
endif()
if(${ENABLE_AUTOMATED})
if(ENABLE_AUTOMATED)
add_subdirectory(AutomatedTest)
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment