Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Unset CMAKE_INSTALL_PREFIX #113

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ set(CMAKE_BINARY_DIR ${FMILibrary_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/Config.cmake)

# User configuration options and parameters
set(FMILIB_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/../install CACHE PATH "Prefix prepended to install directories")
set(FMILIB_THIRDPARTYLIBS ${CMAKE_SOURCE_DIR}/ThirdParty CACHE PATH "Path to the ThirdParty library dir" )
set(FMILIB_FMI_STANDARD_HEADERS ${FMILIB_THIRDPARTYLIBS}/FMI/default CACHE PATH "Path to the FMI standard headers dir" )

Expand Down Expand Up @@ -109,8 +108,6 @@ if(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${FMILIB_DEFAULT_BUILD_TYPE})
endif()

set(CMAKE_INSTALL_PREFIX ${FMILIB_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories" FORCE)

# debug_message is used to trace the build script
function(debug_message)
if(FMILIB_PRINT_DEBUG_MESSAGES)
Expand Down Expand Up @@ -436,8 +433,6 @@ endfunction()

if(FMILIB_GENERATE_DOXYGEN_DOC)

file(MAKE_DIRECTORY "${FMILIB_INSTALL_PREFIX}/doc")

set(DOXYFILE_IN ${CMAKE_SOURCE_DIR}/Config.cmake/fmilib_doxydoc.conf CACHE INTERNAL "Doxygen config file")
set(DOXYFILE_IMAGE_DIR "${CMAKE_SOURCE_DIR}/images" CACHE INTERNAL "Doxygen images" FORCE)

Expand All @@ -458,13 +453,14 @@ if(FMILIB_GENERATE_DOXYGEN_DOC)
set(DOXYFILE_SOURCE_DIR "${CMAKE_BINARY_DIR}/doc" CACHE INTERNAL "Doxygen default source dir" FORCE)
set(DOXYFILE_EXTRA_SOURCES "${DOXYFILE_EXTRA_SOURCES} \"${CMAKE_SOURCE_DIR}/Test\"")

set(DOXYFILE_OUTPUT_DIR "${FMILIB_INSTALL_PREFIX}/doc")
set(DOXYFILE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/doc")

set(DOXYFILE_STRIP_FROM_PATH "${CMAKE_SOURCE_DIR}")

set(CMAKE_MODULE_PATH ${FMILIB_THIRDPARTYLIBS}/CMakeModules)

include(UseDoxygen/UseDoxygen)

endif(FMILIB_GENERATE_DOXYGEN_DOC)

# Debug only: prints the final value of all the non-environment variables
Expand Down
8 changes: 4 additions & 4 deletions FMILIB_Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ CMake 3.1.3 or later is required in order to build expat.
To build from a terminal command line on Linux or Mac with default settings use:
\code
mkdir build-fmil; cd build-fmil
cmake -DFMILIB_INSTALL_PREFIX=<prefix> <path to FMIL source>
cmake -DCMAKE_INSTALL_PREFIX=<prefix> <path to FMIL source>
make install test
\endcode
To build in MSYS terminal with g++/gcc on Windows:
\code
mkdir build-fmil; cd build-fmil
cmake -DFMILIB_INSTALL_PREFIX=<prefix> -G "MSYS Makefiles" <path to FMIL source>
cmake -DCMAKE_INSTALL_PREFIX=<prefix> -G "MSYS Makefiles" <path to FMIL source>
make install test
\endcode
To build from command line with Microsoft Visual Studio compilers on Windows:
\code
mkdir build-fmil; cd build-fmil
cmake -DFMILIB_INSTALL_PREFIX=<prefix> -G "Visual Studio 10" <path to FMIL source>
cmake -DCMAKE_INSTALL_PREFIX=<prefix> -G "Visual Studio 10" <path to FMIL source>
cmake --build . --config MinSizeRel --target install
\endcode

Expand All @@ -62,7 +62,7 @@ The primary targets of the library build script are:
the project in Visual Studio.

The following build configuration options are provided:
- \b FMILIB_INSTALL_PREFIX - prefix prepended to install directories.\n
- \b CMAKE_INSTALL_PREFIX - prefix prepended to install directories.\n
Default: "../install" \n
This is the main install directory name. Include files will be located in
the "include" subdirectory and library files in the "lib" subdirectory.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ documentation: generate
generate:
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && \
cmake -DFMILIB_INSTALL_PREFIX=../$(INSTALL_DIR) \
cmake -DCMAKE_INSTALL_PREFIX=../$(INSTALL_DIR) \
-DFMILIB_GENERATE_DOXYGEN_DOC=$(GENERATE_DOXYGEN_DOC) \
-DFMILIB_BUILD_WITH_STATIC_RTLIB=$(BUILD_WITH_STATIC_RTLIB) \
-DFMILIB_BUILD_TESTS=$(BUILD_TESTS) \
Expand Down