forked from meco-group/mockups
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(hsl | ||
LANGUAGES C) | ||
|
||
set(INSTALL_PREFIX "") | ||
|
||
get_directory_property(hasParent PARENT_DIRECTORY) | ||
if(hasParent) | ||
set(INSTALL_PREFIX "${PROJECT_NAME}/") | ||
endif() | ||
|
||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||
|
||
add_library(hsl SHARED src/hsl.c include/hsl.h) | ||
|
||
if(CMAKE_SIZEOF_VOID_P EQUAL 4) | ||
set(NBITS_TWO "32") | ||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(NBITS_TWO "64") | ||
endif() | ||
|
||
set(ARCHIVE_DIR lib) | ||
set(RUNTIME_DIR bin) | ||
|
||
if(${CMAKE_GENERATOR} MATCHES "Visual Studio*") | ||
set(ARCHIVE_DIR extern/lib/win${NBITS_TWO}/microsoft) | ||
set(RUNTIME_DIR bin/win${NBITS_TWO}) | ||
elseif(${CMAKE_GENERATOR} MATCHES "MSYS Makefiles") | ||
set(ARCHIVE_DIR extern/lib/win${NBITS_TWO}/mingw${NBITS_TWO}) | ||
set(RUNTIME_DIR bin/win${NBITS_TWO}) | ||
endif() | ||
|
||
install(TARGETS ${LIBRARY_NAME} EXPORT hslTargets | ||
LIBRARY DESTINATION ${INSTALL_PREFIX}lib | ||
ARCHIVE DESTINATION ${INSTALL_PREFIX}${ARCHIVE_DIR} | ||
RUNTIME DESTINATION ${INSTALL_PREFIX}${RUNTIME_DIR}) | ||
|
||
|
||
install(TARGETS hsl EXPORT hslTargets | ||
LIBRARY DESTINATION ${INSTALL_PREFIX}lib | ||
ARCHIVE DESTINATION ${INSTALL_PREFIX}lib | ||
RUNTIME DESTINATION ${INSTALL_PREFIX}bin | ||
INCLUDES DESTINATION ${INSTALL_PREFIX}include) | ||
|
||
target_include_directories(hsl PUBLIC | ||
$<BUILD_INTERFACE:${hsl_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:${INSTALL_PREFIX}include> | ||
) | ||
|
||
install(DIRECTORY include/ DESTINATION ${INSTALL_PREFIX}include) | ||
|
||
install(EXPORT hslTargets | ||
FILE hslTargets.cmake | ||
NAMESPACE hsl:: | ||
DESTINATION cmake | ||
) | ||
|
||
include(CMakePackageConfigHelpers) | ||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/hslConfigVersion.cmake | ||
VERSION 13.1 | ||
COMPATIBILITY SameMajorVersion | ||
) | ||
|
||
configure_package_config_file( | ||
"${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake.in" | ||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" | ||
INSTALL_DESTINATION | ||
cmake) | ||
|
||
|
||
|
||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/hslConfigVersion.cmake" | ||
DESTINATION cmake | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") | ||
check_required_components("@PROJECT_NAME@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
extern "C" { | ||
void ma27id_(int* ICNTL, double* CNTL); | ||
void ma27ad_(int *N, int *NZ, const int *IRN, const int* ICN, | ||
int *IW, int* LIW, int* IKEEP, int *IW1, | ||
int* NSTEPS, int* IFLAG, int* ICNTL, | ||
double* CNTL, int *INFO, double* OPS); | ||
void ma27bd_(int *N, int *NZ, const int *IRN, const int* ICN, | ||
double* A, int* LA, int* IW, int* LIW, | ||
int* IKEEP, int* NSTEPS, int* MAXFRT, | ||
int* IW1, int* ICNTL, double* CNTL, | ||
int* INFO); | ||
void ma27cd_(int *N, double* A, int* LA, int* IW, | ||
int* LIW, double* W, int* MAXFRT, | ||
double* RHS, int* IW1, int* NSTEPS, | ||
int* ICNTL, double* CNTL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
void ma27id_(int* ICNTL, double* CNTL) {} | ||
void ma27ad_(int *N, int *NZ, const int *IRN, const int* ICN, | ||
int *IW, int* LIW, int* IKEEP, int *IW1, | ||
int* NSTEPS, int* IFLAG, int* ICNTL, | ||
double* CNTL, int *INFO, double* OPS) {} | ||
void ma27bd_(int *N, int *NZ, const int *IRN, const int* ICN, | ||
double* A, int* LA, int* IW, int* LIW, | ||
int* IKEEP, int* NSTEPS, int* MAXFRT, | ||
int* IW1, int* ICNTL, double* CNTL, | ||
int* INFO) {} | ||
void ma27cd_(int *N, double* A, int* LA, int* IW, | ||
int* LIW, double* W, int* MAXFRT, | ||
double* RHS, int* IW1, int* NSTEPS, | ||
int* ICNTL, double* CNTL) {} |