58 lines
1.4 KiB
CMake
58 lines
1.4 KiB
CMake
set(ALL_DIRECTORIES common)
|
|
|
|
foreach(dir ${ALL_DIRECTORIES})
|
|
link_directories("${concordia_BINARY_DIR}/${dir}")
|
|
add_subdirectory(${dir})
|
|
endforeach(dir)
|
|
|
|
file(GLOB main_sources "*.cpp")
|
|
file(GLOB common_sources "common/*.cpp")
|
|
|
|
|
|
add_library(concordia SHARED
|
|
${main_sources}
|
|
${common_sources}
|
|
)
|
|
|
|
add_subdirectory(t)
|
|
# =====================================
|
|
|
|
install(TARGETS concordia DESTINATION lib/)
|
|
|
|
|
|
file(GLOB main_headers "*.hpp")
|
|
file(GLOB common_headers "common/*.hpp")
|
|
|
|
install(FILES
|
|
${main_headers}
|
|
DESTINATION include/concordia/)
|
|
|
|
install(FILES
|
|
${common_headers}
|
|
DESTINATION include/concordia/common/)
|
|
|
|
# ----------------------------------------------------
|
|
# libconfig
|
|
# ----------------------------------------------------
|
|
find_library(LIBCONFIG_LIB NAMES config++ REQUIRED)
|
|
find_path(LIBCONFIG_INCLUDE libconfig.h++)
|
|
|
|
if(EXISTS ${LIBCONFIG_LIB} AND EXISTS ${LIBCONFIG_INCLUDE})
|
|
message(STATUS "Found Libconfig")
|
|
include_directories(${LIBCONFIG_INCLUDE})
|
|
link_directories(${LIBCONFIG_LIB})
|
|
endif(EXISTS ${LIBCONFIG_LIB} AND EXISTS ${LIBCONFIG_INCLUDE})
|
|
|
|
target_link_libraries(concordia config++ log4cpp ${Boost_LIBRARIES} divsufsort utf8case ${Boost_LIBRARIES})
|
|
|
|
if (WITH_RE2)
|
|
target_link_libraries(concordia re2)
|
|
if (WITH_PCRE)
|
|
target_link_libraries(concordia pcrecpp)
|
|
endif(WITH_PCRE)
|
|
else(WITH_RE2)
|
|
if (WITH_PCRE)
|
|
target_link_libraries(concordia pcrecpp)
|
|
endif(WITH_PCRE)
|
|
endif(WITH_RE2)
|