2016-10-23 22:48:30 +00:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
2017-02-09 18:11:09 +00:00
|
|
|
project(mycurry_toplevel CXX)
|
2016-10-23 22:48:30 +00:00
|
|
|
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/include")
|
|
|
|
|
|
|
|
include(TargetArch)
|
|
|
|
include(FindPkgConfig)
|
2017-02-08 16:32:55 +00:00
|
|
|
include(CTest)
|
2016-10-23 22:48:30 +00:00
|
|
|
|
|
|
|
option(CURRY_FORCE_OPENGLES "Try to chose the openGL ES renderer if available. Enable this on Raspberry Pi" OFF)
|
|
|
|
option(CURRY_RASPBERRY_PI "Compile for Raspberry Pi" OFF)
|
|
|
|
|
2016-10-26 22:06:59 +00:00
|
|
|
set(MYCURRY_RESOURCES_PATH "${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING "Path to the program's resources")
|
2017-03-17 00:30:34 +00:00
|
|
|
set(CLOONEL_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/clooneljump")
|
2016-10-26 22:06:59 +00:00
|
|
|
|
2016-10-23 22:48:30 +00:00
|
|
|
target_architecture(TARGET_ARCH)
|
|
|
|
message (STATUS "Target architecture: ${TARGET_ARCH}")
|
|
|
|
|
|
|
|
if (TARGET_ARCH MATCHES "^x86_64$")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -msse3")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -msse3")
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -msse3")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -msse3")
|
|
|
|
endif (TARGET_ARCH MATCHES "^x86_64$")
|
|
|
|
|
|
|
|
if (CURRY_FORCE_OPENGLES OR CURRY_RASPBERRY_PI)
|
|
|
|
add_definitions(-DFORCE_OPENGLES)
|
|
|
|
if (CURRY_RASPBERRY_PI)
|
|
|
|
add_definitions(-DRASPBERRY_PI)
|
|
|
|
endif(CURRY_RASPBERRY_PI)
|
|
|
|
endif (CURRY_FORCE_OPENGLES OR CURRY_RASPBERRY_PI)
|
|
|
|
|
|
|
|
find_package(Boost 1.55.0 REQUIRED)
|
|
|
|
|
|
|
|
if (CURRY_RASPBERRY_PI)
|
|
|
|
message(STATUS "Will build for Raspberry Pi")
|
|
|
|
include_directories(SYSTEM
|
|
|
|
/opt/vc/include
|
|
|
|
/opt/vc/include/interface/vcos/pthreads
|
|
|
|
/opt/vc/include/interface/vmcs_host/linux
|
|
|
|
)
|
|
|
|
link_directories(
|
|
|
|
/opt/vc/lib
|
|
|
|
)
|
|
|
|
endif (CURRY_RASPBERRY_PI)
|
|
|
|
|
|
|
|
if (CURRY_RASPBERRY_PI)
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
|
|
|
PRIVATE bcm_host
|
|
|
|
)
|
|
|
|
endif(CURRY_RASPBERRY_PI)
|
|
|
|
|
2017-02-09 18:11:09 +00:00
|
|
|
configure_file(src/${PROJECT_NAME}Config.h.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.h)
|
|
|
|
|
|
|
|
set(common_gcc_flags -Wall -Wextra -pedantic -Wconversion -ffast-math)
|
2016-10-23 22:48:30 +00:00
|
|
|
|
2017-02-09 18:11:09 +00:00
|
|
|
add_library(${PROJECT_NAME} INTERFACE)
|
|
|
|
target_compile_options(${PROJECT_NAME} INTERFACE ${common_gcc_flags})
|
2017-03-12 15:12:09 +00:00
|
|
|
target_compile_definitions(${PROJECT_NAME}
|
|
|
|
INTERFACE $<$<CONFIG:Debug>:KAK_DEBUG>
|
2017-03-17 00:30:34 +00:00
|
|
|
INTERFACE VWR_OUTER_NAMESPACE=curry
|
2017-03-12 15:12:09 +00:00
|
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
INTERFACE lib/kakoune
|
2017-03-15 21:48:27 +00:00
|
|
|
INTERFACE lib/better-enums
|
2017-03-12 15:12:09 +00:00
|
|
|
)
|
2016-10-23 22:48:30 +00:00
|
|
|
|
2017-03-11 08:22:23 +00:00
|
|
|
add_subdirectory(lib/clooneljump/src/cloonelgraphics)
|
2017-02-09 18:11:09 +00:00
|
|
|
add_subdirectory(src/gamelib)
|
|
|
|
add_subdirectory(src/standalone)
|
2017-02-08 16:32:55 +00:00
|
|
|
|
|
|
|
if (BUILD_TESTING)
|
|
|
|
set(CATCH_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/Catch")
|
|
|
|
add_subdirectory(test/unit)
|
|
|
|
endif()
|