cmake_minimum_required(VERSION 2.6)
project(spcore)

set(spcore_SRCS
	${CUSTOM_INCLUDE_PATH}/spcore/baseobj.h
	${CUSTOM_INCLUDE_PATH}/spcore/component.h
	${CUSTOM_INCLUDE_PATH}/spcore/iterator.h
	${CUSTOM_INCLUDE_PATH}/spcore/pinimpl.h
	${CUSTOM_INCLUDE_PATH}/spcore/basetype.h
	${CUSTOM_INCLUDE_PATH}/spcore/basetypeimpl.h
	${CUSTOM_INCLUDE_PATH}/spcore/basictypes.h
	${CUSTOM_INCLUDE_PATH}/spcore/coreruntime.h
	${CUSTOM_INCLUDE_PATH}/spcore/pin.h
	${CUSTOM_INCLUDE_PATH}/spcore/module.h
	${CUSTOM_INCLUDE_PATH}/spcore/coreversion.h
	${CUSTOM_INCLUDE_PATH}/spcore/libexports.h
	${CUSTOM_INCLUDE_PATH}/spcore/conversion.h
	basictypesimpl.cpp
	coreruntimeimpl.cpp
	conversion.cpp
	commoncomponents.h
	${CUSTOM_INCLUDE_PATH}/spcore/language.h
	language.cpp
	${CUSTOM_INCLUDE_PATH}/spcore/configuration.h
	configurationimpl.h
	${CUSTOM_INCLUDE_PATH}/spcore/paths.h
	pathsimpl.h
)

if (WIN32)
	set(spcore_SRCS ${spcore_SRCS} win32env.cpp)
endif(WIN32)

include_directories (${POCO_INCLUDE_DIRS})
add_library (spcore SHARED ${spcore_SRCS})
target_link_libraries(spcore ${POCO_LIBRARIES})

# libconfig

if(WIN32)
	include_directories("${CMAKE_SOURCE_DIR}/3rdparty/libconfig/")
	target_link_libraries(spcore libconfig)
else(WIN32)
	find_package(LibConfig REQUIRED)
	target_link_libraries(spcore ${LibConfig_LIBRARIES})
	include_directories(${LibConfig_INCLUDE_DIR})
endif(WIN32)


target_link_libraries(spcore ${Boost_THREAD_LIBRARY})
if (ENABLE_NLS)
	target_link_libraries(spcore ${LIBINTL_LIBRARIES})
endif(ENABLE_NLS)
target_link_libraries(spcore ${wxWidgets_LIBRARIES})

add_subdirectory(tests)

INSTALL (TARGETS spcore RUNTIME DESTINATION ${LIBRUNTIMEDIR} LIBRARY DESTINATION ${LIBDIR})