-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (40 loc) · 1.35 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(opus)
MESSAGE("CMAKE_BINARY_DIR : ${CMAKE_BINARY_DIR}")
MESSAGE("CMAKE_SOURCE_DIR : ${CMAKE_SOURCE_DIR}")
#SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
#SET( LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
IF( WIN32 )
SET( CMAKE_CONFIGURATION_TYPES "Debug;Release;" CACHE STRING "limited configs" FORCE)
SET( CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" )
SET( CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
ELSE()
SET ( CMAKE_BUILD_TYPE "RELEASE" )
# SET ( CMAKE_BUILD_TYPE "DEBUG" )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -pedantic -fmessage-length=0 -fPIC" )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra ")
ENDIF( WIN32 )
SET(XPRS_DIR $ENV{XPRESSDIR})
SET(XPRS_LIB ${XPRS_DIR}/lib)
SET(XPRS_INC ${XPRS_DIR}/include)
MESSAGE("XPRS_DIR : ${XPRS_DIR}")
MESSAGE("XPRS_INC : ${XPRS_INC}")
MESSAGE("XPRS_LIB : ${XPRS_LIB}")
FILE(
GLOB_RECURSE
OPUS_SRC
src/*.cpp
src/*.hpp
src/*.h
)
MESSAGE("WIN32 : ${WIN32}")
MESSAGE("OPUS_SRC : ${OPUS_SRC}")
INCLUDE_DIRECTORIES( ${XPRS_INC} . )
ADD_EXECUTABLE( OPUS_XPRESS ${OPUS_SRC})
IF( WIN32 )
MESSAGE("Linking ${XPRS_LIB}/xprs.lib")
TARGET_LINK_LIBRARIES(OPUS_XPRESS ${XPRS_LIB}/xprs.lib)
ELSE()
MESSAGE("Linking ${XPRS_LIB}/libxprs.so")
TARGET_LINK_LIBRARIES(OPUS_XPRESS ${XPRS_LIB}/libxprs.so)
ENDIF()