File: DefineOptions.cmake

package info (click to toggle)
clucene-core 2.3.3.4%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 7,900 kB
  • sloc: cpp: 70,727; ansic: 39,655; sh: 338; makefile: 17; php: 5
file content (53 lines) | stat: -rw-r--r-- 2,072 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#define global options, this makes it easy to use ccmake, or the cmake gui
MACRO (DEFINE_OPTIONS extraOptions extraLibs)
  IF(ENABLE_DEBUG)
    SET (${extraOptions} "${${extraOptions}} -D_DEBUG")
  ENDIF(ENABLE_DEBUG)

  IF(ENABLE_MMAP)
    SET (${extraOptions} "${${extraOptions}} -DLUCENE_FS_MMAP")
  ENDIF(ENABLE_MMAP)

  IF(ENABLE_DMALLOC)
    SET (${extraOptions} "${${extraOptions}} -DDMALLOC")
    IF ( DISABLE_MULTITHREADING )
      SET (${extraLibs} ${${extraLibs}} "dmalloccxx")
    ELSE( DISABLE_MULTITHREADING )
      SET (${extraLibs} ${${extraLibs}} "dmallocthcxx")
    ENDIF ( DISABLE_MULTITHREADING )
  ENDIF(ENABLE_DMALLOC)

  IF(DISABLE_MULTITHREADING)
    SET (${extraOptions} "${${extraOptions}} -D_CL_DISABLE_MULTITHREADING")
  ELSE(DISABLE_MULTITHREADING)
    SET(${extraOptions} "${${extraOptions}} -D_REENTRANT")
  ENDIF(DISABLE_MULTITHREADING)

  IF(ENABLE_ASCII_MODE)
    SET (${extraOptions} "${${extraOptions}} -D_ASCII")
  ELSE(ENABLE_ASCII_MODE)
    SET (${extraOptions} "${${extraOptions}} -D_UCS2")
    SET (${extraOptions} "${${extraOptions}} -D_UNICODE")
  ENDIF(ENABLE_ASCII_MODE)

	IF ( MSVC80 OR MSVC90)
	    #todo: remove this once crt functions are fixed...
		SET (${extraOptions} "${${extraOptions}} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE")
	ENDIF ( MSVC80 OR MSVC90 )
	
	IF(CYGWIN)
        ADD_DEFINITIONS(-D__LARGE64_FILES)
    ENDIF(CYGWIN)
    
    # calm mdown msvc
    IF(MSVC)
        IF ( NOT MSVC60 )
            #ADD_DEFINITIONS(-wd4251) # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
            #ADD_DEFINITIONS(-wd4275) # non  DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
            #ADD_DEFINITIONS(-wd4309) # 'conversion' : truncation of constant value
            #ADD_DEFINITIONS(-wd4503) # decorated name length exceeded
            #ADD_DEFINITIONS(-wd4786) # identifier was truncated to '255' characters in the debug information
        ENDIF ( NOT MSVC60 )
    ENDIF(MSVC)

ENDMACRO (DEFINE_OPTIONS)