Skip to content

Commit

Permalink
Match PR#6 from crypto extpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
friedkiwi committed Jun 4, 2022
1 parent e0e2a91 commit 1f93e48
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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()


Expand Down Expand Up @@ -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" )

Expand Down
15 changes: 11 additions & 4 deletions cmake/modules/ParseBinaryDir.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

#--------------------------------------------------------------------------
Expand All @@ -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()

#--------------------------------------------------------------------------
Expand All @@ -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)
Expand All @@ -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()

#--------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions includes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

include_directories( BEFORE

${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
)

#------------------------------------------------------------------------------
Expand Down

0 comments on commit 1f93e48

Please sign in to comment.