Merge pull request #1452 from akoeplinger/dictionary-duplicatekey
[platform/upstream/coreclr.git] / tests / CMakeLists.txt
1 # Require at least version 2.8.12 of CMake
2 cmake_minimum_required(VERSION 2.8.12)
3
4 if (CMAKE_CONFIGURATION_TYPES) # multi-configuration generator?
5     set(CMAKE_CONFIGURATION_TYPES "Debug;Checked;Release;RelWithDebInfo" CACHE STRING "" FORCE)
6 endif (CMAKE_CONFIGURATION_TYPES)
7 set(CMAKE_C_FLAGS_CHECKED "")
8 set(CMAKE_CXX_FLAGS_CHECKED "")
9 set(CMAKE_EXE_LINKER_FLAGS_CHECKED "")
10 set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "")
11
12 set(INC_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/Common/Platform)
13 if (WIN32)
14     add_definitions(-DWINDOWS=1)
15 endif()
16
17 # Compile options
18
19 if (WIN32)
20     add_compile_options(-wd4100 -wd4514 -wd4668 -wd4710 -wd4711 -wd4820)
21 endif()
22
23 if(CLR_CMAKE_PLATFORM_UNIX)
24     add_compile_options(-fPIC)
25 endif(CLR_CMAKE_PLATFORM_UNIX)
26
27 MACRO(SUBDIRLIST result curdir)
28   FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
29   SET(dirlist "")
30   FOREACH(child ${children})
31     IF(IS_DIRECTORY ${curdir}/${child})
32         LIST(APPEND dirlist ${child})
33     ENDIF()
34   ENDFOREACH()
35   SET(${result} ${dirlist})
36 ENDMACRO()
37
38 MACRO(ADDSUBDIR_REC  curdir)
39     SUBDIRLIST(SUB_DIRS ${curdir})
40     FOREACH(subdir ${SUB_DIRS})
41         if(EXISTS "${curdir}/${subdir}/CMakeLists.txt")
42            ADD_SUBDIRECTORY(${curdir}/${subdir})
43         else()
44            ADDSUBDIR_REC(${curdir}/${subdir})
45         endif(EXISTS "${curdir}/${subdir}/CMakeLists.txt")
46     ENDFOREACH()
47 ENDMACRO()
48
49 ADDSUBDIR_REC(${CMAKE_CURRENT_SOURCE_DIR})
50