xref: /aosp_15_r20/external/libconfig/contrib/chained/examples/CMakeLists.txt (revision 2e9d491483b805f09ea864149eadd5680efcc72a)
1cmake_minimum_required(VERSION 2.8)
2
3set(CMAKE_RUNTIME_OUTPUT_DIRECTORY  "${CMAKE_SOURCE_DIR}/")
4
5project (ChainedLibconfigExample)
6file(GLOB SOURCES *.cpp *.h ../*.h ../*.md)
7
8if(MSVC)
9	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
10else()
11	find_package(libconfig)
12endif()
13
14if(CMAKE_COMPILER_IS_GNUCXX)
15	#set(CMAKE_BUILD_TYPE Debug)
16	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
17endif()
18
19include_directories(
20	${CMAKE_SOURCE_DIR}/../../../lib/
21)
22
23if(MSVC)
24 link_libraries (
25    ${CMAKE_SOURCE_DIR}/../../../Debug/libconfig++.lib
26 )
27else()
28link_libraries (
29	${LIBCONFIG_LIBRARY}
30)
31endif()
32
33
34add_executable (
35   ChainedLibconfigExample
36#   WIN32 # Only if you don't want the DOS prompt to appear in the background in Windows
37#   MACOSX_BUNDLE
38   ${SOURCES} # We could've listed the source files here directly instead of using a variable to store them
39   #${INCLUDES}
40)
41