2010-06-22 13:30:36 +00:00
|
|
|
# Check that people use the good file
|
|
|
|
if(NOT TOP_CMAKE_WAS_SOURCED)
|
|
|
|
message(FATAL_ERROR "
|
|
|
|
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
|
|
|
|
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
|
|
|
|
endif(NOT TOP_CMAKE_WAS_SOURCED)
|
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# plugin name
|
|
|
|
set(CDVDnullName CDVDnull)
|
|
|
|
|
2010-06-03 15:12:29 +00:00
|
|
|
set(CommonFlags
|
|
|
|
-Wall
|
|
|
|
-m32
|
|
|
|
)
|
|
|
|
|
|
|
|
set(OptimizationFlags
|
|
|
|
-O2
|
2010-06-05 11:56:52 +00:00
|
|
|
-DNDEBUG
|
2010-06-03 15:12:29 +00:00
|
|
|
)
|
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# Debug - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
# add defines
|
2010-06-03 15:12:29 +00:00
|
|
|
add_definitions(${CommonFlags} -g)
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
|
|
|
|
# Devel - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
# add defines
|
2010-06-03 15:12:29 +00:00
|
|
|
add_definitions(${CommonFlags} ${OptimizationFlags})
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
|
|
|
|
# Release - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
# add defines
|
2010-06-03 15:12:29 +00:00
|
|
|
add_definitions(${CommonFlags} ${OptimizationFlags})
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
# CDVDnull sources
|
|
|
|
set(CDVDnullSources
|
|
|
|
CDVD.cpp)
|
2010-06-03 15:12:29 +00:00
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
# CDVDnull headers
|
|
|
|
set(CDVDnullHeaders
|
|
|
|
CDVD.h)
|
|
|
|
|
|
|
|
# CDVDnull Linux sources
|
|
|
|
set(CDVDnullLinuxSources
|
|
|
|
Linux/callbacks.c
|
|
|
|
Linux/Config.cpp
|
|
|
|
Linux/interface.c
|
|
|
|
Linux/support.c)
|
|
|
|
|
|
|
|
# CDVDnull Linux headers
|
|
|
|
set(CDVDnullLinuxHeaders
|
|
|
|
Linux/callbacks.h
|
|
|
|
Linux/Config.h
|
|
|
|
Linux/interface.h
|
|
|
|
Linux/support.h)
|
|
|
|
|
|
|
|
# CDVDnull Windows sources
|
|
|
|
set(CDVDnullWindowsSources
|
|
|
|
Windows/CDVDnull.def
|
|
|
|
Windows/plugin.def)
|
|
|
|
|
|
|
|
# CDVDnull Windows headers
|
|
|
|
set(CDVDnullWindowsHeaders
|
|
|
|
)
|
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# add additional include directories
|
|
|
|
include_directories(.)
|
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
# add library
|
2010-06-03 15:12:29 +00:00
|
|
|
add_library(${CDVDnullName} SHARED
|
2010-01-21 15:12:50 +00:00
|
|
|
${CDVDnullSources}
|
|
|
|
${CDVDnullHeaders}
|
|
|
|
${CDVDnullLinuxSources}
|
2010-01-22 04:36:49 +00:00
|
|
|
${CDVDnullLinuxHeaders})
|
2010-06-03 15:12:29 +00:00
|
|
|
|
2010-05-16 00:36:42 +00:00
|
|
|
# Force the linker into 32 bits mode
|
|
|
|
target_link_libraries(${CDVDnullName} -m32)
|
|
|
|
|
2010-05-16 00:12:10 +00:00
|
|
|
# Linker strip option
|
|
|
|
if (CMAKE_BUILD_STRIP)
|
|
|
|
target_link_libraries(${CDVDnullName} -s)
|
|
|
|
endif (CMAKE_BUILD_STRIP)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# set output directory
|
|
|
|
set_target_properties(${CDVDnullName} PROPERTIES
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
|
|
|
|
|