Created
May 15, 2014 05:35
-
-
Save redstar/d5694a6301c40ceb0720 to your computer and use it in GitHub Desktop.
CMakeLists.txt file for libconfig++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CMake build file for libconfig++ | |
cmake_minimum_required(VERSION 2.8) | |
project(libconfig++) | |
set(LIBCONFIG++_SOURCE_DIR ${PROJECT_SOURCE_DIR}/lib) | |
set(LIBCONFIG++__BINARY_DIR ${PROJECT_BINARY_DIR}) | |
set(LIBCONFIG++_SOURCES | |
${LIBCONFIG++_SOURCE_DIR}/grammar.c | |
${LIBCONFIG++_SOURCE_DIR}/libconfig.c | |
${LIBCONFIG++_SOURCE_DIR}/libconfigcpp.c++ | |
${LIBCONFIG++_SOURCE_DIR}/scanctx.c | |
${LIBCONFIG++_SOURCE_DIR}/scanner.c | |
${LIBCONFIG++_SOURCE_DIR}/strbuf.c | |
) | |
include_directories(${LIBCONFIG++_SOURCE_DIR}) | |
add_definitions( | |
/DLIBCONFIGXX_EXPORTS | |
/DLIBCONFIG_STATIC | |
) | |
if (MSVC) | |
add_definitions( | |
/DYY_NO_UNISTD_H | |
/DYY_USE_CONST | |
/Gd /EHsc | |
) | |
endif (MSVC) | |
foreach(file ${LIBCONFIG++_SOURCES}) | |
if(file MATCHES ".*\\.c$") | |
set_source_files_properties(${file} PROPERTIES | |
LANGUAGE C | |
) | |
else() | |
set_source_files_properties(${file} PROPERTIES | |
LANGUAGE CXX | |
) | |
endif() | |
endforeach() | |
add_library(libconfig++ STATIC ${LIBCONFIG++_SOURCES}) | |
set_target_properties( | |
libconfig++ PROPERTIES | |
ARCHIVE_OUTPUT_NAME libconfig++ | |
LIBRARY_OUTPUT_NAME libconfig++ | |
RUNTIME_OUTPUT_NAME libconfig++ | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment