Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dangla committed Apr 15, 2022
1 parent 012de1b commit a5db3d4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@
*.hold

# Specific headers
BilInfo.h
BilLib.h
BilPath.h
BilVersion.h

# Database

# Specific folders
build

# Specific files
36 changes: 10 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)

# To disable in-source builds
# disable in-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR “In-source build detected!”)
endif()
Expand All @@ -16,15 +16,15 @@ endif()


# set the project name
project(Bil C CXX Fortran)
project(bil C CXX Fortran)


# Add the CMake directory for custon CMake modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")


# Bil path
# --------
# Bil full path
# -------------
set(BIL_PATH ${CMAKE_CURRENT_SOURCE_DIR})


Expand All @@ -42,28 +42,12 @@ set(BIL_SRCDIR ${BIL_PATH}/src)

# Installation directories
# ------------------------
if(WIN32)
set(BIL_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX})
set(BIL_INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX})
set(BIL_INSTALL_MANDIR ${CMAKE_INSTALL_PREFIX})
set(BIL_INSTALL_DOCDIR ${CMAKE_INSTALL_PREFIX})
set(BIL_INSTALL_INFODIR ${CMAKE_INSTALL_PREFIX})
elseif(APPLE)
# set these so that the files get installed nicely in the MacOSX
# .app bundle (FIXME: this screws up a standard "make install" on
# MacOS)
set(BIL_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX})
set(BIL_INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX}/../MacOS)
set(BIL_INSTALL_MANDIR ${CMAKE_INSTALL_PREFIX}/../../..)
set(BIL_INSTALL_DOCDIR ${CMAKE_INSTALL_PREFIX}/../../..)
set(BIL_INSTALL_INFODIR ${CMAKE_INSTALL_PREFIX})
else()
set(BIL_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
set(BIL_INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX}/bin)
set(BIL_INSTALL_MANDIR ${CMAKE_INSTALL_PREFIX}/share/man/man1)
set(BIL_INSTALL_DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc/bil)
set(BIL_INSTALL_INFODIR ${CMAKE_INSTALL_PREFIX}/info)
endif()
include(GNUInstallDirs)
set(BIL_INSTALL_FULL_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR})
set(BIL_INSTALL_FULL_BINDIR ${CMAKE_INSTALL_FULL_BINDIR})
set(BIL_INSTALL_FULL_MAN1DIR ${CMAKE_INSTALL_FULL_MANDIR}/man1)
set(BIL_INSTALL_FULL_DOCDIR ${CMAKE_INSTALL_FULL_DOCDIR})
set(BIL_INSTALL_FULL_INFODIR ${CMAKE_INSTALL_FULL_INFODIR})


# Library of Bil
Expand Down
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ will delete all the local files previously created.
same time. For example, you could configure a release build
in a "build-release" subdirectory with

mkdir build-release
cd build-release
cmake -DCMAKE_BUILD_TYPE=Release ..
make
Expand Down
10 changes: 5 additions & 5 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ set(BIL_OXYGEN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/oxygen)
#=======================================================================
# Target rules for the reference manual in different formats
if(UNIX AND NOT CYGWIN)
install(FILES ${BIL_DOC}.1 DESTINATION ${BIL_INSTALL_MANDIR})
install(FILES ${BIL_DOC}.1 DESTINATION ${BIL_INSTALL_FULL_MAN1DIR})
endif()

add_custom_target(doc DEPENDS pdf txt html info doxy)

set_directory_properties(PROPERTIES
ADDITIONAL_CLEAN_FILES "${BIL_EDITION_DIR}/${BIL_DOC}.aux;${BIL_EDITION_DIR}/${BIL_DOC}.cp;${BIL_EDITION_DIR}/${BIL_DOC}.cps;${BIL_EDITION_DIR}/${BIL_DOC}.html;${BIL_EDITION_DIR}/${BIL_DOC}.info;${BIL_EDITION_DIR}/${BIL_DOC}.log;${BIL_EDITION_DIR}/${BIL_DOC}.pdf;${BIL_EDITION_DIR}/${BIL_DOC}.toc;${BIL_EDITION_DIR}/${BIL_DOC}.tp;${BIL_EDITION_DIR}/${BIL_DOC}.txt;${BIL_OXYGEN_DIR}/${BIL_DOC}.doxy"
ADDITIONAL_CLEAN_FILES "${BIL_EDITION_DIR}/${BIL_DOC}.aux;${BIL_EDITION_DIR}/${BIL_DOC}.cp;${BIL_EDITION_DIR}/${BIL_DOC}.cps;${BIL_EDITION_DIR}/${BIL_DOC}.html;${BIL_EDITION_DIR}/${BIL_DOC}.info;${BIL_EDITION_DIR}/${BIL_DOC}.log;${BIL_EDITION_DIR}/${BIL_DOC}.pdf;${BIL_EDITION_DIR}/${BIL_DOC}.toc;${BIL_EDITION_DIR}/${BIL_DOC}.tp;${BIL_EDITION_DIR}/${BIL_DOC}.txt;${BIL_OXYGEN_DIR}/${BIL_DOC}.doxy;${CMAKE_CURRENT_SOURCE_DIR}/${BIL_DOC}.pdf;${CMAKE_CURRENT_SOURCE_DIR}/${BIL_DOC}.txt;${CMAKE_CURRENT_SOURCE_DIR}/${BIL_DOC}.html"
)


