46 lines
1.5 KiB
CMake
46 lines
1.5 KiB
CMake
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
|
|
PROJECT(NV)
|
|
ENABLE_TESTING()
|
|
|
|
SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake")
|
|
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}")
|
|
|
|
IF(WIN32)
|
|
SET(GNUWIN32 "${NV_SOURCE_DIR}/gnuwin32")
|
|
SET(CMAKE_INCLUDE_PATH "${GNUWIN32}/include")
|
|
SET(CMAKE_LIBRARY_PATH "${GNUWIN32}/lib")
|
|
ENDIF(WIN32)
|
|
|
|
# In single config builds:
|
|
#IF(NOT CMAKE_CONFIGURATION_TYPES)
|
|
# IF (CMAKE_BUILD_TYPE MATCHES Debug)
|
|
# ADD_DEFINITIONS(-D_DEBUG)
|
|
# # ADD_DEFINITIONS(-DDEBUG)
|
|
# ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
|
|
#ELSE(NOT CMAKE_CONFIGURATION_TYPES)
|
|
# SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} "-D_DEBUG")
|
|
# SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} "-DNDEBUG")
|
|
#ENDIF(NOT CMAKE_CONFIGURATION_TYPES)
|
|
|
|
IF(MSVC)
|
|
# @@ Some of these might only be available in VC8.
|
|
# Code generation flags.
|
|
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:SSE2 /fp:fast")
|
|
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2 /fp:fast")
|
|
|
|
# Optimization flags.
|
|
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} /O2 /Ob2 /Oi /Ot /Oy /GL")
|
|
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /O2 /Ob2 /Oi /Ot /Oy /GL")
|
|
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
|
|
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
|
|
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG")
|
|
|
|
# Definitions.
|
|
ADD_DEFINITIONS(-D__SSE2__ -D__SSE__ -D__MMX__)
|
|
ENDIF(MSVC)
|
|
|
|
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=pentium4")
|
|
|
|
ADD_SUBDIRECTORY(src)
|
|
|