diff --git a/CMakeLists.txt b/CMakeLists.txt index a316b76..ff648ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,11 +21,11 @@ set( PROJECT_DESCRIPTION "${EXTPKG_DESC}" CACHE PATH "Project description" FORCE # Load some handy CMake modules #------------------------------------------------------------------------------ -if( NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/modules" ) - message( FATAL_ERROR "CMake modules directory not found! ${CMAKE_SOURCE_DIR}/cmake/modules" ) +if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ) + message( FATAL_ERROR "CMake modules directory not found! ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ) else() - set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules" ) + set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ) include( Vdump ) include( Trace ) @@ -76,11 +76,11 @@ check_header( stdint.h ) # defines HAVE_STDINT_H # Always generate the platform.h header #------------------------------------------------------------------------------ -if( NOT EXISTS ${CMAKE_SOURCE_DIR}/platform.h.in ) +if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/platform.h.in ) message( FATAL_ERROR "Unable to find platform.h.in!" ) else() - configure_file( ${CMAKE_SOURCE_DIR}/platform.h.in - ${CMAKE_BINARY_DIR}/platform.h ) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/platform.h.in + ${CMAKE_CURRENT_BINARY_DIR}/platform.h ) endif() @@ -153,7 +153,7 @@ configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" # Now simply define an uninstall target that will run the above script. -add_custom_target( uninstall +add_custom_target( ${EXTPKG_NAME}_uninstall COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" ) diff --git a/cmake/modules/ParseBinaryDir.cmake b/cmake/modules/ParseBinaryDir.cmake index 7983107..3acc664 100644 --- a/cmake/modules/ParseBinaryDir.cmake +++ b/cmake/modules/ParseBinaryDir.cmake @@ -80,7 +80,9 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a string( LENGTH ${CONFIG} _n ) if( ${_n} LESS 1 ) - message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" ) + message( WARNING "Invalid Release/Debug build type! ${CONFIG}" ) + message( WARNING "Defaulting to Release_64" ) + set( CONFIG "Release" ) endif() #-------------------------------------------------------------------------- @@ -92,7 +94,9 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a Capitalize_Word( ${CONFIG} CONFIG ) if(( NOT CONFIG STREQUAL "Debug" ) AND (NOT CONFIG STREQUAL "Release" )) - message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" ) + message( WARNING "Invalid Release/Debug build type! ${CONFIG}" ) + message( WARNING "Defaulting to Release_64" ) + set( CONFIG "Release" ) endif() #-------------------------------------------------------------------------- @@ -116,7 +120,7 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a string( LENGTH ${_xxxxx} _n ) if( ${_n} LESS 3 ) - message( FATAL_ERROR "Invalid base package name! ${_xxxxx}" ) + message( WARNING "Invalid base package name! ${_xxxxx}" ) endif() math( EXPR _n "${_n} - 2" ) # (want the last two characters) @@ -126,7 +130,10 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a if( NOT BITNESS STREQUAL "32" AND NOT BITNESS STREQUAL "64" ) - message( FATAL_ERROR "Invalid package architecture! ${BITNESS}" ) + message( WARNING "Invalid package architecture! ${BITNESS}" ) + message( WARNING "Defaulting to 64-bit" ) + set( BITNESS "64" ) + set( BASENAME ${EXTPKG_NAME} ) endif() #-------------------------------------------------------------------------- diff --git a/includes.txt b/includes.txt index df3c9b0..7ff1999 100644 --- a/includes.txt +++ b/includes.txt @@ -4,8 +4,8 @@ include_directories( BEFORE - ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/include + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include ) #------------------------------------------------------------------------------