Expand All @@ -35,7 +35,7 @@ if(TEXI2PDF)
COMMAND ${CMAKE_COMMAND} -E copy ${BIL_DOC}.pdf ..
WORKING_DIRECTORY ${BIL_EDITION_DIR})
add_custom_target(pdf DEPENDS ${BIL_DOC}.pdf)
install(FILES ${BIL_EDITION_DIR}/${BIL_DOC}.pdf DESTINATION ${BIL_INSTALL_DOCDIR} OPTIONAL)
install(FILES ${BIL_EDITION_DIR}/${BIL_DOC}.pdf DESTINATION ${BIL_INSTALL_FULL_DOCDIR} OPTIONAL)
endif()


Expand All @@ -47,7 +47,7 @@ if(MAKEINFO)
COMMAND ${MAKEINFO} --enable-encoding -o ${BIL_DOC}.info ${BIL_DOC}.texi
WORKING_DIRECTORY ${BIL_EDITION_DIR})
add_custom_target(info DEPENDS ${BIL_DOC}.info)
install(FILES ${BIL_EDITION_DIR}/${BIL_DOC}.info DESTINATION ${BIL_INSTALL_INFODIR} OPTIONAL)
install(FILES ${BIL_EDITION_DIR}/${BIL_DOC}.info DESTINATION ${BIL_INSTALL_FULL_INFODIR} OPTIONAL)

add_custom_command(OUTPUT ${BIL_DOC}.txt
DEPENDS ${BIL_EDITION_DIR}/${BIL_DOC}.texi
Expand All @@ -62,7 +62,7 @@ if(MAKEINFO)
COMMAND ${CMAKE_COMMAND} -E copy ${BIL_DOC}.html ..
WORKING_DIRECTORY ${BIL_EDITION_DIR})
add_custom_target(html DEPENDS ${BIL_DOC}.html)
install(FILES ${BIL_EDITION_DIR}/${BIL_DOC}.html DESTINATION ${BIL_INSTALL_DOCDIR} OPTIONAL)
install(FILES ${BIL_EDITION_DIR}/${BIL_DOC}.html DESTINATION ${BIL_INSTALL_FULL_DOCDIR} OPTIONAL)
endif()


Expand Down
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ target_compile_features(${BIL_LIB}

set_target_properties(${BIL_LIB}
PROPERTIES
#INSTALL_RPATH "${BIL_INSTALL_LIBDIR}"
#INSTALL_RPATH "${BIL_INSTALL_FULL_LIBDIR}"
LIBRARY_OUTPUT_DIRECTORY ${BIL_LIBDIR}
)

install(TARGETS ${BIL_LIB}
DESTINATION ${BIL_INSTALL_LIBDIR}
DESTINATION ${BIL_INSTALL_FULL_LIBDIR}
LIBRARY OPTIONAL)


Expand Down Expand Up @@ -61,7 +61,7 @@ target_compile_features(${BIL_EXE}

set_target_properties(${BIL_EXE}
PROPERTIES
INSTALL_RPATH "${BIL_INSTALL_LIBDIR}"
INSTALL_RPATH "${BIL_INSTALL_FULL_LIBDIR}"
RUNTIME_OUTPUT_DIRECTORY ${BIL_BINDIR}
)

Expand All @@ -72,13 +72,13 @@ target_link_options(${BIL_EXE}
)

install(TARGETS ${BIL_EXE}
DESTINATION ${BIL_INSTALL_BINDIR}
DESTINATION ${BIL_INSTALL_FULL_BINDIR}
RUNTIME OPTIONAL)



install(CODE
"execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${BIL_INSTALL_BINDIR}/${BIL_EXE} ${BIL_INSTALL_BINDIR}/bil)"
"execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${BIL_INSTALL_FULL_BINDIR}/${BIL_EXE} ${BIL_INSTALL_FULL_BINDIR}/bil)"
)


Expand Down

0 comments on commit a5db3d4

Please sign in to comment.