#
# This is CMakeLists for project: IndexList_Static
#
project(IndexList_Static)

# ${SRC} cmake file defines ${SOURCES} variable which holds all sources used during compilation
include_cmake(${SRC})

enable_all_warnings()
enable_warnings_as_errors()

# Add the given directories to those the compiler uses to search for include files.
# Relative paths are interpreted as relative to the current source directory.
include_directories(
	"${OPENIPC_ROOT}/Source/Public_Include"
	"${OPENIPC_ROOT}/Source/Foundation/CommonUtils/Public"
	)

add_library(IndexList_Objects OBJECT ${SOURCES} )

target_compile_definitions(IndexList_Objects
    PRIVATE
        INDEXLIST_EXPORTS)

set(DUMMY_SOURCE_FILE "${CMAKE_CURRENT_BINARY_DIR}/Generated/dummy.cpp")
if (NOT EXISTS "${DUMMY_SOURCE_FILE}")
    file(WRITE "${DUMMY_SOURCE_FILE}" "/*This is needed because some generators (e.g. Xcode) do not like targets that are only made up of objects*/")
endif()

add_library(IndexList_Static STATIC ${DUMMY_SOURCE_FILE} $<TARGET_OBJECTS:IndexList_Objects>)

target_link_libraries(IndexList_Static PRIVATE CommonUtils)


set_target_properties(IndexList_Objects PROPERTIES
                      OUTPUT_NAME IndexList_Objects_${ARCHITECTURE_NAME}
                      FOLDER "/Foundation")

set_target_properties(IndexList_Static PROPERTIES
                      OUTPUT_NAME IndexList_Static_${ARCHITECTURE_NAME}
                      FOLDER "/Foundation")

if(WIN32)
	target_compile_options(IndexList_Static PUBLIC /EHsc)
    target_compile_options(IndexList_Objects PUBLIC /EHsc)
endif()
