Skip to content
Snippets Groups Projects
Commit 26858696 authored by Carl Klemm's avatar Carl Klemm
Browse files

rename eisgenerator, make a shared libary

parent 2f046a38
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required(VERSION 3.20)
project(ehigeneratorsa)
project(eisgenerator)
set(SRC_FILES
main.cpp
componant.cpp
cap.cpp
resistor.cpp
......@@ -14,12 +13,33 @@ set(SRC_FILES
paralellseriel.cpp
)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SPICE REQUIRED ngspice)
set(API_HEADERS
eisgenerator/componant.h
eisgenerator/cap.h
eisgenerator/resistor.h
eisgenerator/constantphase.h
eisgenerator/warburg.h
eisgenerator/model.h
eisgenerator/tokenize.h
eisgenerator/paralellseriel.h
)
add_executable(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} ${SPICE_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC ${SPICE_CFLAGS} .)
add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} ${LIBS})
target_include_directories(${PROJECT_NAME} PUBLIC eisgenerator)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-std=c++20 -Wall -O3 -march=native -g" LINK_FLAGS "-flto")
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
set(CMAKE_INSTALL_PREFIX "/usr")
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
install(FILES ${API_HEADERS} DESTINATION include/${PROJECT_NAME})
link_directories(${CMAKE_CURRENT_BINARY_DIR})
set(SRC_FILES_TEST_APP main.cpp)
set(LIBS_TEST -l${PROJECT_NAME})
add_executable(${PROJECT_NAME}_test ${SRC_FILES_TEST_APP})
add_dependencies(${PROJECT_NAME}_test ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_test ${LIBS_TEST})
target_include_directories(${PROJECT_NAME}_test PUBLIC eisgenerator)
set_target_properties(${PROJECT_NAME}_test PROPERTIES COMPILE_FLAGS "-std=c++20 -Wall -O3 -march=native -g" LINK_FLAGS "-flto")
install(TARGETS ${PROJECT_NAME}_test DESTINATION bin)
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
......@@ -77,6 +77,6 @@ void runSweep()
int main(int argc, char** argv)
{
runSingle();
//runSweep();
runSweep();
return 0;
}
......@@ -258,7 +258,7 @@ bool Model::sweepParams(const std::vector<Range>& componantRanges, const Range&
{
if(componantRanges[i].count == 0 || (componantRanges[i].count < 2 && componantRanges[i].start != componantRanges[i].end))
{
std::cout<<"Error: paramter range must specify at least one paramter point if only one paramer point is specified star and end must be the same\n";
std::cout<<"Error: paramter range must specify at least one paramter point if only one paramer point is specified start and end must be the same\n";
return false;
}
else if(componantRanges[i].start > componantRanges[i].end)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment