2015-04-03 20:46:53 +00:00
|
|
|
cmake_minimum_required (VERSION 3.0)
|
|
|
|
project (ACE)
|
|
|
|
|
2015-05-13 15:34:14 +00:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
add_definitions(/DWINVER=0x0600 /D_WIN32_WINNT=0x0600)
|
|
|
|
endif()
|
|
|
|
|
2015-04-03 20:46:53 +00:00
|
|
|
if (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
message(STATUS "No build type selected, default to Debug")
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
|
|
endif()
|
|
|
|
|
2015-05-13 15:34:14 +00:00
|
|
|
option(DEVEL "DEVEL" OFF)
|
|
|
|
option(USE_BULLET "USE_BULLET" OFF)
|
|
|
|
option(USE_DIRECTX "USE_DIRECTX" OFF)
|
2015-04-03 20:46:53 +00:00
|
|
|
option(USE_64BIT_BUILD "USE_64BIT_BUILD" OFF)
|
|
|
|
option(USE_STATIC_LINKING "USE_STATIC_LINKING" ON)
|
|
|
|
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
2015-09-08 19:52:50 +00:00
|
|
|
SET(CMAKE_CXX_FLAGS "-std=c++11 -pedantic -pedantic-errors -march=i686 -m32 -O2 -s -fPIC -fpermissive")
|
2015-04-03 20:46:53 +00:00
|
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
2015-05-13 18:17:43 +00:00
|
|
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
message(ERROR "SUPPORT NOT COMPLETE")
|
|
|
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
2015-05-13 16:57:24 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /arch:SSE2 /Qpar-report:2")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /D _DEBUG /MTd /Zi /Ob0 /Od /RTC1")
|
|
|
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} /MT /O1 /Ob1 /D NDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /MT /O2 /Ob2 /D NDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} /MT /Zi /O2 /Ob1 /D NDEBUG")
|
2015-04-03 20:46:53 +00:00
|
|
|
endif()
|
|
|
|
|
2015-05-13 15:34:14 +00:00
|
|
|
include_directories("common")
|
|
|
|
|
|
|
|
if(USE_BULLET)
|
|
|
|
# Dependencies
|
|
|
|
#
|
|
|
|
set(BACKUP_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
|
|
|
|
set(BACKUP_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
|
|
|
set(BACKUP_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
|
|
|
|
add_definitions(-DUSE_DIRECTX)
|
|
|
|
add_subdirectory(lib/bullet3)
|
|
|
|
|
|
|
|
set_target_properties(App_BasicExample PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(App_HelloWorld PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(App_ExampleBrowser PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(Bullet2FileLoader PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(Bullet3Collision PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(Bullet3Dynamics PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(Bullet3Geometry PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(Bullet3Common PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(Bullet3OpenCL_clew PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(BulletCollision PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(BulletDynamics PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(BulletFileLoader PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(BulletSoftBody PROPERTIES FOLDER Bullet3)
|
|
|
|
|
|
|
|
set_target_properties(BulletWorldImporter PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(BulletXmlWorldImporter PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(ConvexDecomposition PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(GIMPACTUtils PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(gtest PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(gwen PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(HACD PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(OpenGLWindow PROPERTIES FOLDER Bullet3)
|
|
|
|
set_target_properties(LinearMath PROPERTIES FOLDER Bullet3)
|
|
|
|
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BACKUP_ARCHIVE_OUTPUT_DIRECTORY})
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BACKUP_LIBRARY_OUTPUT_DIRECTORY})
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BACKUP_RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
|
|
|
|
include_directories(BEFORE "lib/bullet3/src")
|
|
|
|
endif()
|
|
|
|
if(USE_DIRECTX)
|
|
|
|
add_definitions(-DUSE_DIRECTX)
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
|
|
|
|
find_package (DirectX)
|
|
|
|
link_directories (BEFORE ${DirectX_D3DX11_LIBRARY})
|
|
|
|
include_directories (BEFORE ${DirectX_D3DX11_INCLUDE_DIR} )
|
|
|
|
endif()
|
|
|
|
if(DEVEL)
|
|
|
|
add_definitions(-DDEVEL)
|
2015-04-03 20:46:53 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2015-04-21 23:49:30 +00:00
|
|
|
string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ")
|
|
|
|
set(ACE_VERSION_MAJOR 3)
|
2016-02-16 18:19:18 +00:00
|
|
|
set(ACE_VERSION_MINOR 5)
|
|
|
|
set(ACE_VERSION_REVISION 0)
|
2015-04-21 23:49:30 +00:00
|
|
|
EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD
|
|
|
|
OUTPUT_VARIABLE T_ACE_VERSION_BUILD
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
string(SUBSTRING ${T_ACE_VERSION_BUILD} 0 7 ACE_VERSION_BUILD )
|
|
|
|
|
|
|
|
message("Building for: " ${ACE_VERSION_MAJOR}.${ACE_VERSION_MINOR}.${ACE_VERSION_REVISION}-${ACE_VERSION_BUILD})
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/common/ace_version.hpp.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/common/ace_version.hpp"
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/common/ace_version_win32.rc.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/common/ace_version_win32.rc"
|
|
|
|
@ONLY)
|
|
|
|
set(GLOBAL_RC ${CMAKE_CURRENT_BINARY_DIR}/common/ace_version_win32.rc)
|
|
|
|
endif()
|
|
|
|
|
2015-05-13 15:34:14 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/common)
|
2015-04-21 23:49:30 +00:00
|
|
|
set(GLOBAL_SOURCES ${GLOBAL_RC})
|
|
|
|
|
2015-05-13 15:34:14 +00:00
|
|
|
|
2015-04-03 20:46:53 +00:00
|
|
|
# Add extensions to build here
|
2015-05-13 15:34:14 +00:00
|
|
|
add_subdirectory(common)
|
|
|
|
|
|
|
|
# Extensions
|
|
|
|
|
2015-04-03 20:46:53 +00:00
|
|
|
add_subdirectory(fcs)
|
2015-05-01 00:14:23 +00:00
|
|
|
add_subdirectory(break_line)
|
2015-05-02 20:13:24 +00:00
|
|
|
add_subdirectory(clipboard)
|
2015-04-09 16:52:57 +00:00
|
|
|
add_subdirectory(advanced_ballistics)
|
2015-05-03 22:02:39 +00:00
|
|
|
add_subdirectory(medical)
|
2015-05-03 18:44:02 +00:00
|
|
|
add_subdirectory(parse_imagepath)
|
2015-04-03 20:46:53 +00:00
|
|
|
|
2015-05-13 15:34:14 +00:00
|
|
|
# Test Extension for dynamically loading/unloading built extensions; does not build in release
|
|
|
|
if (DEVEL)
|
|
|
|
add_subdirectory(dynload)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
if(USE_DIRECTX)
|
|
|
|
add_subdirectory(lib/directxtk)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-03 20:46:53 +00:00
|
|
|
message("Build Type: ${CMAKE_BUILD_TYPE}")
|