From 390245806a61c8c8137c12bae4ba12deae2641be Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 30 Mar 2014 16:28:59 +0200 Subject: [PATCH] cmake: sed /PROJECT_SOURCE_DIR/CMAKE_SOURCE_DIR/ The former depends on the project command. Whereas the latter is the true absolute path of the project --- CMakeLists.txt | 38 +++---- cmake/FindGlew.cmake | 6 +- cmake/SelectPcsx2Plugins.cmake | 24 ++--- cmake/Translation.cmake | 2 +- locales/CMakeLists.txt | 8 +- pcsx2/CMakeLists.txt | 6 +- plugins/CMakeLists.txt | 100 +++++++++--------- plugins/GSdx/CMakeLists.txt | 2 +- plugins/zerogs/dx/CMakeLists.txt | 2 +- plugins/zerogs/opengl/CMakeLists.txt | 4 +- plugins/zzogl-pg/opengl/CMakeLists.txt | 10 +- .../opengl/ZeroGSShaders/CMakeLists.txt | 2 +- tools/bin2cpp/CMakeLists.txt | 2 +- 13 files changed, 103 insertions(+), 103 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4282183902..e1307afa3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE OFF) # set module path -set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # include some generic functions to ensure correctness of the env include(Pcsx2Utils) @@ -106,9 +106,9 @@ include(SelectPcsx2Plugins) write_svnrev_h() # add additional project-wide include directories -include_directories(${PROJECT_SOURCE_DIR}/common/include - ${PROJECT_SOURCE_DIR}/common/include/Utilities - ${PROJECT_SOURCE_DIR}/common/include/x86emitter +include_directories(${CMAKE_SOURCE_DIR}/common/include + ${CMAKE_SOURCE_DIR}/common/include/Utilities + ${CMAKE_SOURCE_DIR}/common/include/x86emitter # File generated by Cmake ${CMAKE_BINARY_DIR}/common/include # WORKAROUND Some issue with multiarch on Debian/Ubuntu @@ -119,14 +119,14 @@ include_directories(${PROJECT_SOURCE_DIR}/common/include ) # make the translation -if(EXISTS "${PROJECT_SOURCE_DIR}/locales") +if(EXISTS "${CMAKE_SOURCE_DIR}/locales") add_subdirectory(locales) -endif(EXISTS "${PROJECT_SOURCE_DIR}/locales") +endif(EXISTS "${CMAKE_SOURCE_DIR}/locales") # make 3rdParty -if(EXISTS "${PROJECT_SOURCE_DIR}/3rdparty") +if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty") add_subdirectory(3rdparty) -endif(EXISTS "${PROJECT_SOURCE_DIR}/3rdparty") +endif(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty") # make common if(common_libs) @@ -135,24 +135,24 @@ if(common_libs) endif(common_libs) # make pcsx2 -if(EXISTS "${PROJECT_SOURCE_DIR}/pcsx2" AND pcsx2_core) +if(EXISTS "${CMAKE_SOURCE_DIR}/pcsx2" AND pcsx2_core) add_subdirectory(pcsx2) -endif(EXISTS "${PROJECT_SOURCE_DIR}/pcsx2" AND pcsx2_core) +endif(EXISTS "${CMAKE_SOURCE_DIR}/pcsx2" AND pcsx2_core) # make plugins -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins") +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins") add_subdirectory(plugins) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins") +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins") #------------------------------------------------------------------------------- # Install some files to ease package creation if(PACKAGE_MODE) - INSTALL(FILES "${PROJECT_SOURCE_DIR}/bin/cheats_ws.zip" DESTINATION "${GAMEINDEX_DIR}") - INSTALL(FILES "${PROJECT_SOURCE_DIR}/bin/GameIndex.dbf" DESTINATION "${GAMEINDEX_DIR}") + INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/cheats_ws.zip" DESTINATION "${GAMEINDEX_DIR}") + INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/GameIndex.dbf" DESTINATION "${GAMEINDEX_DIR}") - INSTALL(FILES "${PROJECT_SOURCE_DIR}/linux_various/pcsx2.desktop" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") - INSTALL(FILES "${PROJECT_SOURCE_DIR}/linux_various/pcsx2.xpm" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pixmaps") - INSTALL(FILES "${PROJECT_SOURCE_DIR}/bin/docs/PCSX2_FAQ.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2") - INSTALL(FILES "${PROJECT_SOURCE_DIR}/bin/docs/PCSX2_Readme.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2") - INSTALL(FILES "${PROJECT_SOURCE_DIR}/bin/docs/pcsx2.1" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/") + INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/pcsx2.desktop" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") + INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/pcsx2.xpm" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pixmaps") + INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_FAQ.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2") + INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_Readme.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2") + INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/pcsx2.1" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/") endif(PACKAGE_MODE) diff --git a/cmake/FindGlew.cmake b/cmake/FindGlew.cmake index 4846eeb152..d9e206e1a8 100644 --- a/cmake/FindGlew.cmake +++ b/cmake/FindGlew.cmake @@ -14,14 +14,14 @@ endif(GLEW_INCLUDE_DIR AND GLEW_LIBRARY) IF (WIN32) FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h $ENV{PROGRAMFILES}/GLEW/include - ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include + ${CMAKE_SOURCE_DIR}/src/nvgl/glew/include DOC "The directory where GL/glew.h resides") FIND_LIBRARY( GLEW_LIBRARY NAMES glew GLEW glew32 glew32s PATHS $ENV{PROGRAMFILES}/GLEW/lib - ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin - ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib + ${CMAKE_SOURCE_DIR}/src/nvgl/glew/bin + ${CMAKE_SOURCE_DIR}/src/nvgl/glew/lib DOC "The GLEW library") ELSE (WIN32) FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake index 8c8dfe12cc..a89627f5c0 100644 --- a/cmake/SelectPcsx2Plugins.cmake +++ b/cmake/SelectPcsx2Plugins.cmake @@ -29,7 +29,7 @@ endif(GLSL_API) #--------------------------------------- if(wxWidgets_FOUND AND SPARSEHASH_FOUND) set(common_libs TRUE) -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/common/src") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/common/src") set(common_libs FALSE) else(wxWidgets_FOUND AND SPARSEHASH_FOUND) set(common_libs FALSE) @@ -48,7 +48,7 @@ endif(wxWidgets_FOUND AND SPARSEHASH_FOUND) # Common dependancy if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs AND AIO_FOUND) set(pcsx2_core TRUE) -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/pcsx2") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/pcsx2") set(pcsx2_core FALSE) else() set(pcsx2_core FALSE) @@ -87,7 +87,7 @@ endif(GTK2_FOUND) #--------------------------------------- if(BZIP2_FOUND AND GTK2_FOUND) set(CDVDiso TRUE) -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDiso") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDiso") set(CDVDiso FALSE) else(BZIP2_FOUND AND GTK2_FOUND) set(CDVDiso FALSE) @@ -132,7 +132,7 @@ endif(GTK2_FOUND) #--------------------------------------- if(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND) set(GSdx TRUE) -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/plugins/GSdx") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx") set(GSdx FALSE) else(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND) set(GSdx FALSE) @@ -151,7 +151,7 @@ endif(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND) #--------------------------------------- if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND) set(zerogs TRUE) -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerogs") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerogs") set(zerogs FALSE) else(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND) set(zerogs FALSE) @@ -177,7 +177,7 @@ if((GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND JPEG_FOUND AND common_libs) AN else(CG_FOUND AND NOT GLSL_API) set(zzoglcg FALSE) endif(CG_FOUND AND NOT GLSL_API) -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg") set(zzogl FALSE) set(zzoglcg FALSE) set(REBUILD_SHADER FALSE) @@ -205,7 +205,7 @@ endif(GTK2_FOUND) #--------------------------------------- if(SDL_FOUND) set(onepad TRUE) -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/plugins/onepad") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/onepad") set(onepad FALSE) else(SDL_FOUND) set(onepad FALSE) @@ -233,7 +233,7 @@ endif(GTK2_FOUND) #--------------------------------------- if(ALSA_FOUND AND PORTAUDIO_FOUND AND SOUNDTOUCH_FOUND AND SDL_FOUND AND common_libs) set(spu2-x TRUE) -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/plugins/spu2-x") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/spu2-x") set(spu2-x FALSE) else() set(spu2-x FALSE) @@ -249,18 +249,18 @@ endif() # -ALSA # -PortAudio #--------------------------------------- -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND) set(zerospu2 TRUE) # Comment the next line, if you want to compile zerospu2 set(zerospu2 FALSE) message(STATUS "Don't build zerospu2. It is super-seeded by spu2x") -elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerospu2") +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2") set(zerospu2 FALSE) -else(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND) +else(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND) set(zerospu2 FALSE) message(STATUS "Skip build of zerospu2: miss some dependencies") message(STATUS "${msg_dep_zerospu2}") -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND) #--------------------------------------- #--------------------------------------- diff --git a/cmake/Translation.cmake b/cmake/Translation.cmake index 87e0335f2c..5ffdcb8c74 100644 --- a/cmake/Translation.cmake +++ b/cmake/Translation.cmake @@ -67,7 +67,7 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 _potFile _firstPoFileArg) IF (PACKAGE_MODE) INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) ELSE (PACKAGE_MODE) - INSTALL(FILES ${_gmoFile} DESTINATION ${PROJECT_SOURCE_DIR}/bin/Langs/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + INSTALL(FILES ${_gmoFile} DESTINATION ${CMAKE_SOURCE_DIR}/bin/Langs/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) ENDIF (PACKAGE_MODE) SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) diff --git a/locales/CMakeLists.txt b/locales/CMakeLists.txt index 41dbf56b16..cea874f929 100644 --- a/locales/CMakeLists.txt +++ b/locales/CMakeLists.txt @@ -8,11 +8,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) if (GETTEXT_FOUND) include(Translation) - file (GLOB_RECURSE PO_ICO_FILES ${PROJECT_SOURCE_DIR}}/locales pcsx2_Iconized.po) - file (GLOB_RECURSE PO_MAIN_FILES ${PROJECT_SOURCE_DIR}/locales pcsx2_Main.po) + file (GLOB_RECURSE PO_ICO_FILES ${CMAKE_SOURCE_DIR}}/locales pcsx2_Iconized.po) + file (GLOB_RECURSE PO_MAIN_FILES ${CMAKE_SOURCE_DIR}/locales pcsx2_Main.po) # Macro to compile po file and install them - GETTEXT_CREATE_TRANSLATIONS_PCSX2(${PROJECT_SOURCE_DIR}/locales/templates/pcsx2_Iconized.pot ALL ${PO_ICO_FILES}) - GETTEXT_CREATE_TRANSLATIONS_PCSX2(${PROJECT_SOURCE_DIR}/locales/templates/pcsx2_Main.pot ALL ${PO_MAIN_FILES}) + GETTEXT_CREATE_TRANSLATIONS_PCSX2(${CMAKE_SOURCE_DIR}/locales/templates/pcsx2_Iconized.pot ALL ${PO_ICO_FILES}) + GETTEXT_CREATE_TRANSLATIONS_PCSX2(${CMAKE_SOURCE_DIR}/locales/templates/pcsx2_Main.pot ALL ${PO_MAIN_FILES}) endif (GETTEXT_FOUND) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index d9ddada26f..897baa2c78 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -400,7 +400,7 @@ set(pcsx2GuiHeaders # from the bin2cpp tools at the good moment (ie .h must be created before the pcsx2 compilation) # Gui resources headers set(res_bin "${CMAKE_BINARY_DIR}/pcsx2/gui/Resources") -set(res_src "${PROJECT_SOURCE_DIR}/pcsx2/gui/Resources") +set(res_src "${CMAKE_SOURCE_DIR}/pcsx2/gui/Resources") set(pcsx2GuiResources ${res_bin}/AppIcon16.h ${res_bin}/AppIcon32.h @@ -677,13 +677,13 @@ add_executable(${Output} ### Generate the resources files file(MAKE_DIRECTORY ${res_bin}) -add_custom_command(OUTPUT "${res_bin}/Dualshock.h" COMMAND perl ${PROJECT_SOURCE_DIR}/linux_various/hex2h.pl "${res_src}/Dualshock.jpg" "${res_bin}/Dualshock" ) +add_custom_command(OUTPUT "${res_bin}/Dualshock.h" COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${res_src}/Dualshock.jpg" "${res_bin}/Dualshock" ) foreach(res_file IN ITEMS AppIcon16 AppIcon32 AppIcon64 BackgroundLogo ButtonIcon_Camera ConfigIcon_Appearance ConfigIcon_Cpu ConfigIcon_Gamefixes ConfigIcon_MemoryCard ConfigIcon_Paths ConfigIcon_Plugins ConfigIcon_Speedhacks ConfigIcon_Video Breakpoint_Active Breakpoint_Inactive) - add_custom_command(OUTPUT "${res_bin}/${res_file}.h" COMMAND perl ${PROJECT_SOURCE_DIR}/linux_various/hex2h.pl "${res_src}/${res_file}.png" "${res_bin}/${res_file}" ) + add_custom_command(OUTPUT "${res_bin}/${res_file}.h" COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${res_src}/${res_file}.png" "${res_bin}/${res_file}" ) endforeach(res_file IN ITEMS AppIcon16 AppIcon32 AppIcon64 BackgroundLogo ButtonIcon_Camera ConfigIcon_Appearance ConfigIcon_Cpu ConfigIcon_Gamefixes ConfigIcon_MemoryCard diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index f2426035fc..5abea77ab7 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -7,127 +7,127 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) # make cdvdGigaherz -#if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/cdvdGigaherz" AND cdvdGigaherz) +#if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/cdvdGigaherz" AND cdvdGigaherz) # add_subdirectory(cdvdGigaherz) -#endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/cdvdGigaherz" AND cdvdGigaherz) +#endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/cdvdGigaherz" AND cdvdGigaherz) # make CDVDiso -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDiso" AND CDVDiso) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDiso" AND CDVDiso) add_subdirectory(CDVDiso/src) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDiso" AND CDVDiso) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDiso" AND CDVDiso) # make CDVDisoEFP -# if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) +# if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) # add_subdirectory(CDVDisoEFP) -# endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) +# endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDisoEFP" AND CDVDisoEFP) # make CDVDlinuz -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDlinuz" AND CDVDlinuz) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDlinuz" AND CDVDlinuz) add_subdirectory(CDVDlinuz/Src) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDlinuz" AND CDVDlinuz) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDlinuz" AND CDVDlinuz) # make CDVDnull -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDnull" AND CDVDnull) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDnull" AND CDVDnull) add_subdirectory(CDVDnull) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDnull" AND CDVDnull) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDnull" AND CDVDnull) # make CDVDolio -# if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDolio" AND CDVDolio) +# if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDolio" AND CDVDolio) # add_subdirectory(CDVDolio) -# endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDolio" AND CDVDolio) +# endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDolio" AND CDVDolio) # make CDVDpeops -#if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDpeops" AND CDVDpeops) +#if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDpeops" AND CDVDpeops) # add_subdirectory(CDVDpeops) -#endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CDVDpeops" AND CDVDpeops) +#endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDpeops" AND CDVDpeops) # make dev9null -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/dev9null" AND dev9null) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/dev9null" AND dev9null) add_subdirectory(dev9null) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/dev9null" AND dev9null) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/dev9null" AND dev9null) # make FWnull -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/FWnull" AND FWnull) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/FWnull" AND FWnull) add_subdirectory(FWnull) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/FWnull" AND FWnull) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/FWnull" AND FWnull) # make GSdx -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/GSdx" AND GSdx) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx" AND GSdx) add_subdirectory(GSdx) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/GSdx" AND GSdx) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx" AND GSdx) # make GSnull -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/GSnull" AND GSnull) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSnull" AND GSnull) add_subdirectory(GSnull) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/GSnull" AND GSnull) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSnull" AND GSnull) # make LilyPad -#if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/LilyPad" AND LilyPad) +#if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/LilyPad" AND LilyPad) # add_subdirectory(LilyPad) -#endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/LilyPad" AND LilyPad) +#endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/LilyPad" AND LilyPad) # make onepad -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/onepad" AND onepad) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/onepad" AND onepad) add_subdirectory(onepad) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/onepad" AND onepad) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/onepad" AND onepad) # make PadNull -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PadNull" AND PadNull) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/PadNull" AND PadNull) add_subdirectory(PadNull) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PadNull" AND PadNull) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/PadNull" AND PadNull) # make PeopsSPU2 -# if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PeopsSPU2" AND PeopsSPU2) +# if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/PeopsSPU2" AND PeopsSPU2) # add_subdirectory(PeopsSPU2) -# endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/PeopsSPU2" AND PeopsSPU2) +# endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/PeopsSPU2" AND PeopsSPU2) # make SPU2null -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/SPU2null" AND SPU2null) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/SPU2null" AND SPU2null) add_subdirectory(SPU2null) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/SPU2null" AND SPU2null) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/SPU2null" AND SPU2null) # make spu2-x -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/spu2-x" AND spu2-x) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/spu2-x" AND spu2-x) add_subdirectory(spu2-x/src) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/spu2-x" AND spu2-x) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/spu2-x" AND spu2-x) # make SSSPSXPAD -#if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/SSSPSXPAD" AND SSSPSXPAD) +#if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/SSSPSXPAD" AND SSSPSXPAD) # add_subdirectory(SSSPSXPAD) -#endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/SSSPSXPAD" AND SSSPSXPAD) +#endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/SSSPSXPAD" AND SSSPSXPAD) # make USBnull -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/USBnull" AND USBnull) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/USBnull" AND USBnull) add_subdirectory(USBnull) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/USBnull" AND USBnull) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/USBnull" AND USBnull) # make xpad -#if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/xpad" AND xpad) +#if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/xpad" AND xpad) # add_subdirectory(xpad) -#endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/xpad" AND xpad) +#endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/xpad" AND xpad) # make zerogs -#if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerogs" AND zerogs) +#if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerogs" AND zerogs) # add_subdirectory(zerogs) -#endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerogs" AND zerogs) +#endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerogs" AND zerogs) # make zzogl-pg -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) add_subdirectory(zzogl-pg/opengl) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) # make zzogl-pg -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg-cg" AND zzoglcg AND EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg-cg" AND zzoglcg AND EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) add_subdirectory(zzogl-pg-cg/opengl) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg-cg" AND zzoglcg AND EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg-cg" AND zzoglcg AND EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg" AND zzogl) # make zeropad -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zeropad" AND zeropad) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zeropad" AND zeropad) add_subdirectory(zeropad) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zeropad" AND zeropad) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zeropad" AND zeropad) # make zerospu2 -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerospu2" AND zerospu2) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND zerospu2) add_subdirectory(zerospu2) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zerospu2" AND zerospu2) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND zerospu2) diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index d3a4a2c703..3f98def642 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -188,7 +188,7 @@ include_directories(.) # Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL if (REBUILD_SHADER) - add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${PROJECT_SOURCE_DIR}/linux_various/glsl2h.pl) + add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl) endif() add_library(${Output} SHARED ${GSdxSources} ${GSdxHeaders}) diff --git a/plugins/zerogs/dx/CMakeLists.txt b/plugins/zerogs/dx/CMakeLists.txt index 988918f080..70813e0c12 100644 --- a/plugins/zerogs/dx/CMakeLists.txt +++ b/plugins/zerogs/dx/CMakeLists.txt @@ -43,7 +43,7 @@ add_library(${zerogsName} SHARED # set output directory set_target_properties(${zerogsName} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/plugins) # Debug - Build if(CMAKE_BUILD_TYPE STREQUAL Debug) diff --git a/plugins/zerogs/opengl/CMakeLists.txt b/plugins/zerogs/opengl/CMakeLists.txt index aae2238a8e..d365e4df1d 100644 --- a/plugins/zerogs/opengl/CMakeLists.txt +++ b/plugins/zerogs/opengl/CMakeLists.txt @@ -117,11 +117,11 @@ add_library(${Output} SHARED # set output directory set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/plugins) # copy ps2hw.dat to plugins folder add_custom_command(TARGET ${Output} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/plugins/zerogs/opengl/Win32/ps2hw.dat ${PROJECT_SOURCE_DIR}/bin/plugins) + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/plugins/zerogs/opengl/Win32/ps2hw.dat ${CMAKE_SOURCE_DIR}/bin/plugins) # link target with Cg target_link_libraries(${Output} ${CG_LIBRARIES}) diff --git a/plugins/zzogl-pg/opengl/CMakeLists.txt b/plugins/zzogl-pg/opengl/CMakeLists.txt index e16f21e5d5..5e27853355 100644 --- a/plugins/zzogl-pg/opengl/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/CMakeLists.txt @@ -6,9 +6,9 @@ if(NOT TOP_CMAKE_WAS_SOURCED) endif(NOT TOP_CMAKE_WAS_SOURCED) # Allow to build the shader files -if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl/ZeroGSShaders" AND REBUILD_SHADER AND NOT GLSL_API) +if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ZeroGSShaders" AND REBUILD_SHADER AND NOT GLSL_API) add_subdirectory(ZeroGSShaders) -endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl/ZeroGSShaders" AND REBUILD_SHADER AND NOT GLSL_API) +endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ZeroGSShaders" AND REBUILD_SHADER AND NOT GLSL_API) # plugin name set(Output zzogl-0.4.0) @@ -156,7 +156,7 @@ include_directories(. # Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL if (REBUILD_SHADER) - add_custom_command(OUTPUT ps2hw_gl4.h COMMAND perl ${PROJECT_SOURCE_DIR}/linux_various/glsl2h.pl) + add_custom_command(OUTPUT ps2hw_gl4.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl) endif() # add library @@ -206,9 +206,9 @@ endif() if(NOT GLSL_API AND NOT REBUILD_SHADER) if(PACKAGE_MODE) - install(FILES ${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${PLUGIN_DIR}) + install(FILES ${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${PLUGIN_DIR}) else() - install(FILES ${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) + install(FILES ${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) endif() endif() diff --git a/plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt b/plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt index 562faaf5a4..143a487c94 100644 --- a/plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt @@ -63,7 +63,7 @@ endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") # Now build the shader add_custom_command(TARGET ${Output} POST_BUILD COMMAND ${Output} ps2hw.fx ${CMAKE_CURRENT_BINARY_DIR}/ps2hw_cmake.dat - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl ) if(PACKAGE_MODE) diff --git a/tools/bin2cpp/CMakeLists.txt b/tools/bin2cpp/CMakeLists.txt index e2ceb0603a..db42d98f59 100644 --- a/tools/bin2cpp/CMakeLists.txt +++ b/tools/bin2cpp/CMakeLists.txt @@ -32,5 +32,5 @@ set(bin2cppHeaders add_executable(${bin2cppName} ${bin2cppSources} ${bin2cppHeaders}) # set output directory -# set_target_properties(${bin2cppName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/tools/bin) +# set_target_properties(${bin2cppName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/tools/bin)