split py files
[android/external-libkmsxx.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8)
2 project(kms++)
4 include(CheckCXXCompilerFlag)
6 IF(NOT CMAKE_BUILD_TYPE)
7     message(STATUS "Setting build type to 'Release' as none was specified.")
8     SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
9     set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
10 ENDIF()
12 string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
14 set(LIBKMS_ENABLE_PYTHON ON CACHE BOOL "Enable Python wrappers")
15 set(LIBKMS_ENABLE_KMSCUBE OFF CACHE BOOL "Enable kmscube")
17 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
18 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wno-unused-parameter")
20 set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
22 # static link libc
23 # set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
25 if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
26     CHECK_CXX_COMPILER_FLAG("-flto" HAS_LTO_FLAG)
28     if (HAS_LTO_FLAG)
29         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
30         set(CMAKE_AR gcc-ar)
31         set(CMAKE_RANLIB gcc-ranlib)
32     endif()
33 endif()
35 find_package(PkgConfig REQUIRED)
36 pkg_check_modules(LIBDRM libdrm REQUIRED)
38 enable_testing()
40 add_subdirectory(libkms++)
41 add_subdirectory(libkmstest)
42 add_subdirectory(tests)
44 if(LIBKMS_ENABLE_KMSCUBE)
45         add_subdirectory(kmscube)
46 endif()
48 if(LIBKMS_ENABLE_PYTHON)
49         add_subdirectory(py)
50 endif()