2015-08-25 06:56:05 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(zeus)
|
|
|
|
|
2015-08-12 01:41:28 +00:00
|
|
|
if (NOT DEFINED ATHENA_INCLUDE_DIR)
|
2016-03-04 23:03:26 +00:00
|
|
|
set(ATHENA_INCLUDE_DIR ../athena/include)
|
2015-08-12 01:41:28 +00:00
|
|
|
endif()
|
|
|
|
include_directories(include ${ATHENA_INCLUDE_DIR})
|
|
|
|
|
2016-07-04 22:28:59 +00:00
|
|
|
set(SOURCES
|
2016-09-01 19:38:16 +00:00
|
|
|
src/CAxisAngle.cpp
|
2015-08-12 01:41:28 +00:00
|
|
|
src/CVector3f.cpp
|
|
|
|
src/Math.cpp
|
|
|
|
src/CQuaternion.cpp
|
|
|
|
src/CMatrix3f.cpp
|
|
|
|
src/CProjection.cpp
|
|
|
|
src/CPlane.cpp
|
|
|
|
src/CTransform.cpp
|
|
|
|
src/CColor.cpp
|
|
|
|
src/CVector2f.cpp
|
|
|
|
src/CRectangle.cpp
|
|
|
|
src/CVector4f.cpp
|
|
|
|
src/CMatrix4f.cpp
|
2017-03-20 05:06:53 +00:00
|
|
|
src/CAABox.cpp
|
|
|
|
src/CEulerAngles.cpp)
|
2016-07-04 22:28:59 +00:00
|
|
|
|
|
|
|
# SSELegacy.cpp compiled separately to escape the effects of link-time optimization
|
|
|
|
if(NOT MSVC)
|
|
|
|
set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS "-msse4.1 -msse4.2 -std=c++14")
|
2016-09-30 22:41:55 +00:00
|
|
|
string(REPLACE "-flto=thin" "" CUSTOM_FLAGS ${CMAKE_CXX_FLAGS})
|
2016-07-05 21:49:05 +00:00
|
|
|
if (CMAKE_OSX_DEPLOYMENT_TARGET AND NOT CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "")
|
|
|
|
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -O3 -msse3 -std=c++14")
|
|
|
|
else()
|
|
|
|
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -O3 -msse3 -std=c++14")
|
|
|
|
endif()
|
|
|
|
|
2016-07-05 15:27:17 +00:00
|
|
|
set(SSE_LEGACY_OBJ ${CMAKE_CURRENT_BINARY_DIR}/SSELegacy.o)
|
2016-07-04 22:28:59 +00:00
|
|
|
separate_arguments(CUSTOM_FLAGS UNIX_COMMAND ${CUSTOM_FLAGS})
|
|
|
|
add_custom_command(
|
2016-07-05 01:45:22 +00:00
|
|
|
OUTPUT ${SSE_LEGACY_OBJ}
|
2016-07-04 22:28:59 +00:00
|
|
|
COMMAND ${CMAKE_CXX_COMPILER}
|
|
|
|
ARGS ${CUSTOM_FLAGS} -c ${CMAKE_CURRENT_SOURCE_DIR}/src/SSELegacy.cpp
|
2016-07-05 01:45:22 +00:00
|
|
|
-o ${SSE_LEGACY_OBJ}
|
2016-07-04 22:28:59 +00:00
|
|
|
-I ${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
-I ${ATHENA_INCLUDE_DIR}
|
|
|
|
MAIN_DEPENDENCY src/SSELegacy.cpp)
|
|
|
|
|
2016-07-05 01:45:22 +00:00
|
|
|
else()
|
|
|
|
set(SSE_LEGACY_OBJ src/SSELegacy.cpp)
|
|
|
|
endif()
|
|
|
|
|
2016-07-04 22:28:59 +00:00
|
|
|
add_library(zeus
|
|
|
|
${SOURCES}
|
2016-07-05 01:45:22 +00:00
|
|
|
${SSE_LEGACY_OBJ}
|
2015-07-20 02:57:16 +00:00
|
|
|
|
2016-03-04 23:03:26 +00:00
|
|
|
include/zeus/Math.hpp
|
|
|
|
include/zeus/CQuaternion.hpp
|
|
|
|
include/zeus/CMatrix3f.hpp
|
|
|
|
include/zeus/CProjection.hpp
|
|
|
|
include/zeus/CAxisAngle.hpp
|
|
|
|
include/zeus/CRelAngle.hpp
|
|
|
|
include/zeus/CPlane.hpp
|
|
|
|
include/zeus/CTransform.hpp
|
|
|
|
include/zeus/CColor.hpp
|
|
|
|
include/zeus/Global.hpp
|
|
|
|
include/zeus/zeus.hpp
|
|
|
|
include/zeus/TVectorUnion.hpp
|
|
|
|
include/zeus/CVector2i.hpp
|
|
|
|
include/zeus/CVector2f.hpp
|
|
|
|
include/zeus/CVector3f.hpp
|
|
|
|
include/zeus/CVector3d.hpp
|
|
|
|
include/zeus/CVector4f.hpp
|
|
|
|
include/zeus/CRectangle.hpp
|
|
|
|
include/zeus/CMatrix4f.hpp
|
|
|
|
include/zeus/CFrustum.hpp
|
|
|
|
include/zeus/CAABox.hpp
|
|
|
|
include/zeus/COBBox.hpp
|
2017-03-30 22:35:40 +00:00
|
|
|
include/zeus/CLine.hpp
|
2016-04-26 10:36:44 +00:00
|
|
|
include/zeus/CLineSeg.hpp
|
2016-03-04 23:03:26 +00:00
|
|
|
include/zeus/CSphere.hpp
|
|
|
|
include/zeus/CUnitVector.hpp
|
2017-03-20 05:06:53 +00:00
|
|
|
include/zeus/CMRay.hpp
|
|
|
|
include/zeus/CEulerAngles.hpp)
|
2015-07-20 02:57:16 +00:00
|
|
|
|
2015-08-25 06:56:05 +00:00
|
|
|
add_subdirectory(test)
|
|
|
|
|