update CMakeLists for new configuration structure

This commit is contained in:
Jinhao
2016-02-01 00:16:40 +08:00
parent 397096f60e
commit ce7b044186
3 changed files with 21 additions and 36 deletions

View File

@@ -7,10 +7,9 @@
#https://cmake.org/cmake-tutorial/
#https://cmake.org/cmake/help/v3.3/module/CMakeDependentOption.html?highlight=cmakedependentoption
# use CACHE FORCE or set(USE_meganz_mingw_std_threads ON) or delete CMakecache.txt or the entirely build dir
# use CACHE FORCE or set(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ ON) or delete CMakecache.txt or the entirely build dir
# if your changes don't execute
option(USE_meganz_mingw_std_threads "replaced boost.thread with meganz's mingw-std-threads." OFF)
option(USE_UNICODE "Use Unicode Character Set" ON)
option(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ "replaced boost.thread with meganz's mingw-std-threads." OFF)
option(ENABLE_PNG "Enable the use of PNG" OFF)
option(LIBPNG_FROM_OS "Use libpng from operating system." ON)
option(ENABLE_JPEG "Enable the use of JPEG" OFF)
@@ -18,15 +17,12 @@ option(LIBJPEG_FROM_OS "Use libjpeg from operating system." ON)
option(CMAKE_VERBOSE_PREPROCESSOR "Show annoying debug messages during compilation." OFF)
option(CMAKE_STOP_VERBOSE_PREPROCESSOR "Stop compilation after showing the annoying debug messages." ON)
option(BUILD_NANA_DEMOS "Build all the demos form the nana_demo repository." OFF)
option(CMAKE_STD_make_unique_NOT_SUPPORTED "Add support for make_unique<>()." OFF)
#set(CMAKE_STD_make_unique_NOT_SUPPORTED OFF)
# set compile flags
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# move this to the end ??
if(BIICODE)
# prepare BII_LIB_SRC
@@ -40,6 +36,7 @@ endif(BIICODE)
project(nana)
cmake_minimum_required(VERSION 2.8)
add_definitions(-DNANA_IGNORE_CONF)
if(WIN32)
add_definitions(-DWIN32)
@@ -54,22 +51,13 @@ if(WIN32)
endif(MSVC)
if(MINGW)
add_definitions(-DMINGW)
#Find PNG
if(USE_meganz_mingw_std_threads)
add_definitions(-DUSE_github_com_meganz_mingw_std_threads)
# remove_definitions()
endif(USE_meganz_mingw_std_threads)
if(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
add_definitions(-DNANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
endif(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
endif(MINGW)
endif(WIN32)
#Unicode
if(USE_UNICODE)
add_definitions(-DNANA_UNICODE)
endif(USE_UNICODE)
if(APPLE)
add_definitions(-DAPPLE)
include_directories(/opt/X11/include/)
@@ -117,11 +105,6 @@ if(CMAKE_VERBOSE_PREPROCESSOR)
add_definitions(-DVERBOSE_PREPROCESSOR)
endif(CMAKE_VERBOSE_PREPROCESSOR)
# STD_make_unique_NOT_SUPPORTED
if(CMAKE_STD_make_unique_NOT_SUPPORTED)
add_definitions(-DSTD_make_unique_NOT_SUPPORTED)
endif(CMAKE_STD_make_unique_NOT_SUPPORTED)
set(NANA_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source)
set(NANA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)