From a0d7e4a1b8a99907d9acf8acce6e92637b12721f Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sun, 23 May 2010 07:30:36 +0000 Subject: [PATCH] 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 --- CMakeLists.txt | 4 +- plugins/CDVDlinuz/CMakeLists.txt | 2 + plugins/CDVDlinuz/Src/CMakeLists.txt | 89 ++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 plugins/CDVDlinuz/CMakeLists.txt create mode 100644 plugins/CDVDlinuz/Src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 992773b1b6..4cb802bc6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "") #------------------------------------------------------------------------------- diff --git a/plugins/CDVDlinuz/CMakeLists.txt b/plugins/CDVDlinuz/CMakeLists.txt new file mode 100644 index 0000000000..98ac06b0de --- /dev/null +++ b/plugins/CDVDlinuz/CMakeLists.txt @@ -0,0 +1,2 @@ +# CDVDLinuz plugin +add_subdirectory(Src) \ No newline at end of file diff --git a/plugins/CDVDlinuz/Src/CMakeLists.txt b/plugins/CDVDlinuz/Src/CMakeLists.txt new file mode 100644 index 0000000000..28e8fea4bd --- /dev/null +++ b/plugins/CDVDlinuz/Src/CMakeLists.txt @@ -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)