Skip to content

Commit

Permalink
create .so lib with cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio-leblanc committed Oct 25, 2022
1 parent 065b66f commit d057f65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ignore build folders
bin
build
cmakebuild
sconsbuild

# ignore test files
*.json
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(forefire VERSION 1.0)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib)

link_libraries("-lnetcdf_c++ -lnetcdf")

file(GLOB_RECURSE SRC_FILES src/*.cpp)

add_executable(forefire ${SRC_FILES})
add_executable(forefire ${SRC_FILES})

add_library(forefireL SHARED ${SRC_FILES})
5 changes: 3 additions & 2 deletions Sconstruct
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ if int(warnings):


files = Glob('./sconsbuild/*.cpp')
env.Program('./bin/CommandShell', files, LIBS=['netcdf_c++', 'netcdf'])

env.SharedLibrary('./lib/ForeFire', files, LIBS=['netcdf_c++', 'netcdf'])
env.Program('./sconsbuild/bin/CommandShell', files, LIBS=['netcdf_c++', 'netcdf'])

env.SharedLibrary('./sconsbuild/lib/ForeFire', files, LIBS=['netcdf_c++', 'netcdf'])

0 comments on commit d057f65

Please sign in to comment.