ENH: Several updates: Do not need an explicit DartConfig, default inexistant file...
[openjpeg.git] / CMakeLists.txt
1 # Main CMakeLists.txt to build the OpenJPEG project using CMake (www.cmake.org)
2 # Written by Mathieu Malaterre
3
4 # This CMake project will by default create a library called openjpeg
5 # But if you want to use this project within your own (CMake) project
6 # you will eventually like to prefix the library to avoid linking confusion
7 # For this purpose you can define a CMake var: OPJ_PREFIX to whatever you like
8 # e.g.:
9 # SET(OPJ_PREFIX "gdcm")
10 # Also if you want to test (CTest driven) you need to define :
11 # OPJ_STANDALONE to 1, e.g
12 # OPJ_STANDALONE:BOOL=1
13 PROJECT(OPENJPEG C)
14 CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
15
16 #-----------------------------------------------------------------------------
17 # OPENJPEG version number, usefull for packaging and doxygen doc:
18 SET(OPENJPEG_MAJOR_VERSION 1)
19 SET(OPENJPEG_MINOR_VERSION 0)
20 SET(OPENJPEG_BUILD_VERSION 0)
21 SET(OPENJPEG_VERSION
22   "${OPENJPEG_MAJOR_VERSION}.${OPENJPEG_MINOR_VERSION}.${OPENJPEG_BUILD_VERSION}")
23
24 #-----------------------------------------------------------------------------
25 # For the codec...
26 OPTION(BUILD_EXAMPLES "Build the Examples (codec...)." OFF)
27
28 #-----------------------------------------------------------------------------
29 # Always build the library
30 SUBDIRS(
31   libopenjpeg
32   )
33 #-----------------------------------------------------------------------------
34 # Build example only if requested
35 IF(BUILD_EXAMPLES)
36   SUBDIRS(codec)
37 ENDIF(BUILD_EXAMPLES)
38
39 #-----------------------------------------------------------------------------
40 # For openjpeg team if they ever want Dart+CMake
41 IF(OPJ_STANDALONE)
42   INCLUDE(Dart)
43   MARK_AS_ADVANCED(BUILD_TESTING DART_ROOT TCL_TCLSH)
44   IF(BUILD_TESTING)
45     ENABLE_TESTING()
46     SET(BUILDNAME "OpenJPEG-${CMAKE_SYSTEM}-${CMAKE_C_COMPILER}" CACHE STRING "Name of build on the dashboard")
47     MARK_AS_ADVANCED(BUILDNAME)
48   ENDIF(BUILD_TESTING)
49 ENDIF(OPJ_STANDALONE)
50
51 # TODO, technically we should add tests, e.g:
52 # http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
53