cmake: Fix the default build type. Add some CMakeList files.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3060 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-05-23 07:30:36 +00:00
parent 6dd30213c9
commit a0d7e4a1b8
3 changed files with 93 additions and 2 deletions

View File

@ -34,8 +34,8 @@ include(SearchForStuff)
# if no build type is set, use Devel as default
#-------------------------------------------------------------------------------
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE Debug)
message(STATUS "BuildType set to Devel by default")
set(CMAKE_BUILD_TYPE Devel)
message(STATUS "BuildType set to ${CMAKE_BUILD_TYPE} by default")
endif(CMAKE_BUILD_TYPE STREQUAL "")
#-------------------------------------------------------------------------------

View File

@ -0,0 +1,2 @@
# CDVDLinuz plugin
add_subdirectory(Src)

View File

@ -0,0 +1,89 @@
# CDVDlinuz Plugin
# plugin name
set(CDVDlinuzName CDVDlinuz)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
add_definitions(-Wall -m32 -g -fPIC -D_LARGEFILE64_SOURCE)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
add_definitions(-Wall -m32 -O2 -fPIC -fomit-frame-pointer -D_LARGEFILE64_SOURCE -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -m32 -O2 -fPIC -fomit-frame-pointer -D_LARGEFILE64_SOURCE -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# CDVDlinuz sources
set(CDVDlinuzSources
buffer.c
convert.c
ini.c
version.c)
# CDVDlinuz headers
set(CDVDlinuzHeaders
buffer.h
convert.h
ini.h
PS2Edefs.h
PS2Etypes.h
# ERROR It takes /usr/include/alsa/version.h
# Either fix include dir. Or rename the file. Or mv stuff into in another include file.
version.h
)
# CDVDlinuz Linux sources
set(CDVDlinuzLinuxSources
Linux/aboutbox.c
Linux/actualfile.c
Linux/CD.c
Linux/CDVDlinuz.c
Linux/conf.c
Linux/device.c
Linux/DVD.c
Linux/interface.c
Linux/logfile.c
Linux/mainbox.c)
# CDVDlinuz Linux headers
set(CDVDlinuzLinuxHeaders
Linux/aboutbox.h
Linux/actualfile.h
Linux/CD.h
Linux/CDVDlinuz.h
Linux/conf.h
Linux/device.h
Linux/DVD.h
Linux/logfile.h
Linux/mainbox.h)
# add additional include directories
include_directories(.
Linux)
# add library
add_library(${CDVDlinuzName} SHARED
${CDVDlinuzSources}
${CDVDlinuzHeaders}
${CDVDlinuzLinuxSources}
${CDVDlinuzLinuxHeaders})
# set output directory
set_target_properties(${CDVDlinuzName} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# Set link flags
target_link_libraries(${CDVDlinuzName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${CDVDlinuzName} -s)
endif (CMAKE_BUILD_STRIP)